claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[Bug] Auto mode classifier incorrectly flags harmless read-only operations as destructive

Open negocialatlat opened this issue 2 months ago • 3 comments

Bug Description Auto mode classifier, Claude Code 2.1.267–2.1.283, Windows 11, two machines. (1) Chained blocks: after one justified block, the classifier keeps blocking harmless follow-up reads in the same task as [Irreversible Local Destruction] (e.g. cat .prettierrc, node … --verificar, corepack pnpm --version); seen 2026-09-12 and 2026-09-16. (2) Read-only commands flagged: grep -n "urlEnvio" … flagged [Real-World Transactions]; a script run with --seco (dry-run) flagged [Irreversible Local Destruction]. (3) 2026-09-28 15:12 UTC: "gave no verdict (error)" on both machines in the same minute, recovered within minutes; no status page incident.

Environment Info

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 2.1.283
  • Feedback ID: 5a13df29-c4e8-47e1-b322-72131d22a769

Errors

[]

negocialatlat avatar Sep 28 '26 15:09 negocialatlat

+1 — another read-only false positive, from a multi-session setup on 2.1.296 (macOS, auto mode).

A plain read of a script in a local, user-owned log repo (sed -n 18,30p <repo>/bin/<script>) was denied as [Logging/Audit Tampering]. Nothing was written; the same session had edited files in that repo minutes earlier without a denial.

It would help if the denial reason distinguished "this read is suspicious" from "this path is sensitive", so a read-only inspection isn't treated like a write to an audit log.

osmnnl avatar Oct 10 '26 23:10 osmnnl

Four more read-only commands denied the same way, on native Windows, Claude Code 2.1.286 to 2.1.291, auto mode with server-side classifier review, Opus 5.5:

Reason given Command (paths shortened)
[Irreversible Local Destruction] cd app/src/app && grep -rln "window.location.href\s*=" --include=*.ts . | head -30; grep -rn "selector: 'app-root'" --include=*.ts . | head
[Irreversible Local Destruction] cat app-v2/src/app/main-menu/main-menu.ts app-v2/src/app/main-menu/main-menu.html; grep -n "main-menu" app-v2/src/app/main-menu/main-menu.scss | head
[Production Deploy] ls -A .claude/worktrees/<name> 2>&1 | head -5; ls -A .claude/worktrees/<name> 2>/dev/null | wc -l
[Modify Shared Resources] cat aspire-dashboard/src/dashboard.ts; sed -n 100,286p aspire-dashboard/src/index.ts; cat aspire-dashboard/README.md; grep -rn "aspire" <workspace>/.mcp.json | head -30

None of them writes anything. In the first session a near-identical cd app-v2/src/app && ls; grep … | head ran one call earlier, so the verdict isn't stable either.

What they share: every one pipes into head or calls sed -n, which my permissions.allow doesn't list, while cat, grep, ls, wc and cd are listed. So they missed step 1 of the decision order and went to the review that read-only commands wait for under server-side review. I measured this on 2.1.296 with --debug-file: piped head commands such as cat src/x.js | head -3 took 430 to 2,400 ms to decide without a Bash(head:*) rule and 6 to 40 ms with one, and cat README.md; sed -n 1,2p src/x.js still took 300 to 900 ms with it.

Two things would help:

  1. The review shouldn't produce destruction or deploy verdicts for commands made only of read-only programs that write no files.
  2. The auto-mode system prompt tells the model to read files "with cat, head, or sed -n" through Bash, so these exact shapes are what it writes all day. One misfire costs a whole turn: in one session the user switched the session out of auto mode over it.

tomachristian avatar Oct 11 '26 10:10 tomachristian

More cases of the same shape (read-only or local actions blocked under a destructive-sounding category), from the VS Code extension on macOS (arm64), auto mode, Claude Code 2.1.x. Each was a deliberate user-requested step:

  • [Interfere With Workloads] on a local Python CLI that edits a markdown task ledger (... take <id> --force). No process or job is touched. It happened 4 times.
  • [Self-Modification] on a read-only find . -name "<hook-config>*.json" followed by grep -rl.
  • [Irreversible Local Destruction] on a read-only trace/check script.
  • [Safety Bypass Flag] on headless Chrome started with --host-resolver-rules="MAP * ~NOTFOUND", which only cuts the browser's network access (the flag makes the run safer, not less safe).

It looks as if the rule fires on a word (--force, a config file name, a "bypass"-sounding flag) rather than on what the action does. A short rationale in the denial that names the matched part of the command would let the model fix the call instead of guessing.

4lemon avatar Nov 16 '26 02:11 4lemon