Claude Code CLI Hidden Flags (v2.1.1)
These flags are hidden from claude --help but are available in the CLI.
Found by searching the compiled binary source.
Hidden Flags
| Flag | Description |
|---|---|
-d2e, --debug-to-stderr |
Enable debug mode (to stderr) |
--max-thinking-tokens <tokens> |
Maximum number of thinking tokens (only works with --print) |
--max-turns <turns> |
Maximum number of agentic turns in non-interactive mode. Early exits after specified turns (only works with --print) |
--enable-auth-status |
Enable auth status messages in SDK mode |
--permission-prompt-tool <tool> |
MCP tool to use for permission prompts (only works with --print) |
--system-prompt-file <file> |
Read system prompt from a file |
--append-system-prompt-file <file> |
Read system prompt from file and append to default |
--resume-session-at <message id> |
When resuming, only include messages up to specified assistant message ID (use with --resume in print mode) |
--rewind-files <user-message-id> |
Restore files to state at the specified user message and exit (requires --resume) |
--sdk-url <url> |
Use remote WebSocket endpoint for SDK I/O streaming (only with -p and stream-json format) |
--teleport [session] |
Resume a teleport session, optionally specify session ID |
--remote <description> |
Create a remote session with the given description |
After exhaustive search of the binary, these commonly-requested flags do NOT exist:
| Desired Flag | Status | Workaround |
|---|---|---|
--disable-hooks |
Does not exist | Use --setting-sources "" |
--no-hooks |
Does not exist | Use --settings '{"hooks": {}}' |
--skip-hooks |
Does not exist | Combine both above |
# Method 1: Empty setting sources (disables ALL settings including hooks)
claude --setting-sources "" --print "your prompt"
# Method 2: Override hooks with empty object
claude --settings '{"hooks": {}}' --print "your prompt"
# Method 3: Combine both for maximum isolation
claude --setting-sources "" --settings '{"hooks": {}}' --print "your prompt"If you encounter this error:
Error: EOPNOTSUPP: unknown error, watch '/var/folders/.../claude-mcp-browser-bridge-<username>'
Cause: Stale Unix socket file left behind from a previous Claude session with Chrome integration.
Fix:
# Find and remove the stale socket
rm /var/folders/*/T/claude-mcp-browser-bridge-$(whoami)
# Or find it first
find /var/folders -name "claude-mcp-browser-bridge-*" 2>/dev/nullPrevention: Add cleanup to shell startup:
# In ~/.zshrc or ~/.bashrc
rm -f /var/folders/*/T/claude-mcp-browser-bridge-$(whoami) 2>/dev/null- These are internal/developer flags, likely used for SDK integrations, remote sessions, and advanced automation
- Found in Claude Code version 2.1.1
- Use at your own risk - these may change without notice
How to Discover Hidden Flags
# Basic search
strings $(readlink -f $(which claude)) | grep -oE '^\-\-[a-z\-]+([ ]+<[^>]+>)?' | sort -u
# Search for specific patterns
strings $(readlink -f $(which claude)) | grep -i "hook"
strings $(readlink -f $(which claude)) | grep -E "CLAUDE_CODE_|CLAUDE_"