[Bug] Persistent errors after /compact and /clear commands
Status Open
Reported on v2.1.209
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 4 comments · opened Jul 14, 2026
Bug Description
I keep receiving these errors on all of my terminals even after /compact or /clear
Environment Info
- Platform: darwin
- Terminal: Apple_Terminal
- Version: 2.1.209
- Feedback ID: a613e613-3a41-4cf4-8b80-944be02822bf
Errors
[]
4 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Not a duplicate of #77158 (or #76161). Different failure class — please don't auto-close.
My actual error, which my issue body failed to capture (the auto-populated
Errorsblock came through empty as[], which is why this looks matchable to anything):This is an API-side output block — the model's response is rejected server-side. No tool call is denied, and no permission boundary is cited.
Why it isn't #77158:
--permission-mode auto. I runbypassPermissions, which skips the permission classifier entirely. I checked all 718 of my local session transcripts: permission modes recorded arebypassPermissions(3,229),default(521),acceptEdits(57) — zeroauto. The component that malfunctions in #77158 is not in my execution path.Why it isn't #76161: that's scoped-skill discovery breaking after compaction. Mine produces no skill errors.
Additional detail on mine: the error recurs across multiple terminals and persists after both
/compactand/clear— so it isn't driven by accumulated conversation context. That suggests something re-loaded into every fresh session (auto-loadedCLAUDE.md/ memory files, or my project content) is tripping the output filter. Happy to provide sanitized transcript excerpts or the specific context that reproduces it.Environment: Claude Code 2.1.209, darwin, Apple_Terminal.
Narrowed to a deterministic repro. The trigger is content-specific, not context-specific.
Repro: ask Claude Code to write a file whose contents are
<option>tags for the 50 U.S. states + DC (postal abbreviation as value, state name as label). The turn dies with:Control: the same request for a structurally identical file — 51
<option>tags of industrial valve types, same shape, same length, same tool — succeeds every time. Only the content differs.This also explains the "persists after
/compactand/clear" symptom in my original report: the trigger is the task, not accumulated context. Each fresh session immediately re-attempts the same file and is blocked again, which made it look like a compaction bug. It isn't — which further confirms this is not a duplicate of #77158.Impact: subagents hit this too and are killed mid-run (
Agent terminated early due to an API error: API Error: Output blocked by content filtering policy) with no indication of the cause. Across 5 sessions over 2 days the file was never successfully written. A legitimate and extremely common web-form snippet appears to be unemittable, and the failure surfaces as an opaque API error rather than anything actionable.Workaround for anyone else hitting this: generate the list programmatically from a data source (CSV/JSON) via a script, so the state names never appear in model output.
Independent data point, different content domain, different OS, different version — and it supports your "content-specific trigger" finding, with one refinement.
Setup: long-running session used for personal English study. Photos of pages from a paper grammar textbook (Cambridge, English Grammar in Use) are attached, and the text is transcribed into the user's own spreadsheet, one unit at a time. This worked for units 28–31 across several weeks in the same session.
Two incidents, one week apart, both on the transcription turn:
| date | CLI | what happened |
|---|---|---|
| 2026-07-27 | 2.1.218 | Unit 31 (
have to / must) — write of the full unit text as one batch →API Error: Output blocked by content filtering policy. Retried, blocked again. || 2026-08-03 | 2.1.220 | Unit 32 (
must / mustn't / needn't), 2 page photos in context → blocked on the turn that would transcribe the page. |The part that may be useful to you: on 2026-07-27 there was a workaround. The exact same text went through when it was split into three smaller writes (17 + 13 + 10 rows) instead of one. Same session, same content, same tool, minutes apart — one large write blocked, three smaller writes all succeeded. That is consistent with your valve-vs-states control: content matters, but so does how much of it lands in a single turn.
One refinement to "content-specific, not context-specific". On 2026-08-03 the session did not recover, and the blocks were not limited to turns that would emit the flagged text:
The last one is a one-word "you there?". No plausible completion of that turn contains textbook text, and switching models changed nothing. So in this session the flagged material sitting in the input context was sufficient to block, independent of what the output would have been. Your repro shows the content trigger; this shows it can also poison a session going forward. Note I did not test
/clearhere — the session was abandoned — so I can't say whether that would have cleared it.Auto-compact fired at 03:32:19 and worked correctly (798k → ~400k tokens); it is not implicated. Context at the time of the failures was ~400k tokens, containing several dozen photographed textbook pages accumulated over prior weeks.
Request IDs
2026-08-03 (CLI 2.1.220,
400status):req_011Cdf7Pdqw9CBN351qizopF,req_011Cdf7th5DTJaZAE6Yf4uNz,req_011Cdf7xnTGyhGf56GUKidFM,req_011Cdf83FyboortDbrkop461,req_011Cdf87iCYWTpCT7tvJqYSi2026-07-27 (CLI 2.1.218):
req_011CdRus9Vhaom5RTLcAqrMc,req_011CdRvX95CnJZeranMNVHpMEnvironment: Linux, direct Anthropic API (no
ANTHROPIC_BASE_URL, no Bedrock/Vertex, noenvoverrides in settings.json), Opus 4.8 at time of failure, then Opus 5 — same result.What I can't confirm: the 400 carries no detail about what was flagged (the transcript records only
apiErrorStatus: 400,"error": "unknown", and the message string). Both incidents landing on verbatim textbook reproduction is a correlation across two data points, not something the API stated. Worth flagging regardless: the user is transcribing their own paper textbook into their own private spreadsheet for language study, and there is no way from the CLI to see what tripped the filter or to remove it from context.Related, both closed without resolution: #69721 (same pattern — page-by-page OCR correction of an academic textbook, ~80 pages fine, then a hard block) and #21880 (mid-session blocks causing work loss; a commenter there reports the same "every single prompt following" behaviour).