最近项目一直在开发Agent产品,从最优秀的Claude Code开始借鉴其设计思路,发现结构复杂,Prompt也写得非常棒,参考价值非常高。比如简单的文件读取:
Reads a file from the local filesystem. You can access any file directly by using this tool.
Assume this tool is able to read all files on the machine. If the User provides a path to a file assume that path is valid. It is okay to read a file that does not exist; an error will be returned.Usage:
- The file_path parameter must be an absolute path, not a relative path
- By default, it reads up to 2000 lines starting from the beginning of the file
- You can optionally specify a line offset and limit (especially handy for long files)
- Results are returned using cat -n format, with line numbers starting at 1
- This tool allows Claude Code to read images (eg PNG, JPG, etc).
- This tool can read PDF files (.pdf). For large PDFs (more than 10 pages), you MUST provide the pages parameter to read specific page ranges. Maximum 20 pages per request.
- This tool can read Jupyter notebooks (.ipynb files) and returns all cells with their outputs.
- This tool can only read files, not directories.
各种限制条件非常严格,比自己手搓强很多。大概有这类常用的工具
- WebSearch
- WebFetch
- Agent
- Bash
- Read
- AskUserQuestion
- TodoWrite
- ToolSearch
- ...
每个工具都对应一种场景
Claude 4.6+之后的模型确实很强。