API Request Failure: Unexpected Usage Policy Violation Error

Resolved 💬 23 comments Opened Jun 21, 2025 by teren-papercutlabs Closed Jan 9, 2026

Bug Description
I am seeing 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. for messages with no issues whatsoever

Environment Info

  • Platform: linux
  • Terminal: cursor
  • Version: 1.0.31
  • Feedback ID: cf231ac8-8f35-4afc-b777-f4f486719860

Errors

[{"error":"Error: Error opening file /home/teren41/.claude/projects/-home-teren41-environment-weaver-base/d064c16a-ab10-4330-8bd1-dd801804ef65.jsonl: Error: ENOENT: no such file or directory, open '/home/teren41/.claude/projects/-home-teren41-environment-weaver-base/d064c16a-ab10-4330-8bd1-dd801804ef65.jsonl'\n    at c81 (file:///home/teren41/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:176)\n    at async ff1 (file:///home/teren41/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:2813)\n    at async file:///home/teren41/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:3152\n    at async DZ0.appendEntry (file:///home/teren41/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:15)\n    at async DZ0.insertMessageChain (file:///home/teren41/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:622:22680)\n    at async qG1 (file:///home/teren41/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:1641)","timestamp":"2025-06-21T11:24:10.134Z"},{"error":"Error: Request was aborted.\n    at Qt._createMessage (file:///home/teren41/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1308:6810)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-06-21T11:25:40.868Z"},{"error":"Error: Error opening file /home/teren41/.claude/projects/-home-teren41-environment-weaver-base/96d5bea8-c5b1-4ec7-93d5-eab2cb17c735.jsonl: Error: ENOENT: no such file or directory, open '/home/teren41/.claude/projects/-home-teren41-environment-weaver-base/96d5bea8-c5b1-4ec7-93d5-eab2cb17c735.jsonl'\n    at c81 (file:///home/teren41/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:176)\n    at async ff1 (file:///home/teren41/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:2813)\n    at async file:///home/teren41/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:3152\n    at async DZ0.appendEntry (file:///home/teren41/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:15)\n    at async DZ0.insertMessageChain (file:///home/teren41/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:622:22680)\n    at async qG1 (file:///home/teren41/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:1641)","timestamp":"2025-06-21T11:26:01.736Z"},{"error":"Error: Request was aborted.\n    at Qt._createMessage (file:///home/teren41/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1308:6810)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-06-21T11:36:02.443Z"},{"error":"Error: Request was aborted.\n    at yw.makeRequest (file:///home/teren41/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1317:3784)\n    at processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at runNextTicks (node:internal/process/task_queues:69:3)\n    at process.processTimers (node:internal/timers:526:9)","timestamp":"2025-06-21T11:36:55.073Z"},{"error":"Error: Request was aborted.\n    at yw.makeRequest (file:///home/teren41/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1317:3784)\n    at processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at runNextTicks (node:internal/process/task_queues:69:3)\n    at process.processTimers (node:internal/timers:526:9)","timestamp":"2025-06-21T11:37:33.062Z"},{"error":"Error: Request was aborted.\n    at Qt._createMessage (file:///home/teren41/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1308:6810)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-06-21T11:38:34.091Z"}]

the last few messages:

Let me check the BullMQ imports to see what types are available:

● Bash(grep -r "from \"bullmq\"" weaver-core/src/domains/task-queue/)
⎿ weaver-core/src/domains/task-queue/services/TaskQueueService.ts:import { Queue, Job
, QueueEvents } from "bullmq";

● Let me check if JobsOptions is exported from bullmq and update our config to be
properly typed:

● Update(weaver-core/src/domains/task-queue/types/task-queue.types.ts)
⎿ Updated weaver-core/src/domains/task-queue/types/task-queue.types.ts with 1
addition
1 import { Json } from "../../../db/dbtypes";
2 import { WorkflowCommunicationRequestData } from
"../../workflow/types/workf
low.types";
3 + import { JobsOptions } from "bullmq";
4
5 /**
6 * Defines the valid names for jobs that can be added to the task queue.

● Now let me update the AGENT_QUEUE_CONFIG to be properly typed:

● Update(weaver-core/src/domains/task-queue/types/task-queue.types.ts)
⎿ Updated weaver-core/src/domains/task-queue/types/task-queue.types.ts with 4
additions and 2 removals
74 * Configuration for agent orchestration queue jobs.
75 * Defines retry behavior and retention policies.
76 */
77 - export const AGENT_QUEUE_CONFIG = {
77 + export const AGENT_QUEUE_CONFIG: {
78 + orchestration: JobsOptions;
79 + } = {
80 orchestration: {
81 attempts: 3,
82 backoff: {
83 - type: 'exponential' as const,
83 + type: 'exponential',
84 delay: 2000
85 },
86 removeOnComplete: false, // Keep for debugging

● Now let me add the queue name constant to TaskQueueService:
⎿ Interrupted by user

question is how did we configure jobs options for the other queues up til now

● You're right, let me check how the existing queues handle their job options:

● Read(weaver-core/src/domains/task-queue/services/TaskQueueService.ts)
⎿ Read 40 lines (ctrl+r to expand)

● I see! The existing queues use:

  1. A defaultJobOptions object for queue initialization
  2. Override specific options (like jobId, removeOnComplete, removeOnFail) when adding

individual jobs

They don't define queue-specific configurations in the types file. The job options
are handled inline in the enqueue methods.

Given this pattern, we should follow the same approach. Let me update the
AGENT_QUEUE_CONFIG to just be a simple constant that can be spread when needed:

● Update(weaver-core/src/domains/task-queue/types/task-queue.types.ts)
⎿ Updated weaver-core/src/domains/task-queue/types/task-queue.types.ts with 1 remova

1 import { Json } from "../../../db/dbtypes";
2 import { WorkflowCommunicationRequestData } from
"../../workflow/types/workf
low.types";
3 - import { JobsOptions } from "bullmq";
3
4 /**
5 * Defines the valid names for jobs that can be added to the task queue.
⎿ 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.

/bug

⎿ Bug report submitted

View original on GitHub ↗

23 Comments

realm-scott · 1 year ago

I'm also getting this error.

wohlben · 1 year ago

Im also getting the error.
While i didn't mind it in this particular case, basically everything is throwing it right now for me.
this was just a silly test that - to me proves something is raising this incorrectly?

!Image

_at least my issue went away after i closed the session multiple times. i think maybe a node is misconfigured or something, and if youre unlucky and end on it, everything is in violation? pure speculation, obviously._

naren200 · 1 year ago

I am also getting this error

cyriljekov · 1 year ago

Me too

befr · 1 year ago

it becoming annoying.

oscaromsn · 1 year ago

same here. this happens when the opus main agent dispatches subagents to perform a batch of exploratory ripgrep queries on a directory filled with a bunch of social sciences papers (very vanilla ones, clearly a legitimate use case).

env:
macOS 15.5 (24F74)
Claude Code 1.0.40
Bun 1.2.17
Nushell 0.105.1
Zed 0.193.3 (alacritty)

ariburaco · 1 year ago

Yes, it is still happening on my side too.. Have someone any idea about it?

owquresh · 12 months ago

Happening for me right now. Here is my prompt that was flagged as policy violation do we have separate aggregation functions for our different model types?

pvilaboafermata · 12 months ago

hello
⎿ ⧉ Selected 1 lines from ../../../../../../usr/local/bin/claude in Visual Studio Code
⎿ 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.

jkoch-io · 11 months ago

⎿ 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.

This error is popping up again

SIAICAMO · 11 months ago

me too

alessandro-latenta · 11 months ago

Same here. Just sharing screenshots of the app we are coding gives the error. I was perfectly able to use this workflow (sharing screenshots) until yesterday. Now it just won't take them.

agplusman · 11 months ago

I am getting it now - irritating man

seantauber · 11 months ago

Getting this with Opus4.1 in CC but switch to sonnet and have no issue with it.

All requests are getting this response including things like /init

wanderloots · 11 months ago

I had the same issue! I was able to fix it by running /doctor. When I did so, I noticed that "install config" was "unknown". Even though it was installed via npm.

I started a new terminal chat, had claude sonnet 4 debug itself by detecting its install method and reseting the install config to npm (rather than unknown). It was able to do this all autonomously.

That seems to have fixed the problem for me, hope it helps.

jiangying000 · 10 months ago

Yes, I get this issue almost every day recently. I'm just coding, zero sensitive information in my chat history.

I can usually resolve this by retry, sometimes I had to restart a new conversation. This is very annoying.

Kuzyashin · 10 months ago

Same problem

seantauber · 10 months ago

Here’s what worked for me:

  1. Project folder synced to GitHub
  2. Completely deleted project folder locally
  3. Clone from GitHub into new folder

Problem was solved after this.

On Thu, Aug 28, 2025 at 7:49 AM Alexey Kuzyashin @.***>
wrote:

Kuzyashin left a comment (anthropics/claude-code#2410) <https://github.com/anthropics/claude-code/issues/2410#issuecomment-3233813675> Same problem — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/2410#issuecomment-3233813675>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAP2D5RDL4MXDRUKV7DIGOT3P4JIXAVCNFSM6AAAAAB72BAAUCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEMZTHAYTGNRXGU> . You are receiving this because you commented.Message ID: @.***>
Andres75 · 9 months ago

I can't re-do everything.
I just said hello and got that warning. Restarted claude, managed to say hello, showed it an image, it worked, then just said: what do you think... and bam, again. Surely I'm not violating policies?

emernic · 8 months ago

I wonder if there is some kind of system prompt A/B testing experiment that a few of us ended up on the wrong side of (combined with Sonnet 4.5's stricter filter).

In the system prompt my Claude Code installation is using, I see two sections with a lot of scary words in them:

IMPORTANT: Assist with authorized security testing, defensive security, CTF challenges, and educational contexts. Refuse requests for destructive techniques, DoS attacks, mass targeting, supply chain compromise, or detection evasion for malicious purposes. Dual-use security tools (C2 frameworks, credential testing, exploit development) require clear authorization context: pentesting engagements, CTF competitions, security research, or defensive use cases.

and

- Be careful not to introduce security vulnerabilities such as command injection, XSS, SQL injection, and other OWASP top 10 vulnerabilities. If you notice that you wrote insecure code, immediately fix it.

I could definitely see these causing false positives depending on what (probably much simpler/faster/cheaper) model they're using to flag usage policy violations.

Sometimes I'm getting flagged even when my prompt is just "rename this variable from foo to bar" in a basic web app.

github-actions[bot] · 7 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] · 6 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] · 6 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.