Feature: Add --fast flag for minimal CLI boot in -p/--print mode
Problem
When using claude -p (print mode) programmatically from wrapper tools, the CLI boot takes 6-8 seconds even for trivial prompts like "hi". The majority of this time is spent on:
- Hook loading and execution (SessionStart hooks, etc.)
- MCP server discovery and connection
- Plugin sync
- CLAUDE.md auto-discovery
- LSP initialization
- Background prefetches
For tools that manage their own sessions, tools, and context (like LaraClaw — a PHP-native coding agent that wraps claude -p), this overhead is pure waste.
Current workarounds
--no-session-persistence— helps slightly--no-chrome— helps slightly--disable-slash-commands— helps slightly--bare— skips everything but also disables OAuth/keychain auth, making it unusable for Max subscribers
The gap: there's no flag that says "skip all the overhead but keep authentication working."
Proposed solution
Add a --fast flag (or similar) for -p mode that:
- Skips hooks (SessionStart, PreToolUse, PostToolUse)
- Skips MCP server discovery/connection
- Skips plugin sync
- Skips CLAUDE.md auto-discovery
- Skips LSP initialization
- Skips background prefetches
- Keeps OAuth/keychain authentication working
Essentially --bare but with auth preserved.
Use case
LaraClaw is a PHP CLI coding agent built on Laravel Zero that uses claude -p --output-format stream-json as its LLM backend for Max subscribers. We handle our own:
- System prompt (with CLAUDE.md discovery)
- Tool execution (8 built-in tools)
- Session persistence (JSONL)
- Permission system
- MCP client
The only thing we need from the CLI is: authenticate and call the API. Everything else the CLI does on boot is redundant for our use case.
Environment
- Claude Code 2.1.92
- macOS (Apple Silicon)
- Max subscription
- Measured boot time: ~6-8 seconds per
claude -pinvocation
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗