Skip to content

[BUG] 'claude-api' is consuming entire context #70062

Description

@SenojLuap

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When attempting to ask a question in non-interactive mode (prompt was "Have the changes for 'non-interactive' usage rates gone into effect?"), the 'claude-api' skill is being loaded and consuming the entire context, resulting in the 'Prompt is too long' error.

Claude's summary of the issue:

Session metadata (anonymized):

sessionId: [REDACTED]
cwd: /home/[USER]/delete/tmp
version: 2.1.176

1. User prompt sent:

{"type":"user","message":{"role":"user","content":"Have the changes for 'non-interactive' usage rates gone into effect?"},"entrypoint":"sdk-cli"}

2. Skill listing loaded at session start (showing claude-api among active skills):

{"attachment":{"type":"skill_listing","names":["grill-me","lazydm-session","deep-research","skill-creator:skill-creator","update-config","keybindings-help","verify","code-review","simplify","fewer-permission-prompts","loop","schedule","claude-api","run","init","review","security-review"],"isInitial":true}}

3. Claude decides to invoke the claude-api skill:

{"message":{"content":[{"type":"tool_use","name":"Skill","input":{"skill":"claude-api"}}],"stop_reason":"tool_use"}}

4. Skill content loaded — the full contents of the bundled claude-api SKILL.md are injected as a tool result. The content includes complete API reference documentation for C#, Go, Java, PHP, Python, TypeScript, cURL, managed agents, model migration guides, and more. Total size is several hundred KB.

5. Immediate error:

{"message":{"content":[{"type":"text","text":"Prompt is too long"}],"error":"invalid_request","isApiErrorMessage":true}}

Summary for bug report: In -p (non-interactive) mode, a 10-word conversational prompt triggered the bundled claude-api skill, which loaded its entire documentation contents into the context. The resulting prompt exceeded the model's context limit, producing a "Prompt is too long" error on a fresh session. Running with --safe-mode (which disables skills) resolves the issue.

What Should Happen?

The skill shouldn't consume the entire context, blocking usage.

Error Messages/Logs

Steps to Reproduce

While on Claude Code version 2.1.176: claude -p "Have the changes for 'non-interactive' usage rates gone into effect? "

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.176

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

I am using the Alacritty terminal on Manjaro Linux

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:skillsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:linuxIssue specifically occurs on LinuxreproducedBug reproduced by maintainers on a released buildstaleIssue is inactive

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions