-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Open
Description
Bug Description
Enabling the document-skills@anthropic-agent-skills plugin causes a 400 invalid_request_error when starting Claude Code sessions in some projects.
Error message:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"The request body is not valid JSON: no low surrogate in string: line 1 column 29719 (char 29718)"},"request_id":"req_011CYSB4e4d24oGqnUT19dUE"}
Root Cause
The file skills/theme-factory/theme-showcase.pdf (124,310 bytes) is a binary PDF that contains 9 unpaired UTF-16 high surrogate byte sequences (0xED 0xA0-0xBF 0x80-0xBF in UTF-8 encoding).
When Claude Code loads the plugin, it appears to read this binary PDF as text content and includes it in the JSON request body sent to the API. The unpaired surrogates make the JSON invalid, causing the API to reject the request.
Steps to Reproduce
- Install and enable the
document-skills@anthropic-agent-skillsplugin in Claude Code - Open a project with moderate context size (CLAUDE.md, etc.)
- Start a new conversation — API returns 400 error
Disabling the plugin immediately resolves the issue.
Suggested Fix
One or more of:
- Exclude binary files (PDF, images, etc.) from plugin content loading
- Add a
.skillignoreor similar mechanism to skip non-text assets - Convert
theme-showcase.pdfto a non-binary format (e.g. screenshot image or markdown description) - Add binary file filtering in the plugin loader to skip files that aren't valid UTF-8 text
Workaround
Manually delete the cached PDF files:
rm ~/.claude/plugins/cache/anthropic-agent-skills/document-skills/*/skills/theme-factory/theme-showcase.pdfEnvironment
- Claude Code CLI (latest)
- macOS
- Plugin version: commit
1ed29a03dc85
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels