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 | $0.00009 | $0.00179 |
| Sonnet 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 8d 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.
- 8d 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 5mo ago), licensed MIT. It adds 18 tokens to every session and 357 once invoked, about $0.0001 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
memory-search
PROACTIVELY search conversation history and semantic memory BEFORE starting new work. Use at the START of any non-trivial task to recall prior decisions, avoid repeating past discussions, and reuse what was already learned. Also use when the user asks to "search memory", "what did we discuss", "remember when", "find…
session-handoff
Context transfer between AI sessions. Trigger when the user wants to save the context, resume a task, or hand off the work to another session.
memory-search
Use this skill only when the user explicitly asks to query the EvoFlux application database with SQL for structured analysis that ordinary recall cannot answer: aggregating tool failures across sessions, filtering by role, agent, or time range, reconstructing a complete execution chain, or checking a remembered claim…
learner
Post-debugging knowledge extraction — captures non-obvious, codebase-specific learnings that pass quality gates. Invoke after resolving tricky bugs or discovering surprising behavior.
context-management
Strategies for managing AI agent context windows including optimization, summarization, retrieval-augmented generation, progressive disclosure, and pruning. Use when the user is hitting context limits, building long-running agents, implementing RAG, optimizing token usage, or designing systems that need to manage…
knowledge-persistence
Patterns for learning from corrections, capturing instincts, extracting stable patterns, and building cross-session knowledge. Use when the user corrects you, when you discover a recurring pattern, or when insights should persist beyond the current session.