[BUG] Plugin commands fail with 'String should have at most 64 characters' error on tool_reference.tool_name
Bug Description
Plugin commands with allowed-tools fail with API Error 400 when making tool calls. The error occurs even with basic built-in tools like Bash, making complex plugin commands completely unusable.
Error Message
API Error: 400 messages.X.content.Y.tool_result.content.Z.tool_reference.tool_name: String should have at most 64 characters
Environment
- Claude Code Version: 2.1.20
- Platform: macOS (Darwin 25.2.0)
- Node Version: v24.12.0
- Installation: npm global install (@anthropic-ai/claude-code@2.1.20)
Reproduction Steps
- Create a plugin with a command that has
allowed-toolsspecified - Command makes any tool call (even simple ones like
Bash) - Error occurs on the tool result, blocking command execution
Minimal Reproduction
Plugin structure:
.claude-plugin/
plugin.json
commands/
test-command.md
test-command.md:
---
description: Test command with allowed tools
argument-hint: [test-arg]
allowed-tools: Bash, Read, Write, Glob, Grep
---
Test command that makes a simple bash call.
Instructions:
1. Create a directory: mkdir -p ~/test
2. Report success
Result: First tool call succeeds, but subsequent tool results trigger the 64-character validation error.
Expected Behavior
Plugin commands should be able to use allowed-tools without hitting character limits on internal tool reference names.
Actual Behavior
The plugin system appears to add internal namespacing (e.g., plugin:plugin-name:command:tool-name or similar) that pushes tool reference names beyond the 64-character API limit, even for short tool names like "Bash" or "Read".
Impact
Critical - This makes the plugin system essentially unusable for any non-trivial workflows:
- Commands that need multiple tool calls fail
- Cannot build complex analysis or automation workflows
- Plugin marketplace becomes non-functional for real use cases
- Forces users to abandon plugins and paste instructions manually (defeating the entire purpose)
Additional Context
This issue occurs consistently across different plugin commands and appears to be a fundamental limitation in how the plugin system constructs tool references internally. The error surfaces when Claude Code attempts to reference tools in the API request/response cycle.
Example Real-World Command Affected
A defect analysis command that:
- Fetches JIRA ticket data
- Creates working directory (Bash call - fails here)
- Downloads attachments
- Analyzes code
- Generates report
The command fails at step 2 with the tool_name character limit error.
Workaround
The only workaround is to not use plugins at all and paste command instructions directly into regular Claude Code sessions, which completely defeats the purpose of the plugin system.
Suggested Fix
The plugin system should either:
- Use shorter internal tool reference naming schemes
- Not include full plugin context in tool reference names
- Increase the API's 64-character limit for tool names
- Implement tool reference aliasing to keep names under the limit
Related Files
- Plugin commands with
allowed-toolsin frontmatter - Any command making sequential tool calls via plugins
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗