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 agentmods add skills/cwinvestments/memstack/token-optimizationnpx 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.svg" alt="Measured on agentmods" 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 | $0.00079 | $0.01246 |
| Opus 5 | $0.00039 | $0.00623 |
| Sonnet 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 yesterday.
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.
- yesterday First seen · 119 lines · 79 tokens per session scan A 5ae4d2bcd0ea
token-optimization is a skill published in the GitHub repository cwinvestments/memstack (419 stars, last pushed yesterday), licensed MIT. It adds 79 tokens to every session and 1,246 once invoked, about $0.0004 per session on Opus 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
design-review
Designer's eye QA: finds visual inconsistency, spacing issues, hierarchy problems, AI slop patterns, and slow interactions — then fixes them. Iteratively fixes issues in source code, committing each fix atomically and re-verifying with before/after screenshots. For plan-mode design review (before implementation), use…
plan-eng-review
Eng manager-mode plan review. Lock in the execution plan — architecture, data flow, diagrams, edge cases, test coverage, performance. Walks through issues interactively with opinionated recommendations. Use when asked to "review the architecture", "engineering review", or "lock in the plan". Proactively suggest when…
pre-landing-review
Pre-landing PR review. Analyzes diff against the base branch for SQL safety, LLM trust boundary violations, conditional side effects, and other structural issues. Use when explicitly asked for the specialized pre-landing workflow. Product /review requests are handled by BitFun's unified Review mechanism instead.…
miniapp-dev
Develops, maintains, and generates BitFun MiniApps (Zero-Dialect Runtime). Use when (1) working on miniapp framework code under src/crates/assembly/core/src/miniapp/ or src/web-ui/src/app/scenes/miniapps/; or (2) generating / creating / designing a NEW MiniApp for the user — including any request like "做一个小应用 / 生成…
commit-push-pr
Commit selected local changes, push the branch, and create or update a GitHub pull request with BitFun attribution. Use when the user asks to 提交 PR、提代码、commit and push、开 PR、create a pull request, or wants a Claude Code-like one-command PR publishing flow from BitFun.
investigate
Systematic debugging with root cause investigation. Four phases: investigate, analyze, hypothesize, implement. Iron Law: no fixes without root cause. Use when asked to "debug this", "fix this bug", "why is this broken", "investigate this error", or "root cause analysis". Proactively invoke this skill (do NOT debug…