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 cwinvestments/memstack --skill token-optimizationgit clone --depth 1 https://github.com/cwinvestments/memstackWrote 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/cwinvestments/memstack/token-optimization)<a href="https://agentmods.dev/skills/cwinvestments/memstack/token-optimization"><img src="https://agentmods.dev/badge/skills/cwinvestments/memstack/token-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/cwinvestments/memstack/token-optimization"><img src="https://agentmods.dev/badge/skills/cwinvestments/memstack/token-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.00079 | $0.01246 |
| Opus 5.5 | $0.00032 | $0.00498 |
| Sonnet 5.5 | $0.00016 | $0.00249 |
| Haiku 4.5 | $0.00008 | $0.00125 |
Grade A, and why
token-optimization scanned grade A with 1 finding 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 1mo 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
curl http://127.0.0.1:8787/health How it starts
The opening of the file, as written. The whole thing — 119 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Token Optimization Guide - TokenStack
One built-in compression proxy that shrinks Claude Code tool output before it reaches the Anthropic API.
Activation
When this skill activates, output:
TokenStack - enabling compression & reading your savings...
Then execute the protocol below.
Context Guard
| Context | Status |
|---|---|
| User asks about token savings or context optimization | ACTIVE - full guide |
| User says "TokenStack", "token stack", "reduce tokens" | ACTIVE - relevant section |
| User wants to enable or confirm the proxy | ACTIVE - enable steps |
| User asks how to read their savings | ACTIVE - dashboard section |
| Proxy crash, health check, or live status | DORMANT - use Compress skill |
| User is actively coding (no optimization discussion) | DORMANT - do not activate |
What TokenStack Is
TokenStack is a single transparent proxy that sits between Claude Code and the Anthropic API. It intercepts each request, compresses the bulky tool output inside it, and forwards the smaller payload upstream. Less text per turn means more usable context and lower token cost.
It is built into the memstack-skill-loader package. There is nothing extra to install: if you have MemStack, you have TokenStack.
Earlier versions documented a 3-layer manual setup (Serena MCP, RTK CLI, and the Headroom API proxy). That stack is retired. TokenStack supersedes all three. There is no pip install, no Rust binary, no MCP server, and no command prefixing.
Enabling It
Start the dashboard with the proxy flag:
python -m memstack_skill_loader dashboard --with-proxy
This starts the TokenStack proxy on 127.0.0.1:8787 and sets ANTHROPIC_BASE_URL for you, so Claude Code traffic routes through it automatically. No manual environment configuration is needed.
Options:
--proxy-port Nchanges the proxy port (default 8787).- To run only the proxy without the dashboard:
python -m memstack_skill_loader proxy.
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.
- 1mo ago First seen · 119 lines · 79 tokens per session scan A 5ae4d2bcd0ea
token-optimization is a skill published in the GitHub repository cwinvestments/memstack (425 stars, last pushed yesterday), licensed MIT. It adds 79 tokens to every session and 1,246 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
catchup
Restore context after /clear by summarizing recent work and project state.
atomic-wiki
Conversational wiki and capture-bucket routing. Fires when the user wants a place, space, or folder for notes, research, tickets, raw dumps, or knowledge capture — checks the block in /.claude/CLAUDE.md; if the cwd is under a registered realm, creates the folder as a bucket via atomic wiki bucket add rather than a…
memory-factcheck
A check that compares the project’s saved agent notes with the current code, database, issue tracker, and files. It identifies notes whose claims are outdated or no longer match reality.
fable-context-thrift
Use at the start of any multi-step task and during exploration — before reading files, searching, or re-checking completed work, especially when tempted to read whole files, re-verify known facts, or run independent lookups one at a time.
context-mode
Use context-mode tools (ctxexecute, ctxexecutefile) instead of Bash/cat when processing large outputs. Triggers: "analyze logs", "summarize output", "process data", "parse JSON", "filter results", "extract errors", "check build output", "analyze dependencies", "process API response", "large file analysis", "page…
deep-clean
Full-spectrum consolidation of AI agent configuration files. Goes beyond memory-only dream skills: audits and optimizes context files (AGENTS.md/AGENTS.md/GEMINI.md/.cursorrules), rules, skills, and memory. Detects stale references, dead file paths, duplicated rules, stack mismatches, contradictions, vague directives…