Feature: Add --fast flag for minimal CLI boot in -p/--print mode

Resolved 💬 3 comments Opened Apr 4, 2026 by egantz Closed Apr 8, 2026

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:

  1. Skips hooks (SessionStart, PreToolUse, PostToolUse)
  2. Skips MCP server discovery/connection
  3. Skips plugin sync
  4. Skips CLAUDE.md auto-discovery
  5. Skips LSP initialization
  6. Skips background prefetches
  7. 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 -p invocation

View original on GitHub ↗

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