[BUG] Skills silently fail in --print mode with no error or warning

Resolved 💬 3 comments Opened Apr 7, 2026 by doctoryes Closed May 20, 2026

Preflight Checklist

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

What's Wrong?

Problem

When invoking a skill via --print -p "/my-skill args", the skill is silently ignored. Claude responds with text about the skill being unavailable, exits with code 0, and reports non-zero token usage. There is no error, no warning, and no indication that the skill was not invoked.

Current behavior

  • claude --print -p "/my-skill args" -> exit 0, Claude responds conversationally, no tool invocations
  • claude -p "/my-skill args" -> skill executes correctly

Additional context

The -p flag name is easily confused with --print. Users naturally combine them (--print -p "prompt") assuming -p is shorthand for --print. The fact that they're independent flags with different semantics is not obvious from the CLI help.

Impact

We spent multiple days debugging a CI job (Fleetshift shift in Docker) that invokes Claude Code skills. The job appeared to run successfully (exit 0, non-zero tokens) but never invoked any skills. Without clear error signals, we went through multiple wrong hypotheses (wrong skill names, missing plugin, prompt format, stdin piping) before discovering the root cause via the headless docs. The -p flag name being easily confused with --print compounds the issue.

What Should Happen?

Expected behavior

One of:

  1. Error exit code when a skill slash command is used in --print mode (e.g., exit 1 with message "Skills are not available in headless mode. Use -p without --print.")
  2. Warning on stderr like WARNING: Skill /my-skill was referenced but skills are disabled in --print mode
  3. Clearer documentation that -p and --print are independent flags with different capabilities

Error Messages/Logs

Steps to Reproduce

Reproduction

# Silent failure (0 tool uses):
claude --print -p "/commit" --max-turns 2 --permission-mode bypassPermissions

# Works correctly:
claude -p "/commit" --max-turns 2 --permission-mode bypassPermissions

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.92

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗