Move behavioral instructions out of tool definitions to reduce fixed token overhead
Problem
Claude Code's tool definitions consume ~16.5k tokens on every conversation, roughly 8% of context before the user types anything. A significant portion of this isn't schema material at all: it's behavioral instructions embedded inside tool description fields.
What's in there that shouldn't be
I audited the raw tool definitions injected into the first API call. Here's the breakdown by size:
| Tool | ~Chars | What's inflating it |
|---|---|---|
| Task | 6,350 | 6 agent type descriptions, 15+ usage notes on concurrency/background/resuming |
| Bash | 5,050 | Full git commit protocol (~30 lines of safety rules + 4-step workflow), full PR creation protocol (~10-step workflow), quoting examples |
| TodoWrite | 3,000 | 9 complete user/assistant dialogue examples with reasoning blocks |
| EnterPlanMode | 2,400 | 7 "when to use" criteria, 8 examples, 6-step workflow description |
| ExitPlanMode | 1,930 | Overlapping "when to use / when not to use" guidance with EnterPlanMode |
Bash is the clearest case. Its tool description contains a full git commit protocol:
- Git Safety Protocol (never update config, never force push, never skip hooks, never amend...)
- 4-step commit workflow (run git status + diff, analyze changes, draft message, add + commit + verify)
- PR creation protocol (run status + diff + log, analyze all commits, create branch + push +
gh pr create) - HEREDOC formatting examples
None of this is a tool schema. It's behavioral guidance that would work identically in the system prompt, where similar instructions already live. The system prompt already has sections on tone, task management, tool usage policy, and over-engineering avoidance. The git/PR protocols are the same kind of material, but they're hiding inside the Bash tool description.
TodoWrite spends ~3,000 characters on 9 full dialogue examples teaching the model when to use a todo list. That's system prompt territory. The tool schema only needs to describe what the tool does and what parameters it takes.
EnterPlanMode + ExitPlanMode together spend ~4,300 characters on overlapping "when to use" / "when not to use" guidance with redundant examples.
Estimated savings
Moving behavioral instructions to the system prompt (where they'd be deduplicated with existing guidance) and leaving tool definitions as actual schemas would save an estimated ~6,000-8,000 characters (~2,000-2,500 tokens) from tool definitions alone.
This is orthogonal to schema encoding optimizations (#24747) and lazy-loading (#12836). It would help regardless of whether those ship.
Proposed change
For each tool definition, separate:
- Schema material (what the tool does, parameters, types, constraints) -> stays in the tool definition
- Behavioral instructions (when to use it, multi-step protocols, dialogue examples) -> moves to the system prompt
The system prompt already has organized sections for this. The git commit protocol could live under a "# Git workflows" heading. The TodoWrite usage guidance could live under the existing "# Task Management" section (which already references TodoWrite).
Additional context
- Related: #24747 (TOON encoding for schemas), #12836 (Tool Search beta for lazy loading), #8245 (git context overhead)
- Full audit data available: I extracted all 17 tool definitions and system prompt contents for comparison
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗