agentsclimarketplace

Token economy

Skill atuljha23/holocron/skills/token-economy

Rubric for keeping Claude Code sessions cheap without losing quality — model tiering, cache hygiene, Read discipline, MCP pruning, subagent isolation. Use when cost feels wrong, before setting a budget, or when onboarding a teammate.From its SKILL.md

Install
npx -y skills add atuljha23/holocron --skill token-economy

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
  • runs commandsInstructs the agent to run 5 commands, including `/holocron:cost` and 4 more.

SKILL.md

4.5 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it

Token economy

Three things drive cost in Claude Code: context size, cache hit rate, and model choice. Most waste comes from one of these being misconfigured and left alone.

Model tiering — match the model to the task

Task shapeRight model
Format fix, rename, small refactor, comment tweakHaiku — ~15× cheaper than Opus, fast enough to feel instant
Routine feature work, bug fix, test writing, reviewing a small diffSonnet — the default; 5× cheaper than Opus
Architectural decision, cross-file refactor, debugging a subtle bug, reviewing a large diffOpus — use when you need the reasoning, not by default

Claude Code's /fast or model selection lets you pick. Don't use Opus by reflex for a typo fix.

Cache hygiene — the 80% lever nobody talks about

Anthropic caches your prompt prefix for 5 minutes. A stable prefix = the next turn reads from cache at ~10% of input cost. A prefix that changes each turn = full price every time.

What busts cache:

  • Timestamps in CLAUDE.md, in skill content, or in hook output
  • Session IDs / UUIDs interpolated into system prompt
  • Rotating "quotes of the day", random greetings
  • MCP servers that return time-varying schema metadata

What preserves cache:

  • CLAUDE.md that doesn't change day-to-day
  • Skill/rule content that's additive, not mutating
  • Hook additionalContext that's deterministic for a given input
  • Turning off MCP servers you don't need (every schema change invalidates cache)

How to check: /holocron:cost — the cache hit rate line. Below 50% is a signal; above 70% is healthy.

Read discipline — the most common leak

Claude's Read tool pulls whole files by default. A 2000-line file is ~8k tokens. Do that 5 times in a session and you've spent ~40k tokens reading the same file repeatedly.

Pattern:

  1. Grep to find the relevant range (cheap — returns only matching lines)
  2. Read with offset + limit for the range you identified

Holocron's read-budget.js hook nudges this on files > 500 lines, but the discipline has to be yours.

MCP pruning — one-time setup, ongoing savings

Every MCP server's tool schemas ship to the model on every turn. An unused MCP server costs you tokens forever.

Audit with /holocron:mcp-audit. Disable servers you don't actively use. Two or three MCP servers is usually plenty; ten is a tax.

Subagent isolation — don't pollute the main context

Research / exploration / "find me all the callers" work bloats the main transcript with files and noise you won't need after. Run it in a subagent:

Use the Explore agent to find how `authenticateUser` is called across the repo.

The subagent's findings come back as a summary; its exploration stays in its own context. Main session stays lean.

Transcript discipline

Claude Code auto-compacts near the context limit, but compaction is lossy — it summarizes, and summaries forget things. Better:

  • /holocron:handoff at logical boundaries — write state to a file, start fresh on the next task
  • For long-lived work: /holocron:plan → plan file → execute → handoff. The plan file acts as durable memory.

Subtle things

  • Large tool outputs stay in the transcript. A single 20k-token tool result inflates every subsequent turn's input cost until compaction.
  • Write of a large file re-reads context. Edit prefers over Write for big files.
  • Don't paste log output. Summarize, grep, or point to a file.
  • Emojis are multi-token. Harmless unless you're generating content heavy in them.

Anti-patterns

  • Running Opus on every turn "to be safe"
  • Full-file Reads on generated/vendored files (dist/, node_modules/, generated protobufs)
  • Keeping MCP servers installed that you tested once and never used again
  • Timestamp-injecting SessionStart hooks (looking at you, naive console.log(new Date()) in a hook that emits additionalContext)

How to know it's working

Run /holocron:cost weekly. Healthy numbers:

  • Cache hit rate > 60% (70%+ if you're disciplined)
  • Median session cost under your per-session budget
  • Per-model split skews Sonnet-heavy, with Haiku for small things, Opus for reasoning

If those aren't true, @cost-analyst can tell you why.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Gives 0 of the 12 instructions most context ai engineering skills give in ~1.0k tokens

Counted across 1,328 of the 2,349 authors here whose files we hold, read 2026-09-06

  • Dispatch a fresh subagent for each taskin 76 of 1328, across 59 files
  • Perform spec compliance review before code quality reviewin 44 of 1328, across 34 files
  • Dispatch a final code reviewer after all tasksin 38 of 1328, across 26 files
  • Answer subagent questions before allowing implementationin 36 of 1328, across 26 files
  • Use the least powerful model capable of the taskin 33 of 1328, across 26 files
  • Create a TodoWrite list for all tasksin 32 of 1328, across 22 files
  • Perform a task review after each implementationin 31 of 1328, across 24 files
  • Extract all tasks and context from the planin 29 of 1328, across 20 files
  • Provide full task text to subagentsin 28 of 1328, across 20 files
  • Use git worktrees for isolated workspacesin 25 of 1328, across 20 files
  • Specify the model explicitly when dispatching a subagentin 23 of 1328, across 18 files
  • Execute all tasks from the plan without stoppingin 21 of 1328, across 16 files

Said here and by no other author read

  • use haiku for small refactors
  • use sonnet for routine feature work
  • use opus only for complex reasoning
  • use grep before reading files
  • use read with offset and limit
  • run exploratory tasks in subagents

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 611,178. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.