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.01265 |
| Opus 5 | $0.00015 | $0.00633 |
| Sonnet 5 | $0.00006 | $0.00253 |
| Haiku 4.5 | $0.00003 | $0.00127 |
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 5d 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 — 139 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Table of Contents
- When to Use
- Core Hub Responsibilities
- Module Selection Strategy
- Context Classification
- Integration Points
- Resources
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; 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 |
What ships with it
9 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/context-waiting.md 9.5 KB
- modules/findings-format.md 1.7 KB
- modules/mecw-assessment.md 5.0 KB
- modules/mecw-principles.md 17 KB
- modules/memory-tiers.md 2.1 KB
- modules/session-routing.md 2.4 KB
- modules/subagent-coordination.md 24 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.
- 5d 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 (336 stars, last pushed 2d ago), licensed MIT. It adds 31 tokens to every session and 1,265 once invoked, about $0.0002 per session on Opus 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.
Other skills, from other repositories
preserve
Single write point for the vault. Centralizes entity detection, textual matching, entity creation/update, and bidirectional linking. Accepts structured input (list of entities), free-form input (text, meeting notes, session context), or graphify output (graph.json + obsidian markdown from /graphify pipeline). Use…
setup
Initialize any folder as a Bedrock-powered Obsidian vault. Creates entity directories, copies templates, configures language and domain taxonomy, scaffolds connected example entities, and checks dependencies. Use when: "bedrock setup", "bedrock-setup", "/bedrock:setup", "initialize vault", "setup vault", "create…
sync
Re-synchronizes the vault with external sources. In default mode, scans the sources field of all entities, deduplicates URLs, fetches updated content from each source (Confluence, GDocs, GitHub, Markdown), performs incremental diff and delegates writing to /bedrock:preserve. With --people, scans actor repositories via…
ask
Adaptive vault reader skill. Receives a natural language question, searches the vault first (Glob/Grep, entity reads, wikilink traversal), then self-assesses whether more context is needed. Escalates to /graphify for graph-level understanding or to /bedrock:teach for remote content ingestion only when the vault alone…
compress
Vault alignment engine. Detects and fixes 5 types of structural misalignments: broken backlinks, concept fragmentation, entity miscategorization, duplicated entities, and misnamed entities. Delegates all writes to /bedrock:preserve. Supports interactive mode (user confirmation) and cron mode (autonomous mechanical…
gdoc-to-markdown
Internal fetcher module for Google Docs and Sheets. Fetches content via MCP (preferred, when available), Google API with bearer token or public URL export (fallback), or browser DOM extraction via Claude in Chrome (last resort) and returns Markdown. Used by /bedrock:teach and /bedrock:sync — not intended for direct…