Model repeatedly loses focus on straightforward tasks, ignores project context and user interrupts

Resolved 💬 1 comment Opened Jan 7, 2026 by loganmoon Closed Jan 8, 2026

Summary

Claude Opus 4.5 repeatedly fails at a straightforward feature implementation (~150-200 lines of code), exhibiting systematic reasoning failures across multiple attempts despite clear project documentation and user guidance.

Environment

  • Model: Claude Opus 4.5 (claude-opus-4-5-20251101)
  • Task: Implement TypeScript relationship extraction (CALLS, IMPORTS, REEXPORTS, USES) for a code indexing system
  • Project has detailed CLAUDE.md with explicit architectural requirements

Failure Pattern 1: PR #189 (First Attempt)

Documented in project retrospective: https://github.com/loganmoon/codesearch/issues/185#issuecomment-3721218393

Architecture Violations:

  • Created 600+ lines of naive code in a new relationships.rs file instead of integrating with existing infrastructure
  • Duplicated import parsing logic that already existed in import_map.rs
  • Wrote manual recursive tree-sitter traversals instead of using queries
  • Bypassed the documented define_handler! macro system entirely

Process Failures:

  • Failed to use LSP tools (documentSymbol, goToDefinition) to explore existing code before writing
  • Started coding without understanding what utilities already existed
  • Made architectural assumptions instead of asking for clarification

Failure Pattern 2: Current Session (Second Attempt)

After the user updated CLAUDE.md with explicit lessons learned and asked for a proper implementation:

Unnecessary Actions:

  • Attempted to manually start Docker infrastructure when the test suite uses testcontainers and manages its own containers automatically
  • This was explicitly unnecessary and showed complete disregard for how the test infrastructure works

Unresponsive to User:

  • Did not respond to user pressing Escape key to interrupt and ask clarifying questions
  • User had to kill the process to stop the model from continuing down the wrong path

Ignored Project Documentation:

  • CLAUDE.md clearly documents how to run tests: cargo test --manifest-path crates/e2e-tests/Cargo.toml -- --ignored
  • Model tried to manually manage Docker instead of just running the test command

Expected Behavior

  1. Model should thoroughly read and follow project documentation (CLAUDE.md)
  2. Model should use LSP tools to explore existing code before writing new code
  3. Model should respond to user interrupts (Escape key) and pause for clarification
  4. Model should not take drastic/unnecessary actions when simple commands would suffice
  5. Model should ask questions when uncertain rather than making assumptions

Impact

A task that should take ~150 lines of well-integrated code has now consumed multiple sessions and significant user time due to the model repeatedly ignoring explicit guidance and project conventions.

Reproduction

The failures are documented in:

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗