Improve tool usage guidance in LLM system prompt#2086
Conversation
The previous instruction "Only use a tool if you cannot answer without it" was too weak and allowed models to call tools for purely creative tasks like generating HTML files, writing code, etc. The new prompt: - Adds explicit IMPORTANT prefix for emphasis - Lists specific task types that should NOT trigger tool calls (writing code, generating files, creative writing, explanations, math, etc.) - Separates the positive guidance (when to call tools) into its own sentence for clarity https://claude.ai/code/session_012q4MT9VeNuP1sHkeQMxcxf
Refined the tool preprompt to acknowledge that some code tasks DO benefit from tool calls—specifically when current API documentation, recent library changes, or real-time data is needed. Changes: - "writing code" → "writing standard code" (generic patterns vs API-specific) - Added concrete examples of valid tool use: API docs, library changes, real-time data https://claude.ai/code/session_012q4MT9VeNuP1sHkeQMxcxf
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 564bcccef5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| `IMPORTANT: Do NOT call any tool for tasks you can complete from your own knowledge. This includes: writing standard code, generating files (HTML, JSON, etc.), creative writing, explanations, math, translations, summaries, and general Q&A.`, | ||
| `Only call a tool when you genuinely need external, up-to-date, or user-specific information you lack—for example, current API documentation, recent library changes, or real-time data.`, |
There was a problem hiding this comment.
Allow tool calls for action/side‑effect tools
This new guidance restricts tool usage to “external, up‑to‑date, or user‑specific information.” That breaks MCP servers that expose action/side‑effect tools (e.g., create tickets, write files, trigger jobs), because the model is now explicitly told those are out of scope and will likely answer in plain text instead of invoking the tool. This regression shows up whenever a user relies on a non‑informational MCP tool; those workflows will silently fail.
Useful? React with 👍 / 👎.
Summary
Updated the tool usage instructions in the LLM system prompt to provide clearer, more specific guidance on when tools should and should not be used. This aims to reduce unnecessary tool calls for tasks the model can handle from its own knowledge.
Changes
Details
The previous prompt used a general guideline ("only use a tool if you cannot answer without it") which was ambiguous and led to over-reliance on tools. The new guidance explicitly enumerates common tasks that should be handled without tools, while clarifying the legitimate use cases for tool invocation. This should improve response latency and reduce unnecessary API calls while maintaining accuracy for queries requiring external information.
https://claude.ai/code/session_012q4MT9VeNuP1sHkeQMxcxf