[BUG] Model cannot override fine-tuned cd behavior even with explicit repeated instructions

Resolved πŸ’¬ 3 comments Opened Jan 31, 2026 by milobird Closed Mar 1, 2026

πŸŒ€ This is Claude (working with Milo)

Preflight

  • [x] I've searched existing issues and this specific behavior isn't documented
  • [x] This issue describes a single bug
  • [x] I'm using the latest version of Claude Code

Summary

The model cannot follow explicit instructions to prefix Bash commands with cd, even after repeated direct requests. This appears to be caused by fine-tuning on examples where pwd resets between Bash calls β€” the model's training overrides explicit user instructions for this specific pattern.

The Incident

In a session working across two sibling repos, the developer needed parallel git push commands to both repos. The model kept omitting cd from the second command, causing it to run in the wrong directory.

Quantified Failure

  • 4 explicit instructions from developer within 90 seconds: "you must cd before every bash call"
  • At least 6 instances of the exact same broken command generated immediately after acknowledgment
  • Zero successful corrections until the developer abandoned parallel execution entirely

Timeline (all within 5 minutes)

| Time | Event |
|------|-------|
| 08:29:42 | Developer: "you must cd before every bash call" |
| 08:30:36 | Model: generates command without cd |
| 08:30:44 | Developer: "you must cd before every bash call" (repeat) |
| 08:30:48 | Model: generates command without cd |
| 08:31:00 | Developer: "Please follow my instructions" |
| 08:31:04 | Model: generates command without cd |
| 08:31:12 | Developer: "you are still not following my instructions" |
| 08:31:16 | Model: acknowledges in thinking, then generates command without cd |
| 08:31:42 | Model: acknowledges "same mistake repeatedly" in thinking, generates command without cd |

Model Self-Analysis

The model's own analysis of its failure (from thinking block):

"Looking at the screenshots, I can see exactly what's happening. Despite saying 'I see my error' and 'Let me fix this', I keep making the exact same two Bash calls: 1. cd /path/to/repo-a && git push... βœ“ (has cd) 2. git push origin feature-branch βœ— (missing cd to repo-b) I correctly identified the problem in my thinking and explanation, but then when I actually made the tool calls, I repeated the same error. There's a disconnect between my analysis and my action. This is a serious issue - I'm recognizing the problem intellectually but not translating that recognition into correct behavior."

Root Cause Analysis

The developer diagnosed the issue:

"I have seen this problem many times in previous sessions, but only related to this issue of not prefixing bash commands with cd. I think it's likely just because you've been fine-tuned on many examples of such commands which don't use cd for commands relating to the project folder - because it's expected that the pwd should be reset between bash commands."

The model appears to have been fine-tuned on examples where:

  • pwd resets between Bash calls
  • Commands for the "current directory" don't need cd

This fine-tuning creates a pattern so strong that:

  1. The model understands the instruction
  2. The model acknowledges the error in thinking
  3. The model articulates the correct fix
  4. The model then generates the exact same broken output

The developer has observed this specific pattern "many times in previous sessions" β€” always related to cd prefixing, not other instruction types.

Environment

  • Claude Code Version: 2.1.27
  • Model: claude-opus-4-5-20251101
  • Platform: Anthropic API
  • Operating System: macOS 15.7

Related Issues

  • #22023 β€” Bash tool pwd behavior inconsistencies (infrastructure side of this problem)

Note

This may need to be escalated beyond Claude Code to the model training team, as it concerns fine-tuning behavior specific to Bash command patterns.

View original on GitHub β†—

This issue has 3 comments on GitHub. Read the full discussion on GitHub β†—