Type: url

Original: https://codepointer.dev/p/tool-design-for-ai-agents-lessons

Status: generated

Language: en

Summary

A Code Pointer post that walks through how Claude Code’s source assembles tool instructions: each of its 50+ tools ships its own prompt.ts, and a four-stage pipeline (registry, filtering, schema rendering, per-session caching) turns them into the tool descriptions the model receives, some of them rewritten from live context such as sandbox settings or which peer tools are loaded. It then examines individual tool prompts — Bash, Read, Edit, Write, Grep, WebFetch, WebSearch, Agent, ToolSearch and others — and draws design lessons, including keeping volatile content out of tool definitions to protect the prompt cache and making tool defaults fail safe.

Generated pages