Claude Code defers most of its tool surface behind a search
Claude Code’s harness keeps a small number of tools defined eagerly at the top of the prompt — Read, Edit, Bash, Write, Agent, Skill, ToolSearch. The rest of the tool surface (Gmail, Calendar, Drive, web fetch, task management, scheduling, etc.) is deferred: the tool name is known but the JSON schema is not loaded until you call ToolSearch to fetch it.
Why this is interesting from a harness-engineering angle:
- It is a context-budget optimization. Every tool definition costs tokens in the system prompt; deferring them means the agent does not pay for capabilities it will not use this turn.
- It mirrors what HumanLayer wrote about MCP servers (“instruction budget cost”). Claude Code’s own design is admitting the same problem and solving it with progressive disclosure.
- It changes the agent loop slightly: when a tool is needed, there is an extra “discover, fetch schema, then use” hop. The cost is one round trip; the gain is a smaller, sharper system prompt.
Worth borrowing if you are building your own harness and feel the system prompt starting to bloat past a few thousand tokens.