token-playbook
Token budget for Claude Code. Use when shrinking CLAUDE.md, choosing skills vs rules vs MCP, compressing tool output, or cutting always-on context.
- License 许可
- MIT
- 最近更新
- 2026-09-02
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- token-playbook
- description
- Token budget for Claude Code. Use when shrinking CLAUDE.md, choosing skills vs rules vs MCP, compressing tool output, or cutting always-on context.
03 SKILL.md 正文
Token playbook
Always-on text is paid on every turn. Prefer lazy load.
Where things go
| Thing | Put it | Loads |
|---|---|---|
| Facts every session needs | Root CLAUDE.md |
Every turn. Target < 200 lines / ~500 tokens |
| Procedures | Skills (SKILL.md) |
When invoked or relevant |
| Language/stack law | .claude/rules/*.md with paths: |
When a matching file is read |
Unscoped .claude/rules/ |
Do not | Same tax as CLAUDE.md |
Parent CLAUDE.md walks up from cwd. A fat file in ~/dev/CLAUDE.md taxes every repo under ~/dev.
Work vs grill
- Grill / enrich: full sentences, numbered questions. No terse contract.
- Work session (launched
claude --model): short contract in the prompt, plusPROMPT_ENRICH_WORK_SESSION=1. Depth words (thorough,walk me through,tutorial) back the hook off.
Do not install an always-on “be brief” skill. That fights interviews. Pattern from denfry/claude-skills token-efficiency (measured shorter replies); we scoped it to the work session only.
Tool output
A 10k-line test log in context is worse than another prompt slot. compress_output.py (PostToolUse, Bash) replaces huge pytest/gradle/jest logs with failures only via updatedToolOutput.
MCP
Unused MCP schemas load every session. User-scoped servers in ~/.claude.json cannot be “off by default” reliably (issue #35591).
- Keep Jira + IdentityIQ out of user scope. Enable per repo with
claude/mcp/enable-project-mcp.sh. - Prefer
ghover a GitHub MCP. /mcpis per-session and easy to forget.
Skills vs agents
Skill descriptions sit in a catalog; bodies load when relevant. Agent descriptions in ~/.claude/agents/ are always-on in the Task picker. Keep few agents (code-reviewer, debugger, design-lead). Put long procedures in skills.
Cursor
A Java/Temporal User Rule with always-apply is the same tax. Use .cursor/rules/*.mdc with globs and alwaysApply: false.
04 同仓库更多 Skills
verify-before-done
Use before claiming work is complete, fixed, or passing, and before commit or PR. Run the proof command in this turn.
test-writer
Write failing tests from a technical spec and public contracts only. Use in /dev-loop test-writer stage. Do not read implementation sources or write production code.
tdd
Use when implementing a feature or bugfix, before writing production code. Test first, watch it fail, then implement. Vertical slices at public seams.
systematic-debugging
Use when hitting a bug, test failure, or unexpected behavior, before proposing a fix. Find root cause first.
story-spec
Turn a Jira story into a technical spec via grill. Use in the spec stage of /dev-loop. Do not implement.
session-handoff
Compact this conversation into a handoff file for a fresh agent. Use when launching a clean Claude session or when the user asks for a handoff.