Skip to content
Back to skills

Token Budget

ASecurity

Per-session token discipline — cache, delegate, compact. Use when output is getting verbose, context is filling, or cache hit-rate drops. Companion to context-budget (which inventories the harness); this governs in-session behavior.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 9, 2026
ai-agentsgobash

Works with

  • claude code
  • mcp

Security analysis

A100/100

Scanned October 9, 2026

npx -y skills add qyndex/claude-init --skill token-budget --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Token Budget?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Token Budget
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/qyndex-token-budget/badge)](https://www.skillsdirectory.com/skills/qyndex-token-budget)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: token-budget
description: Per-session token discipline — cache, delegate, compact. Use when output is getting verbose, context is filling, or cache hit-rate drops. Companion to context-budget (which inventories the harness); this governs in-session behavior.
when_to_use: Long session underway. Output verbosity creeping. context-monitor injected a [context] or [output] warning. Cache hit-rate below 40%.
model: sonnet
allowed-tools: Read, Glob, Grep, Bash
---

# Token Budget

In-session token discipline. `context-budget` audits what the harness *loads*;
this skill governs what the session *spends*. (Gap-audit G8: previously
referenced from CLAUDE.md, README, ARCHITECTURE, RESEARCH §9, and
prime-discipline but never shipped.)

## Output rules (the model's own tokens)

- **Cite paths, don't paste files.** `src/foo.ts:42`, never the contents.
- **No preamble, no postamble.** No "I'll now read…", no "Let me know if…".
- **State results, don't narrate.** One sentence per milestone, not per tool call.
- **Don't echo back what the user (or a hook) just said.**
- If the `context-monitor` hook injects an `[output]` warning, the previous
  turn exceeded the growth nudge — tighten immediately.

## Input rules (what enters context)

- **Subagents for heavy reads** (>3 files or >20K tokens) — their context dies
  with them; only the conclusion returns. Use `Explore` (Haiku).
- **Graphify MCP over grep** for cross-module questions (>3 files).
- **memory-recall.sh before grepping `.claude/memory/`** — index-backed, ≤5 lines.
- **Read `initiatives/active/<id>.STATE.md`** (≤60 lines) instead of re-deriving
  initiative state from specs/plans/tasks.

## Cache rules

- **Don't rewrite prefix surfaces mid-session**: CLAUDE.md, agents/*, skill
  frontmatter, settings. They invalidate the prompt cache for every later turn.
- **TTL is ~5 minutes** and not configurable from Claude Code: turns spaced
  >5min apart re-pay the cache write. Keep unattended loops tight.
- **Measure, don't guess**: `bash .claude/scripts/cost-report.sh day` →
  `cache_hit_rate` in cost-summary.json; statusline shows `cache:N%`;
  harness-doctor warns under `CACHE_HIT_MIN` (default 40%).

## Compact rules

- Same task continuing → `/compact "<focus hint>"` at a clean boundary.
- New task → `/clear`.
- The `context-monitor` hook nudges at 60% and 80% estimated fill; at 80%,
  persist in-flight state (WIP commit, tasks/notes) *before* compaction.

## References

- docs/RESEARCH.md §9 (sources: Anthropic context-engineering + long-running-agents posts)
- .claude/skills/context-budget/SKILL.md (harness-load inventory)
- .claude/skills/prime-discipline/SKILL.md (session-start digest of these rules)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.