The edit tool

Here's a key insight: Claude Code's Edit tool uses exact string matching, not regex. The model sends the exact old text to find and the exact new text to replace it with. This works because the model has already read the file and knows the exact content. No regex escaping, no line number fragility, no ambiguity.

Fill in the blanks: Complete the edit tool

Loading practice…

This is the deepest insight in agent design: the model IS the agent. We don't need complex edit logic because the model handles the complexity. It reads the file, understands the code, and sends us the exact strings. Our job is just to be a reliable executor. Simple tools, smart model.

Terminal
bash
# Run the tool design agent
make 03-tool-design

# Try: "Create a file called hello.py with a hello world function"
# Try: "Read hello.py and change the function name to greet"

Test all four tools: bash, read, write, and edit.