[Bug] File Read Encoding Corruption Triggers False Positive Usage Policy Block
Bug Description
Bug report:
What happened:
During a long working session, I asked Claude Code to enter plan mode and consolidate previous analysis into a plan. Claude Code read 3 files in parallel. The output of that read operation became completely corrupted — the terminal showed garbled text consisting of random characters, I/ sequences, non-UTF8 bytes, and repeating IIII patterns.
Immediately after the corrupted output, Claude Code returned the following error and blocked the session entirely:
API Error: Claude Code is unable to respond to this request, which appears to violate our Usage Policy (https://www.anthropic.com/legal/aup). Please double press esc to edit your last message or start a new session.
Root cause (suspected):
The corrupted output from the file read was interpreted by the model as policy-violating content, triggering a false positive. The files being read were source code files (Node.js index.js and log files). No policy-violating content was present — the corruption was caused by encoding issues during file reading, not by the actual file content.
Steps to reproduce:
Run a long multi-step session with several file reads and agent spawns
Ask Claude Code to read multiple files in parallel that may contain non-UTF8 content or binary fragments
Observe corrupted output in terminal
Claude Code blocks with Usage Policy error
Expected behavior:
Claude Code should handle corrupted or unreadable file content gracefully without triggering a Usage Policy block.
Actual behavior:
Session blocked. Required full restart. All pending context lost.
Version: 2.1.87 (Claude Code)
OS: Windows
Session length at time of error: ~45 minutes
❯ /plan
⎿ Enabled plan mode
❯ vi que no estabas en modo plan, mete todo esto en un plan
● Entendido. Activo el flujo de plan formalmente. Ya tengo mucho contexto pero voy a verificar los archivos críticos para confirmar los detalles exactos antes de escribir el plan.
Read 3 files (ctrl+o to expand)
● cc5, geno2, un camb7as absolMsc 7, es",
(; D6: Cc *
5, 03,12(15, comp43(0131�415Ical/
,1,
2(921121Ical8.
17ated07, Éc7128ed9, ,5/
0,3, inc5_4_75, dem4ed5ed5, s1 g3/ insEi5a/0/5, cre8a4: (9Ical7ed9ed4ed7, se1, com6/
ern3, f1, E0lo6
7/
3E
2/ 0/
2/0 si s0A0,1 40v/ in6l3, sy a5
0IF1, I0/
,2, 1on2, 2, com4, vi5, p1, syncStage2 in2h2, 4, ex4, u0ab0cr2 1i5bu7, ex5, fe0, s6A3 1Id1ed1
// M2d0, w1
IN_/I/ B8, d1;
/ c2RON m2_/
EV
ern0, v6, d3/I0I1, ex4ed5, s5, in3_C6, c8
in6, v4
cIcal1, u9ONIN4_/I/1
IN/IDE0, m0/I*/
4ed2l/I0
I/I1, fE/
A6ed1, deI*/
I1I1, c6T03, m1i/
on3, 2ed3_stale11 E0 p , /
I4, 2, s7, 7_/
//I/
I3,2,2,4E4,4,7, , I///IMIcal/
I* IIbE2II/ E/I I/I/
I /1 /I/IE1E)I/ (;; AN0I/I/I///IIN/I//I/II0/I/// I I 1I,2 )), IcalI/I0EDB/I)/I1/)/I/ 8II/IN/IIiE2,I/ 1, IN/I2/ 2/I/ /I/I/I,I, /I/I E I I /// II;) { EI(1///I(*
I/I/IF/I1/ // I/ /II///I) ) / /// /// ////{/( / / I/////E / /// )}/I/(( (/ / ///;/(}I/I/I/I/ I/I/ I/I/I//////; //I /I I ; /I/I/I////) );)}//////;/ I/////I//////// // //I ////I /// // II//I / I / **
IIII I I I IIIIIIIIIII I IIIIIII IIIIIIII II II IIIIII II IIIIIIIIII IIII IIIIIIII IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII**
⎿ API Error: Claude Code is unable to respond to this request, which appears to violate our Usage Policy (https://www.anthropic.com/legal/aup). Please double press esc to edit your last message or start a new session for Claude Code
to assist with a different task. If you are seeing this refusal repeatedly, try running /model claude-sonnet-4-20250514 to switch models.
Environment Info
- Platform: win32
- Terminal: windows-terminal
- Version: 2.1.87
- Feedback ID: b1d96860-cd0b-48a7-bd53-1ac17b59c83a
Errors
[{"error":"ENOENT: no such file or directory, unlink 'C:\\Users\\BRYANQ~1\\AppData\\Local\\Temp\\claude\\C--Users-BryanQuiceno-Documents-TitanProject-TitanVersionPLC-AppMovilSIGER-server\\db614886-6719-4f82-bf2d-aea5b6710f51\\tasks\\a44e893b90962ece4.output'","timestamp":"2026-04-10T06:07:41.266Z"},{"error":"ENOENT: no such file or directory, unlink 'C:\\Users\\BRYANQ~1\\AppData\\Local\\Temp\\claude\\C--Users-BryanQuiceno-Documents-TitanProject-TitanVersionPLC-AppMovilSIGER-server\\db614886-6719-4f82-bf2d-aea5b6710f51\\tasks\\a9c769e228fd19fd3.output'","timestamp":"2026-04-10T06:08:03.594Z"},{"error":"ENOENT: no such file or direct…
Note: Content was truncated.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗