anthropics / anthropics/claude-code

[MODEL] Compiler errors incorrectly treated as satisfying TDD RED gate

Open
#94,753 0 comments 0 reactions 0 assignees View on GitHub
area:model bug model
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

Description

### Preflight Checklist

- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Amodel) 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

Any bug fix or feature using a TDD workflow

### What Claude Actually Did

1. Claude wrote tests first
2. Claude tried to run the tests and got compiler errors
3. Claude concludes that "tests fail" and proceeds to the implementation phase

### Expected Behavior

Compiler errors and failing tests are **not** the same, if there are compiler errors, Claude should fix those first and try running the tests again. Only when the tests have actually been run and confirmed to fail for the right reason should Claude proceed to the next TDD phase. I should not have to explain how TDD works in my CLAUDE.md file, this should be common sense.

### Files Affected

```shell

```

### Permission Mode

Accept Edits was ON (auto-accepting changes)

### Can You Reproduce This?

Yes, every time with the same prompt

### Steps to Reproduce

Ask for TDD in CLAUDE.md or in your prompt, without specifying how to execute TDD. It's a common workflow, so Claude **should** know how to apply it properly.

### Claude Model

Opus

### Relevant Conversation

```markdown

```

### Impact

High - Significant unwanted changes

### Claude Code Version

2.1.273 (Claude Code)

### Platform

Anthropic API

### Additional Context

This happens with Fable too

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported TDD workflow with the prompt described in the issue and compiler errors before implementation. Trace how Claude Code evaluates test-command results, then verify that compilation failures trigger correction and rerunning, while implementation begins only after tests run and fail for the intended reason.

Written by the indexing model from the issue text.

Assessment

Domain
testing, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.