Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add athola/claude-night-market --skill context-optimizationgit clone --depth 1 https://github.com/athola/claude-night-marketWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/athola/claude-night-market/context-optimization)<a href="https://agentmods.dev/skills/athola/claude-night-market/context-optimization"><img src="https://agentmods.dev/badge/skills/athola/claude-night-market/context-optimization/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/athola/claude-night-market/context-optimization"><img src="https://agentmods.dev/badge/skills/athola/claude-night-market/context-optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00031 | $0.01116 |
| Opus 5.5 | $0.00012 | $0.00446 |
| Sonnet 5.5 | $0.00006 | $0.00223 |
| Haiku 4.5 | $0.00003 | $0.00112 |
Grade A, and why
context-optimization scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context Optimization Hub
When To Use
- Threshold Alert: When context usage approaches 50% of the window.
- Complex Tasks: For operations requiring multi-file analysis or long tool chains.
When NOT To Use
- Simple single-step tasks with low context usage
- Already using mcp-code-execution for tool chains
Core Hub Responsibilities
- Assess context pressure and MECW compliance.
- Route to appropriate specialized modules.
- Coordinate subagent-based workflows.
- Manage token budget allocation across modules.
- Synthesize results from modular execution.
Module Selection Strategy
def select_optimal_modules(context_situation, task_complexity):
if context_situation == "CRITICAL":
return ["mecw-assessment", "subagent-coordination"]
elif task_complexity == "high":
return ["mecw-principles", "subagent-coordination"]
else:
return ["mecw-assessment"]
Context Classification
| Utilization | Status | Action |
|---|---|---|
| < 30% | LOW | Continue normally |
| 30-50% | MODERATE | Monitor, apply principles |
| > 50% | CRITICAL | Immediate optimization required |
Large Output Handling (Claude Code 2.1.2+)
Behavior Change: Large bash command and tool outputs are saved to disk instead of being truncated, and file references are provided for access.
Impact on Context Optimization
| Scenario | Before 2.1.2 | After 2.1.2 |
|---|---|---|
| Large test output | Truncated, partial data | Full output via file reference |
| Verbose build logs | Lost after 30K chars | Complete, accessible on-demand |
| Context pressure | Less from truncation | Same - only loaded when read |
Best Practices
- Avoid pre-emptive reads: Large outputs arrive as file references and stay out of context until read.
- Read selectively: Use
head,tail, orgrepon file references. - Use full data: Quality gates can access complete test results via files.
- Monitor growth: File references are small, but reading the full files adds to context.
What ships with it
12 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- modules/belief-clarity.md 3.8 KB
- modules/cache-aligned-prefixes.md 3.9 KB
- modules/compression-strategies.md 2.6 KB
- modules/context-waiting.md 9.5 KB
- modules/findings-format.md 2.0 KB
- modules/log-debugging-hygiene.md 8.3 KB
- modules/mecw-assessment.md 5.0 KB
- modules/mecw-principles.md 17 KB
- modules/memory-tiers.md 2.1 KB
- modules/reversible-compression.md 11 KB
- modules/session-routing.md 2.9 KB
- modules/subagent-coordination.md 22 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago Changed · -1 lines d533b98b1873
- 17d ago Changed c5d4069db244
- 25d ago Changed · -1 lines dd730bb7b29d
- 1mo ago Changed · -21 lines e6dafc5d9573
- 1mo ago Changed · +11 lines 79b32616e055
- 2mo ago Changed · -9 lines 6356a54dbbd0
- 2mo ago First seen · 139 lines · 31 tokens per session scan A a8c74b7b4177
context-optimization is a skill published in the GitHub repository athola/claude-night-market (358 stars, last pushed today), licensed MIT. It adds 31 tokens to every session and 1,116 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
context-optimization compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| context-optimizationathola/claude-night-market | Skill | 358 | today | MIT | A | 31 | Claude Code |
| setupccplugins/awesome-claude-code-plugins | Skill | 1.0k | 3mo ago | Apache-2.0 | A | 90 | Claude Code |
| syncccplugins/awesome-claude-code-plugins | Skill | 1.0k | 3mo ago | Apache-2.0 | A | 138 | Claude Code |
| preserveccplugins/awesome-claude-code-plugins | Skill | 1.0k | 3mo ago | Apache-2.0 | A | 118 | Claude Code |
| askccplugins/awesome-claude-code-plugins | Skill | 1.0k | 3mo ago | Apache-2.0 | A | 141 | Claude Code |
| compressccplugins/awesome-claude-code-plugins | Skill | 1.0k | 3mo ago | Apache-2.0 | A | 104 | Claude Code |
| checkpointShweta-Mishra-ai/tokenmizer | Skill | 35 | today | MIT | A | 61 | Claude Code |