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 ariaxhan/kernel-claude --skill context-mgmtgit clone --depth 1 https://github.com/ariaxhan/kernel-claudeWrote 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/ariaxhan/kernel-claude/context-mgmt)<a href="https://agentmods.dev/skills/ariaxhan/kernel-claude/context-mgmt"><img src="https://agentmods.dev/badge/skills/ariaxhan/kernel-claude/context-mgmt/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/ariaxhan/kernel-claude/context-mgmt"><img src="https://agentmods.dev/badge/skills/ariaxhan/kernel-claude/context-mgmt.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.00037 | $0.01590 |
| Opus 5.5 | $0.00015 | $0.00636 |
| Sonnet 5.5 | $0.00007 | $0.00318 |
| Haiku 4.5 | $0.00004 | $0.00159 |
Grade A, and why
context-mgmt 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 13d 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 — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Reasoning fidelity is the real metric, not token count. Quality degrades at ~60-70% fill, not at the limit.
<core_principles>
- COMPACTION: Summarize and reinitialize. Keep architecture decisions, discard noise.
- STRUCTURED NOTES: AgentDB + active.md persist across context resets.
- MULTI-AGENT: Delegate research to subagents. They explore, report summaries. Cap the return at ~1,000-2,000 tokens (conclusion + path:line evidence, no raw dumps); the exploration context stays in the subagent.
- MINIMAL READS: grep/glob to find, then read specific sections.
- TOOL RESULT CLEARING: Old tool output rarely needs to stay in context. When calling the Claude API directly (not via this harness), prefer the server-side
context-management-2025-06-27beta over hand-rolled truncation:clear_tool_uses_20250919clears old tool results past a token trigger (client keeps full history, no sync needed),clear_thinking_20251015clears old thinking blocks while preserving cache hits. Client-side SDK compaction (compaction_control, TypeScript/Ruby) is deprecated; use server-sidecompact_20260112for summarization, which takes its own beta headercompact-2026-01-12, notcontext-management-2025-06-27:triggerisinput_tokensonly (default 150000, minimum 50000), and custominstructionsreplace the default summarization prompt entirely, so restate the full framing (what to keep: goal, decisions, paths, errors) rather than appending.pause_after_compaction: truereturnsstop_reason: "compaction"with only the compaction block, so you can re-append recent messages or key instructions, then resend without the flag to continue. Ordering:clear_thinking_20251015must precedeclear_tool_uses_20250919inedits. Setexclude_toolsfor results that must survive; clearing tool results invalidates the cached prefix, so setclear_at_leastso each clear pays for itself. Pair with thememory_20250818tool: Claude is warned as the threshold nears and saves state to memory files before results clear.clear_tool_inputs(defaultfalse) also drops call parameters.clear_thinking_20251015with nokeepdefaults tothinking_turns: 1on every model, even ones whose omitted-strategy default keeps all thinking (so including the edit silently drops older thinking and invalidates the cache there); setkeepexplicitly ({type:"thinking_turns",value:N}or"all").clear_tool_uses_20250919defaults:trigger100,000input_tokens,keep3 tool uses; ifclear_at_leastcannot be met the edit is not applied. On Fable 5.1/Opus 5.5/Sonnet 5.5/Haiku 5.5, server-side edits never invalidate thinking blocks, but hand-editing earlier turns client-side can; for accounts created on/after 2026-08-31 a replayed invalidated block is rejected unless you opt into dropping it. Verify clearing fired fromcontext_management.applied_editsin the response (cleared_tool_uses/cleared_thinking_turnsandcleared_input_tokens; in streaming, the finalmessage_delta). Preview savings by passingcontext_managementtocount_tokens: it returnsoriginal_input_tokensbeside the post-clearinginput_tokens. </core_principles>
<token_budget>
- CLAUDE.md: <150 lines (always loaded)
- rules/: <100 lines (always loaded)
- Skills: metadata only at startup, full content on demand
- Commands: only when invoked
- Reference docs: only when skill explicitly reads them </token_budget>
What ships with it
2 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.
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.
- 13d ago Changed ebacd10f4834
- 28d ago Changed 5d3c3917a51f
- 1mo ago Changed e4fab492708a
- 1mo ago Changed 338afa770e39
- 1mo ago Changed 269c5e566cb4
- 1mo ago Changed 85b566ae71c6
- 1mo ago Changed b9977a8dbf63
- 2mo ago Changed 7c76f0ca9a6e
- 2mo ago Changed 18869b660400
- 2mo ago First seen · 100 lines · 37 tokens per session scan A 2c8504131c5d
context-mgmt is a skill published in the GitHub repository ariaxhan/kernel-claude (16 stars, last pushed yesterday), licensed MIT. It adds 37 tokens to every session and 1,590 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-08-30.
context-mgmt compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| context-mgmtariaxhan/kernel-claude | Skill | 16 | yesterday | MIT | A | 37 | Claude Code |
| prolongalexisfox7/PRO-LONG | Skill | 464 | 28d ago | MIT | A | 55 | Codex |
| setup-brainmycelium-hq/ai-brain-starter | Skill | 61 | yesterday | MIT | A | 66 | Claude Code |
| cartographer-kb-createBeppeTemp/cartographer | Skill | 69 | 2d ago | Apache-2.0 | A | 53 | Claude Code, Codex |
| second-brain-mappingmycelium-hq/ai-brain-starter | Skill | 61 | yesterday | MIT | A | 116 | Claude Code |
| cartographer-kb-importBeppeTemp/cartographer | Skill | 69 | 2d ago | Apache-2.0 | A | 51 | Claude Code, Codex |
| evolvemycelium-hq/ai-brain-starter | Skill | 61 | yesterday | MIT | A | 100 | Claude Code |