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 VoDaiLocz/kilo-kit-mcp --skill context-optimizationgit clone --depth 1 https://github.com/VoDaiLocz/kilo-kit-mcpWrote 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/vodailocz/kilo-kit-mcp/context-optimization)<a href="https://agentmods.dev/skills/vodailocz/kilo-kit-mcp/context-optimization"><img src="https://agentmods.dev/badge/skills/vodailocz/kilo-kit-mcp/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/vodailocz/kilo-kit-mcp/context-optimization"><img src="https://agentmods.dev/badge/skills/vodailocz/kilo-kit-mcp/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.00045 | $0.00869 |
| Opus 5.5 | $0.00018 | $0.00348 |
| Sonnet 5.5 | $0.00009 | $0.00174 |
| Haiku 4.5 | $0.00005 | $0.00087 |
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 3mo 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 — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context Optimization Skill
This skill provides methodologies and best practices for maximizing context window efficiency, reducing token costs, and improving the performance of LLM-based agentic workflows.
1. Prompt Cache Alignment
To maximize Key-Value (KV) cache hits, prioritize stability in the early parts of the prompt.
- Static Prefixes: Design system prompts to remain identical across agent turns.
- Tool Order: Sort tool definitions alphabetically or by frequency of use. Keep this ordering constant.
- Prefix Consistency: Reserve the top 70% of the KV cache for global system instructions and tool definitions.
- Avoid Dynamic Data: Move dynamic session-specific data (dates, current file list) to the end of the context window.
2. Semantic Pruning & AST Compaction
Reduce unnecessary data before sending it to the model.
- Removal of Non-Essentials: Strip comments, debug logs, and unused boilerplate code.
- AST Compaction: Convert deep code structures into simplified, representative summaries or pseudocode.
- Whitespace Stripping: Use minification for configuration files (JSON, YAML) and standard code.
- Irrelevant Body Dropping: Replace large, irrelevant function bodies with docstrings or signatures if the model doesn't need to reason about the implementation details.
3. Lost-in-the-Middle Mitigation
LLMs often suffer from recall degradation for information in the center of the context window.
- Boundary Priority: Place high-priority constraints, critical instructions, and schema definitions at the very beginning (Head) or the very end (Tail) of the context.
- Sandwich Strategy: If critical information must be in the middle, sandwich it between two clear, high-level summary points that repeat its purpose.
4. Sliding Windows & Recursive Summarization
Manage long-running conversations without exceeding token thresholds.
- Sliding Window: Keep only the N most recent turns for immediate interaction.
- Recursive Summarization: Periodically collapse historical turns into a compressed "Session State Summary".
- State Archiving: Store older, less relevant interactions in a side-car file (e.g.,
archive.md) that the agent can read only when necessary.
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.
- 3mo ago First seen · 82 lines · 45 tokens per session scan A a5fcdfaa867d
context-optimization is a skill published in the GitHub repository VoDaiLocz/kilo-kit-mcp (28 stars, last pushed 15d ago), licensed Apache-2.0. It adds 45 tokens to every session and 869 once invoked, about $0.0002 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-08-30.
context-optimization compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| context-optimizationVoDaiLocz/kilo-kit-mcp | Skill | 28 | 15d ago | Apache-2.0 | A | 45 | Claude Code, Codex |
| llm-structured-outputhybridlabor-api/bdb-dev-optimized-agent-skills | Skill | 9 | 10d ago | Apache-2.0 | A | 42 | Claude Code, Codex |
| llm-prompt-optimizerhybridlabor-api/bdb-dev-optimized-agent-skills | Skill | 9 | 10d ago | Apache-2.0 | A | 35 | Claude Code, Codex |
| ai-agent-developmenthybridlabor-api/bdb-dev-optimized-agent-skills | Skill | 9 | 10d ago | Apache-2.0 | A | 32 | Claude Code, Codex |
| ai-producthybridlabor-api/bdb-dev-optimized-agent-skills | Skill | 9 | 10d ago | Apache-2.0 | C | 15 | Claude Code, Codex |
| azure-ai-openai-dotnetsickn33/agentic-awesome-skills | Skill | 51k | yesterday | MIT | A | 43 | Claude Code |
| prompt-engineeringsickn33/agentic-awesome-skills | Skill | 51k | yesterday | MIT | A | 35 | Claude Code |