[BUG] --disable-slash-commands still ships 10 skills as API-call attachment in -p mode
Title
[BUG] --disable-slash-commands still ships 10 skills as API-call attachment in -p mode
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
The --disable-slash-commands flag (described in --help as "Disable all skills") removes the user-facing /slash invocation surface but does not stop bundled skills from being attached to the outgoing API request. Token accounting confirms ~12K of CLI-injected content rides on every -p invocation even with a user-supplied --system-prompt, and the debug log shows Sending 10 skills via attachment immediately after announcing Loaded 0 unique skills.
For programmatic and custom agent prompt experiments and development this defeats the practical purpose of -p --system-prompt, which is to send only the caller's curated context to the model and keep token cost minimal. The skill set being attached (update-config, keybindings-help, simplify, fewer-permission-prompts, loop, schedule, claude-api, init, review, security-review in my install) is irrelevant to those workloads and inflates per-call cost substantially.
What Should Happen?
With --disable-slash-commands, no skills are attached to the API request. The flag stops both /slash invocation AND the attachment.
Error Messages/Logs
2026-05-18T13:46:46.413Z [DEBUG] Loading skills from: managed=/etc/claude-code/.claude/skills, user=<HOME>/.claude/skills, project=[]
2026-05-18T13:46:46.415Z [DEBUG] Loaded 0 unique skills (0 unconditional, 0 conditional, managed: 0, user: 0, project: 0, additional: 0, legacy commands: 0)
2026-05-18T13:46:46.415Z [DEBUG] getPluginSkills: Processing 0 enabled plugins
2026-05-18T13:46:46.415Z [DEBUG] Total plugin skills loaded: 0
2026-05-18T13:46:46.415Z [DEBUG] getSkills returning: 0 skill dir commands, 0 plugin skills, 11 bundled skills, 0 builtin plugin skills
2026-05-18T13:46:46.591Z [DEBUG] Sending 10 skills via attachment (initial, 10 total sent)
2026-05-18T13:46:46.599Z [DEBUG] Dynamic tool loading: 0/16 deferred tools included
Note the contradiction between "Loaded 0 unique skills" / "Total plugin skills loaded: 0" and "Sending 10 skills via attachment".
Steps to Reproduce
# 1. Use a sandbox HOME so user CLAUDE.md / settings.json don't confound the test.
SBX=$(mktemp -d)
mkdir -p "$SBX/.claude"
ln -s "$HOME/.claude/.credentials.json" "$SBX/.claude/.credentials.json"
# 2. Invoke claude -p with --disable-slash-commands and a tiny custom system prompt.
HOME="$SBX" claude -p \
--disable-slash-commands \
--strict-mcp-config --mcp-config '{"mcpServers":{}}' \
--model claude-sonnet-4-6 \
--no-session-persistence \
--output-format json \
--system-prompt 'You are an auditor. Reply CLEAN.' \
--debug-file /tmp/cc.log \
<<< 'ping' > /tmp/cc.out
# 3. Check the debug log for skills attachment.
grep -iE 'skill|attachment' /tmp/cc.log
# 4. Check the token usage to see CLI-injected content size.
python3 -c "import json; d=json.load(open('/tmp/cc.out')); m=d['modelUsage']['claude-sonnet-4-6']; print(f'cache_create={m[\"cacheCreationInputTokens\"]} cache_read={m[\"cacheReadInputTokens\"]}')"
rm -rf "$SBX"
Observed token shape
cache_create=1318 cache_read=10968
The user-supplied --system-prompt is ~10 tokens. The remaining ~12K tokens of system-side content are CLI-injected. Comparing the size with and without --bare (which does strip skills) confirms the skill attachment is the dominant component of that 12K.
Claude Model
Sonnet (default) — reproduced explicitly on claude-sonnet-4-6. Not model-specific; CLI-injected content is per-invocation, not per-model.
Is this a regression?
I haven't tested older versions.
Last Working Version
N/A.
Claude Code Version
2.1.133 (Claude Code)
Platform
Anthropic API
Operating System
Devcontainer, Linux 6.12.76-linuxkit, ARM, on M-series Mac.
Terminal/Shell
Bash inside vscode
Additional Information
Running a batch of claude -p --system-prompt <policy> calls, per-call steady-state cost is ~$0.017 with the ~14K system-side tokens. Of that, ~2K is my custom prompt and ~12K is the CLI-injected skills + tool registry. Stripping the CLI overhead would cut per-call cost substantially.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗