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 ApexIQ/skillsmith --skill context_optimizationgit clone --depth 1 https://github.com/ApexIQ/skillsmithWrote 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/apexiq/skillsmith/context_optimization)<a href="https://agentmods.dev/skills/apexiq/skillsmith/context_optimization"><img src="https://agentmods.dev/badge/skills/apexiq/skillsmith/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/apexiq/skillsmith/context_optimization"><img src="https://agentmods.dev/badge/skills/apexiq/skillsmith/context_optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.00018 | $0.00357 |
| Opus 5.5 | $0.00007 | $0.00143 |
| Sonnet 5.5 | $0.00004 | $0.00071 |
| Haiku 4.5 | $0.00002 | $0.00036 |
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 2mo 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.
What it actually says
Context Optimization
"Context Rot" occurs when an Agent's context window fills with irrelevant history, causing it to forget early instructions or hallucinate. Use these strategies to stay sharp.
1. The "Repo Map" Strategy
Don't read every file. Use high-level maps.
- Tree: Run
treeorls -Rto understand structure. - Signatures: Read only function signatures/classes (using
greporoutlinetools) before reading full implementations.
2. Summarize & Flush
If the conversation gets too long (> 20 turns):
- Summarize: Compress all recent progress into
.agent/STATE.md. - Flush: Recommend the user start a new session/chat window.
"I have updated
STATE.md. Please start a new chat and uploadSTATE.mdto continue with a fresh context."
3. Target "Need-to-Know"
- Don't dump an entire 1000-line log into context.
- Do
grepthe log for "Error" or "Exception". - Don't read
node_modulesorvenv.
4. Artifact-Driven Memory
Never rely on "I told you 5 messages ago."
- If a decision is made, write it down in
.agent/decisions/ADR-001.mdor.agent/PROJECT.md. - File contents are permanent; Chat history is ephemeral.
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.
- 2mo ago First seen · 40 lines · 18 tokens per session scan A 9fe932fd72d7
context_optimization is a skill published in the GitHub repository ApexIQ/skillsmith (5 stars, last pushed 8mo ago), licensed MIT. It adds 18 tokens to every session and 357 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_optimizationApexIQ/skillsmith | Skill | 5 | 8mo ago | MIT | A | 18 | Claude Code, Codex |
| memory-search23blocks-OS/ai-maestro-plugins | Skill | 11 | yesterday | MIT | A | 104 | Claude Code |
| memory-searchevoelsewhere/evoflux | Skill | 13 | 26d ago | Apache-2.0 | A | 112 | Claude Code |
| session-handoffchristopherlouet/claude-base | Skill | 5 | 14d ago | MIT | A | 33 | Claude Code |
| learnerXeldarAlz/everything-claude-unity | Skill | 25 | 7mo ago | MIT | A | 34 | Claude Code |
| context-engineeringkarthikrshet/aiskills | Skill | 4 | 2d ago | none | A | 73 | Claude Code, Codex |
| context-managementVersoXBT/claude-initial-setup | Skill | 4 | 6mo ago | MIT | A | 66 | Claude Code |