[sonnet 4.6] Claude Code repeatedly misinterprets scoped instructions and modifies out-of-scope files, wasting user tokens with no recourse

Resolved 💬 5 comments Opened Mar 31, 2026 by mpechner Closed May 23, 2026

Preflight Checklist

  • [x] I have searched existing issues for similar behavior reports
  • [x] This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Claude ignored my instructions or configuration

What You Asked Claude to Do

claude-issue-transcript.md

What Claude Actually Did

⏺ 1. Misread "no env vars" as "remove from docs" — changed documentation
instead of the script signature. Repeated 4 times with different wrong
approaches (env var, TF_VAR_, reading from tfvars automatically).

  1. Searched the entire repo for account ID references when the user

explicitly said "only the script and the READMEs that call it."

  1. Modified a timestamped historical penetration test archive

(penetration-test/penetration-run/20260305-112518/ADDENDUM-Security-Fixes-20260305.md)
that was never mentioned and should never be touched.

  1. Made documentation changes without updating the script, and script

changes without updating the docs — repeatedly out of sync.

  1. Every wrong interpretation, repo-wide search, and revert consumed

billable tokens. The user had no recourse.

The correct fix was ~10 lines across 4 files. It took 15+ conversation
turns to get there.

Expected Behavior

  1. When a user scopes a task ("the script and the READMEs that call it"),

Claude changes only those files — no repo-wide searches, no touching
unrelated files.

  1. When corrected on the same point multiple times, Claude stops, states

its current understanding explicitly, and waits for confirmation before
acting.

  1. Claude never modifies timestamped archives, historical records, or

files in directories that are clearly not part of the stated task.

  1. When a script changes, Claude automatically syncs all documentation

that references that script — without being asked.

  1. A simple change (2-parameter script + 3 doc updates) is completed in

1-2 turns, not 15+.

Files Affected

scripts/create-openvpn-ssh-key.sh                                                                                                                                                                                                                                                                                      
  docs/runbook-dev-rke2.md                            
  docs/runbook-prod-eks.md                                                                                                                                                                                                                                                                                               
  scripts/README.md

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Haven't tried to reproduce

Steps to Reproduce

  1. Ask Claude to add a parameter to a script and update the docs that

reference it.

  1. When Claude misunderstands, correct it with the same instruction

rephrased.

  1. Observe Claude change something other than what was asked.
  1. Repeat correction. Observe Claude search the entire repo instead of

the stated files.

  1. Observe Claude modify a file in a historical/archive directory that

was never mentioned.

  1. Count the turns required to complete a change that should take 1-2.

Claude Model

Sonnet

Relevant Conversation

See the MD I uploaded

Impact

Medium - Extra work to undo changes

Claude Code Version

claude-sonnet-4-6

Platform

Anthropic API

Additional Context

_No response_

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗