claude-code - 💡(How to fix) Fix [Bug] Anthropic API Error: Usage Policy false positive issue blocking operations [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52691Fetched 2026-04-24 10:42:17
View on GitHub
Comments
2
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2

Error Message

⎿  API Error: Claude Code is unable to respond to this request, which appears to violate our Usage Policy

Code Example

[]
RAW_BUFFERClick to expand / collapse

Bug Description Trying to build a compiler, and new sessions are going to Usage Policy violations within just a couple of prompts.

● Bash(git diff --stat HEAD -- Codex.Codex/Types/TypeEnv.codex Codex.Codex/Types/TypeChecker.codex Codex.Codex/opening.codex 2>&1 | head -20) ⎿   Codex.Codex/Types/TypeChecker.codex | 263 +++++++++++++++++++++++++++++++++--- Codex.Codex/Types/TypeEnv.codex | 57 +++++--- 2 files changed, 282 insertions(+), 38 deletions(-)

● Bash(git log --all --oneline --diff-filter=A --name-only 2>&1 | grep -iE "env.*diag|env.*probe|env.*bind|bind.*diag|lookup.*diag|first.*byte|byte.*loss|loss.*rate" |…) ⎿  (No output)

● Bash(git diff HEAD -- Codex.Codex/Types/TypeEnv.codex 2>&1 | head -120) ⎿  diff --git a/Codex.Codex/Types/TypeEnv.codex b/Codex.Codex/Types/TypeEnv.codex index 1a75dda..57903bf 100644 --- a/Codex.Codex/Types/TypeEnv.codex … +75 lines (ctrl+o to expand)

● Bash(git diff HEAD -- Codex.Codex/Types/TypeChecker.codex 2>&1 | head -80) ⎿  diff --git a/Codex.Codex/Types/TypeChecker.codex b/Codex.Codex/Types/TypeChecker.codex index d93e277..a74d9e6 100644 --- a/Codex.Codex/Types/TypeChecker.codex … +32 lines (ctrl+o to expand)

● Bash(git diff HEAD -- Codex.Codex/Types/TypeChecker.codex 2>&1 | grep -nE "^+.*(env-lookup|diag|probe|loss|first-byte|byte-13|ErrorTy|print-line|counter|increment)"…) ⎿  119:+ then (unify (declared.state) (env-lookup (declared.env) (def.name.value)) (declared. expected-type) (def.span)).state 125:+ in let env-type = env-lookup env (def.name.value) … +8 lines (ctrl+o to expand)

Searched for 4 patterns, read 1 file, listed 2 directories (ctrl+o to expand)

❯ look for the tool with a directory scan sorted by date, the tools you were using should be near the top

Read 4 files, listed 3 directories (ctrl+o to expand)

⎿  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.119
  • Feedback ID: 9555d059-a088-4fe8-a704-870bbcc3a7cb

Errors

[]

extent analysis

TL;DR

The issue is likely due to the compiler build exceeding the Usage Policy limits, and switching to a different model like claude-sonnet-4-20250514 might resolve the issue.

Guidance

  • Review the recent changes in TypeEnv.codex and TypeChecker.codex to identify potential causes of the Usage Policy violations.
  • Try running the suggested command /model claude-sonnet-4-20250514 to switch models and see if it resolves the issue.
  • Check the Usage Policy documentation (https://www.anthropic.com/legal/aup) to understand the limits and guidelines for using the compiler.
  • If the issue persists, try starting a new session or editing the last message to comply with the Usage Policy.

Notes

The issue seems to be related to the compiler build exceeding the Usage Policy limits, but the exact cause is unclear. Switching to a different model might resolve the issue, but it's essential to review the recent changes and understand the Usage Policy guidelines to prevent future occurrences.

Recommendation

Apply workaround: Switch to a different model like claude-sonnet-4-20250514 to resolve the issue, as it might have different Usage Policy limits or guidelines.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING