[BUG] --agent option does not work with -p
Resolved 💬 4 comments Opened Dec 25, 2025 by tyler-rt Closed Feb 14, 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?
claude --agent Plan -p "what agent are you?" does not successfully engage the Plan agent, but launching the CLI with claude --agent Plan does succeed.
What Should Happen?
claude --agent Plan -p "what agent are you?" should use the Plan agent.
Error Messages/Logs
Steps to Reproduce
❯ claude -p "what agent are you?"
I am **Claude Code**, an interactive CLI tool built on Anthropic's Claude Agent SDK. I'm powered by the **Claude Opus 4.5** model (model ID: `claude-opus-4-5-20251101`).
[...]
❯ claude --agent Plan -p "what agent are you?"
I am **Claude Code**, an interactive CLI tool built on Anthropic's Claude Agent SDK. I'm powered by the **Claude Opus 4.5** model (model ID: `claude-opus-4-5-20251101`).
[...]
❯ claude --agent Plan
╭─── Claude Code v2.0.76 ────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │ Tips for getting started │
│ Welcome back Tyler! │ Run /init to create a CLAUDE.md file with instructions for Claude │
│ │ ───────────────────────────────────────────────────────────────── │
│ * ▗ ▗ ▖ ▖ * │ Recent activity │
│ * * │ No recent activity │
│ * ▘▘ ▝▝ * │ │
│ │ │
│ Opus 4.5 · API Usage Billing · My Company │ │
│ Plan · ~/test │ │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Your bash commands will be sandboxed. Disable with /sandbox.
Welcome to Opus 4.5
> what agent are you?
⏺ I am a software architect and planning specialist for Claude Code. My role is specifically focused on:
[...]
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.76
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗