Code tools (read, search, edit, run)
The hands: open files, search the code, apply edits, run commands.
What it is
A small, sharp tool set: read file, grep or glob, apply a patch (exact replacements, not whole-file rewrites), and run a shell command, with structured results.
When to use it
- Always: an agent that can't run anything is just autocomplete
When to skip it
- Dozens of overlapping tools: the model picks badly from long, similar menus
Why (the trade-off)
Small, well-described tools with exact edits beat clever ones. Patch-based edits are reviewable and cheap in tokens.
Where it sits
Action layer, executed inside the sandbox.
What it needs first
- Agent loopthe loop chooses each tool call
- Code sandboxcommands run somewhere isolated
What can be added to it
- builds on itRepo mapRepo map needs it: it's built by reading the repo
- builds on itTest-and-fix loopTest-and-fix loop needs it: it runs commands
- builds on itSubagentsSubagents needs it: subagents use the same tools
- builds on itPlan modePlan mode needs it: it explores with read-only tools
- builds on itPermission modesPermission modes needs it: it gates tool calls
- builds on itCheckpoints and undoCheckpoints and undo needs it: it snapshots before edits
- builds on itDiff reviewDiff review needs it: the diff comes from the agent's edits
Effect of adding it
- cost —
- latency —
- reliability ↑
- safety —
Learn first (AI Engineering)