[MODEL] When agent lacks tools to verify a hypothesis, it reads code exhaustively instead of asking the user to run a single command

Resolved 💬 4 comments Opened Mar 30, 2026 by carrotRakko Closed May 12, 2026

Preflight Checklist

  • [x] I have searched existing issues for similar behavior reports
  • [x] This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Other unexpected behavior

What You Asked Claude to Do

Investigate and fix an authentication error ("Authentication failed") in a deployed service that calls an external LLM API provider.

What Claude Actually Did

  1. Correctly identified the error message origin in the codebase
  2. Attempted to check service logs — the required CLI tool was not available in the container
  3. In its chain-of-thought, explicitly recognized the correct next step: "I should ask the user to run this command from the host"
  4. Immediately overrode that conclusion: "But first, let me think of another approach"
  5. Tried another CLI tool — also not available
  6. Concluded: "Let me narrow it down from the code side"
  7. Proceeded to read 12+ files across two repositories, tracing the entire credential management pipeline from infrastructure config through application code to deployment templates
  8. Spawned a subagent to research the API provider's authentication mechanism in the framework codebase
  9. Only after exhausting all code-reading avenues, finally asked the user to run a single log command
  10. User ran the command — cause identified in seconds: API key usage limit exceeded

Expected Behavior

  1. See "Authentication failed" — form hypothesis: "API key invalid, expired, or over limit" (30 seconds)
  2. Need logs to confirm — required CLI not available — ask user to run one command (1 minute)
  3. User pastes output — cause confirmed

Total: ~2 minutes. Actual: 15+ minutes of unnecessary code reading, dozens of tool calls, significant context consumed.

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Haven't tried to reproduce

Claude Model

Opus

Relevant Conversation

The chain-of-thought is the key evidence. The agent correctly identified the optimal action and then consciously chose against it. This is not a reasoning failure — the agent reasoned correctly and picked the worse option.

Impact

Medium - Extra work to undo changes

Version

claude-opus-4-6 (1M context)

Platform

Anthropic API

Additional Context

This appears to be a systematic bias rather than a one-off mistake:

  • The agent correctly identified the optimal action in its reasoning
  • It then actively chose against it, preferring to exhaust self-contained approaches first
  • The pattern: the model treats "asking the user to do something" as a last resort, even when it's clearly the fastest path
  • This may stem from training incentives that reward autonomous problem-solving and penalize "bothering the user"
  • The cost is significant in agentic workflows: wasted context window, wasted time, delayed resolution

When confronted, the agent immediately agreed this was wrong and articulated the pattern clearly — suggesting the model "knows" this is suboptimal but defaults to it anyway.

✍️ Author: Claude Code with @carrotRakko (AI-written, human-approved)

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗