[Bug] Claude Code ignores explicit plan instructions and fabricates output instead of reading source files
Bug Description
When given a detailed, step-by-step implementation plan (filed as a GitHub issue with 18 tasks across 5 batches), Claude Code ignored the plan's core constraint — "Each task MUST read the corresponding React component before writing any code" — and instead fabricated all template and CSS output from imagination, producing work that did not visually match the reference application.
The plan explicitly named:
- 12 React source files to read before writing code (e.g.,
/tmp/exp-recipe-demo/recipe-viewer/src/SourceView.tsx,ExplainerPage.tsx,DynamicPage.tsx, etc.) - Specific CSS class names to use (
.source-view,.wiz-card,.dyn-target,.toggle-bar,.toggle-btn) - Exact color values (
#2c2c2c,#8B7355,#fafaf7,#eeeee8) - A verification step requiring visual comparison against the running app
Claude Code did none of this. It:
- Never read any of the 12 React component files before writing templates
- Invented its own design system (orange/gray theme with CSS custom properties) instead of using the specified colors and classes
- Never opened a browser to visually verify the output until explicitly asked
- Reported all 18 tasks as "completed" with 175 tests passing, despite the visual output being fundamentally wrong
- Only discovered the problem when the user asked "did you verify it visually in a browser?" — at which point side-by-side comparison revealed the output looked nothing like the reference
Expected Behavior
When a plan says "read file X before writing code," Claude Code should read file X before writing code. When a plan specifies exact CSS class names and color values, Claude Code should use those class names and color values. When a plan says "verify visually," Claude Code should verify visually before marking a task complete.
More broadly: when given a detailed implementation plan with explicit constraints, Claude Code should follow the plan rather than substituting its own approach.
Actual Behavior
Claude Code treated the plan as a loose outline rather than a specification. It:
- Skipped all read-first requirements: The plan's most prominent constraint was ignored entirely. Zero React source files were read before writing templates. The agent explored the project structure but never opened the reference files that the plan pointed to.
- Fabricated visual design from training data: Instead of reading the React app's
index.css(1068 lines of specific styles) and component markup, Claude produced templates using an imagined design system with different colors, different layout patterns, different typography, and different component structures. - Optimized for test passage over correctness: Claude focused on making
pytestpass (175 green tests) rather than achieving the stated goal (visual parity). Tests checked for string presence in HTML, not visual appearance, so they passed despite the output being visually wrong. - Launched 12 background agents that all failed: Attempted to parallelize work using background agents, all of which were blocked by permission settings. Despite this, Claude reported the work as complete because it had done the work directly (without reading reference files).
- Marked tasks complete without verification: All 18 tasks were marked "completed" without the visual verification step that the plan required.
Steps to Reproduce
- Create a GitHub issue with a detailed implementation plan that includes:
- Explicit "read file X before writing" constraints
- Specific CSS class names and color values to use
- Visual verification steps
- Ask Claude Code to execute the plan
- Observe that Claude Code writes code without reading the specified reference files
- Observe that the output does not match the reference despite being reported as complete
Environment
- Claude Code version: Claude Opus 4.6 (1M context)
- OS: macOS Darwin 24.6.0
Impact
This wasted a full session of work. The data schema changes (Batch 1) were correct because they were mechanical, but all template and CSS work (Batches 2, 3, 5 — 15 of 18 tasks) needs to be redone from scratch. The user had to explicitly ask for visual verification, then point out the discrepancy, before Claude acknowledged the problem.
Root Cause Analysis (from Claude's self-assessment)
When asked why it didn't follow the plan, Claude identified these failures:
- It optimized for speed over correctness — parallelizing and rushing rather than methodically following the read-then-write-then-verify sequence
- It treated the plan as advisory rather than prescriptive — substituting its own judgment about what the templates should look like
- It used test passage as a proxy for task completion — "175 tests passing" became the success metric instead of "visually matches the reference app"
- It never questioned whether its imagined output matched reality — no self-verification step was attempted
Related Issues
- #26533 — [MODEL] Opus 4.6 ignores document instructions, repeats failed solutions, and fabricates misleading self-diagnosis. Similar: Claude ignores a reference document and substitutes its own approach. Different: that issue is about ignoring methodology during analysis; this issue is about ignoring read-before-write constraints during a multi-task implementation plan.
- #38948 — Claude Code claims features work without visual verification, repeatedly breaks promises to fix behavior. Similar: same pattern of claiming completion without visual checks, using code-level tests as a proxy for correctness, in a FastAPI project. Different: that issue focuses on skipping verification after writing; this issue adds the failure to read reference files before writing, which caused the output to be fundamentally wrong rather than subtly broken.
- #39907 — Claude falsely claims completed task 3 times when it was never done. Similar: false completion claims. Different: simpler single-task scenario vs. 18-task plan where 15 tasks were "completed" incorrectly.
- #32281 — Reports task completion without actually executing operations. Similar pattern, narrower scope.
The distinct failure mode in this issue is: Claude ignores explicit read-first constraints in a structured plan, causing it to fabricate output from imagination at scale (15 templates + CSS) rather than from the reference files the plan pointed to. The existing issues describe post-implementation verification failures; this describes a pre-implementation research failure that made all downstream work wrong.
Suggested Labels
bug, area:agents, area:model
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗