How Claude Decides Whether to Use Computer Tools or Respond Directly

Claude determines whether to invoke computer tools or answer directly by classifying queries into three stability categories—stable, unknown, or rapidly-changing—and following a strict decision tree that defaults to direct responses unless external data is required.

The leaked system prompts from the asgeirtj/system_prompts_leaks repository reveal the exact programmatic logic Anthropic uses to govern Claude's tool selection. This article examines the decision-making architecture found in Anthropic/old/claude-sonnet-4.md to explain how Claude chooses between direct answers and computer tool invocations.

The Core Principle: Avoid Unnecessary Tool Calls

According to the system prompts in Anthropic/old/claude-sonnet-4.md, Claude's default stance is to avoid tool calls if not needed. If the query can be answered from internal knowledge, Claude must respond directly without invoking any tool. This principle serves as the architectural foundation, ensuring that external resources are reserved strictly for information gaps or real-time data requirements.

The Three Stability Categories

Claude classifies every query into one of three stability categories to determine whether external tools are necessary. This classification system is explicitly defined in the <query_complexity_categories> block within the system prompts.

Stable queries involve rarely changing, well-known facts that exist within Claude's training data. For these queries, the system prompt explicitly instructs Claude to never search and to answer directly. Examples include fundamental scientific principles, historical dates, or established mathematical concepts.

When Claude encounters an unknown term or topic where it lacks sufficient internal knowledge, the system prompts mandate a single search immediately. This category triggers exactly one tool invocation to retrieve the missing information, after which Claude synthesizes the answer from the retrieved data.

Rapidly-Changing Information (Multi-Tool Research)

Rapidly-changing queries involve daily or monthly updates, real-time data, or complex multi-aspect topics. For simple facts in this category, Claude performs a single search. However, for complex multi-aspect queries, the system prompts instruct Claude to run multiple tool calls to gather comprehensive, current information before responding.

The Decision Tree Algorithm

The exact logic Claude follows is encoded as a decision tree in Anthropic/old/claude-sonnet-4.md. This algorithm can be represented programmatically as follows:

def should_use_tool(query, knowledge_cutoff):
    # 1. Determine if the answer is in internal knowledge

    if known_fact(query):
        return "answer_directly"

    # 2. Classify stability

    if is_stable(query):
        return "answer_directly"                     # Never Search category

    if contains_unknown_term(query):
        return "single_search"                        # Unknown term → immediate search

    # 3. Detect rapidly‑changing info

    if is_time_sensitive(query):
        if is_simple_fact(query):
            return "single_search"
        else:
            return "multi_search"                     # Complex, needs multiple calls

    # 4. Default fallback

    return "answer_and_offer_search"

This decision tree ensures that Claude defaults to direct answers for stable knowledge, performs targeted searches for unknown terms, and escalates to multiple tool calls only when handling complex, time-sensitive queries.

Additional Guardrails and Constraints

Beyond the core decision tree, the system prompts in Anthropic/old/claude-sonnet-4.md and related files like Anthropic/old/claude-opus-4.5.md specify additional constraints that modify tool selection:

  • Internal Tool Preference: When internal tools (such as Drive or Gmail integrations) are available, Claude must prefer them for personal or company data before falling back to web search. This hierarchy ensures data privacy and relevance.

  • Copyright Limitations: Claude must never reproduce copyrighted excerpts longer than 15 words. When citing sources, it must offer only short quotations, which affects how it processes and presents information retrieved via tools.

  • Query Complexity Categories: The <query_complexity_categories> block explicitly defines when to use "Single Search" versus "Multi Search" based on whether the query is a simple fact or requires comprehensive research across multiple sources.

Summary

  • Claude defaults to answering directly without tools when the information is available in its internal knowledge base.
  • Queries are classified into three stability categories: stable (never search), unknown (single search), and rapidly-changing (single or multi-search depending on complexity).
  • The decision logic follows a specific algorithm defined in Anthropic/old/claude-sonnet-4.md that prioritizes direct answers and escalates to multiple tool calls only for complex, time-sensitive queries.
  • Guardrails such as internal tool preference and copyright limits further constrain when and how tools are invoked.

Frequently Asked Questions

What triggers Claude to use a computer tool instead of answering directly?

Claude uses computer tools when it classifies a query as either unknown (lacking internal knowledge) or rapidly-changing (requiring current data). According to the system prompts in Anthropic/old/claude-sonnet-4.md, stable facts that exist in Claude's training data never trigger tool usage.

Does Claude always search for information it doesn't know?

No. Claude follows a single search rule for unknown terms, performing exactly one tool invocation to retrieve the missing information. However, if the query involves a complex, multi-aspect topic with rapidly-changing information, Claude escalates to multiple tool calls to ensure comprehensive coverage.

How does Claude handle real-time or time-sensitive queries?

For rapidly-changing information such as stock prices, weather, or current events, Claude immediately invokes search tools. The decision between a single search and multiple searches depends on query complexity: simple facts get a single search, while complex research questions trigger multi-tool research as defined in the <query_complexity_categories> block.

Can Claude refuse to use tools even when they are available?

Yes. Claude's system prompts establish avoiding unnecessary tool calls as the default stance. If Claude determines that a query can be answered from its internal knowledge base, it must respond directly without invoking available tools, even if those tools are technically accessible for the session.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →