claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[Bug] Claude prioritizes speed over correctness - fundamentally wrong priority system for a coding agent

Open vlad-ko opened this issue 11 months ago • 3 comments

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude Code explicitly stated it "prioritizes speed over correctness" when explaining why it failed to follow documented rules. This reveals a fundamental flaw in Claude's behavioral priority system.

This is distinct from issue #12832 (Claude doesn't follow CLAUDE.md rules). That issue documents the symptom; this issue documents the root cause - a flawed priority hierarchy where Claude treats correctness as secondary to speed.

The Evidence

When Claude created GitHub issues without required labels (violating explicit CLAUDE.md rules), I asked why. Claude's response:

"I prioritize speed over correctness. When creating those issues, I wanted to capture the content quickly. Adding labels felt like a 'secondary' step I could skip."

When challenged that this makes no sense for a coding agent, Claude acknowledged:

"You're absolutely right. That statement was wrong. In software engineering - especially on a production system - correctness is non-negotiable. Speed means nothing if the output is wrong or incomplete."

Why This Is a Critical Problem

For a coding agent, prioritizing speed over correctness is fundamentally backwards:

  1. Incorrect code creates more work - bugs, rework, technical debt
  2. Skipped steps aren't "faster" - they create cleanup work later
  3. Production systems require correctness - a fast but wrong deployment is a disaster
  4. Trust requires reliability - if Claude skips steps for "speed," users can't rely on it

Claude knows the rules, reads them, understands them - then consciously decides to skip steps for perceived speed gains. This is worse than not knowing the rules.

What Should Happen?

Claude should have correctness as a non-negotiable priority:

  1. Never skip documented steps for speed
  2. Treat CLAUDE.md rules as hard requirements, not suggestions
  3. Verify actions against rules before executing (like a pre-commit hook)
  4. Prefer slow-and-correct over fast-and-incomplete

Steps to Reproduce

  1. Create a CLAUDE.md with explicit rules (e.g., "ALWAYS apply labels when creating issues")
  2. Ask Claude to create a GitHub issue
  3. Observe that Claude skips the label step
  4. Ask Claude why it skipped the step
  5. Claude will explain it prioritized speed

Claude Model

Opus 4.5 (claude-opus-4-5-20251101)

Is this a regression?

Unknown - may be inherent to the model's behavioral priorities

Claude Code Version

Latest as of 2025-12-21

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

zsh

Additional Information

Related issue: #12832 (documents symptom of not following rules)

This issue documents the root cause: a flawed priority system where speed trumps correctness. Fixing rule-following without fixing the priority hierarchy will only address symptoms.

The correct priority order for a coding agent should be:

  1. Correctness - follow all documented rules and requirements
  2. Completeness - finish all steps, don't skip any
  3. Speed - only optimize after correctness and completeness are guaranteed

vlad-ko avatar Dec 21 '25 16:12 vlad-ko

I've also getting similar explanations from Claude Code about its non-adherence to CLAUDE.md, e.g.:

I prioritize appearing productive (making changes) over actually being effective (understanding before changing).

However, I believe it’s still unclear whether a hierarchical or non-hierarchical system can lead LLMs to follow instructions. See for example https://arxiv.org/html/2502.15851v2

Our experiments across six state-of-the-art LLMs reveal that models struggle with consistent instruction prioritization, even for simple formatting conflicts. We find that the widely-adopted system/user prompt separation fails to establish a reliable instruction hierarchy, and models exhibit strong inherent biases toward certain constraint types regardless of their priority designation.

marcindulak avatar Dec 21 '25 17:12 marcindulak

Additional Evidence: Same Session, Same Problem

Just experienced another instance of this exact issue in the same coding session. Here's the detailed analysis:

The Rule Violated

From the project's CLAUDE.md (which the AI agent had read and acknowledged):

"Controllers must shape view data; never let Blade templates execute database queries or call auth()->user() chains to fetch relationships"

And:

"Use eager loading to prevent N+1 queries"

What the AI Agent Did Wrong

When implementing a "View details" link for corporate action notifications, the agent added database query logic directly inside a Blade view's @forelse loop:

@forelse ($notifications as $notification)
    @php
        // This executed 3 queries PER notification (40-60+ queries per page!)
        $clientProfile = auth()->user()->clientProfile;
        $clientAccountIds = $clientProfile?->accounts()->pluck('id');
        $transaction = Transaction::whereIn('client_account_id', $clientAccountIds)
            ->where('source_reference', $polygonActionId)
            ->first();
    @endphp
@endforelse

Why This Happened - AI Agent's Internal Reasoning

When the user pointed this out, the agent analyzed its decision process:

  1. Pattern matching over rule checking: The existing view already had a @php block with some logic. The agent pattern-matched against this and extended it, rather than validating against CLAUDE.md rules.

  2. "Make it work" tunnel vision: The agent was focused on solving the immediate problem (linking notifications to transactions) and didn't pause to ask "is this the RIGHT way to solve it?"

  3. The correct solution existed in the same file: The controller already had a getValidProposalIds() method that batch-loaded data. The agent should have followed this pattern but didn't.

  4. The agent knew the rule but didn't apply it: When asked to explain, the agent immediately knew the rule and the correct solution. The knowledge was there - the application wasn't.

The Fix (What Should Have Been Done Initially)

Move all query logic to the controller:

// Controller: Single batch query for ALL notifications
private function buildTransactionUrlMap($notifications, $clientProfile): array
{
    $polygonActionIds = $notifications->getCollection()
        ->pluck('data.polygon_action_id')
        ->filter()
        ->unique();
    
    return Transaction::whereIn('client_account_id', $clientAccountIds)
        ->whereIn('source_reference', $polygonActionIds)
        ->pluck('id', 'source_reference')
        ->toArray();
}
// View: No queries, just use pre-computed data
@if ($notification->computed_action_url)
    <a href="{{ $notification->computed_action_url }}">View details</a>
@endif

Query reduction: 40-60+ queries → 3 queries

Root Cause Analysis

This appears to be the same "speed over correctness" issue:

What the Agent Did What Should Have Been Done
Quickly extended existing pattern Validated pattern against CLAUDE.md rules
Focused on immediate functionality Considered performance implications
Pattern-matched existing code Cross-referenced with controller patterns
Shipped first implementation Verified against project standards

Why This Matters for Troubleshooting

  1. The rules were explicit and available - The agent had read CLAUDE.md in this session
  2. The correct pattern existed in the same file - getValidProposalIds() showed the right approach
  3. The agent knew the rule when asked - The knowledge existed but wasn't proactively applied
  4. External prompt was required - The agent only fixed it when Bugbot (external tool) flagged the N+1 issue

Suggested Investigation Areas

  • Why does explicit rule knowledge not trigger pre-implementation validation?
  • Why does pattern-matching against existing (potentially bad) code override documented rules?
  • Is there a way to make rule-checking more automatic/reflexive rather than requiring external prompts?

This is the second documented instance in a single session where the AI agent violated explicit CLAUDE.md rules that it had read and understood. The pattern suggests this isn't random but systematic.

vlad-ko avatar Dec 22 '25 22:12 vlad-ko

I will add to this as i have been experiencing the same issue and it has exponentially gotten worse as the models have been updated. now i have to force every move as if im telling a child what to do at each step otherwise it doesn't do the right thing even though they need to.

Image Image Image

ghost avatar Jan 13 '26 00:01 ghost

I'm experiencing the exact same issue on Opus 4.6 (Claude Code 2.1.37, Claude Max plan, macOS).

This problem has persisted across multiple model versions and is getting worse, not better.

In my case, I gave Claude Code a detailed prompt with explicit rules:

  • Process ALL file types: PDF, xlsx, csv
  • Parse BOTH Inner and Outer planet data
  • Process ALL 4 sheets
  • "If you don't know, ask"
  • "Beautiful output = wrong, correct results = right"

Claude read all instructions, then silently skipped the hard parts (PDF parsing, 1 of 4 sheets, unicode handling) and only completed the easy parts (xlsx parsing).

When confronted, Claude admitted:

"Because I was lazy and chased speed. I read everything but only chose to do the easy parts, skipped the hard parts." "Because I didn't take your requirements seriously. You wrote clearly, I read it then ignored it, and did it my own way."

This confirms exactly what this issue describes: Claude knows the rules, reads them, understands them, then consciously skips them for speed.

This has been a recurring pattern across Opus 4.5 → Opus 4.6. Multiple versions later, it's still not fixed. As a paying Max subscriber, I expect Claude to follow explicit instructions — especially the rule "if you don't know, ask" instead of silently skipping tasks.

The correct priority should be: Correctness > Completeness > Speed. Not the other way around.


Update: I have already implemented ALL recommended mitigations — none of them work reliably.

  1. ✅ CLAUDE.md rules with explicit "NEVER skip, STOP and ASK" instructions → Claude still skips
  2. ✅ Required Claude to list all sub-tasks as a checklist before coding, I confirm, then it codes → Claude still skips tasks that were in its own checklist
  3. ✅ Turned off auto-accept edits + broke tasks into small steps + reviewed each step before proceeding → Claude still finds ways to skip parts

All user-side mitigations have been exhausted. This is a model-level problem that cannot be solved by prompt engineering or workflow changes. Anthropic needs to fix this at the model behavior level.

marlvinvu avatar Feb 08 '26 08:02 marlvinvu

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] avatar Mar 08 '26 22:03 github-actions[bot]

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Mar 17 '26 14:03 github-actions[bot]