Skip to content

Instantly share code, notes, and snippets.

@johnlindquist
Last active January 8, 2026 18:09
Show Gist options
  • Select an option

  • Save johnlindquist/b2207ac2cc1a8fdcf5e08d30676c3e52 to your computer and use it in GitHub Desktop.

Select an option

Save johnlindquist/b2207ac2cc1a8fdcf5e08d30676c3e52 to your computer and use it in GitHub Desktop.
Claude Code CLI Hidden Flags (v2.1.1)

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

Notable Absent Flags

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

Disabling Hooks Workarounds

# 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"

Troubleshooting

Chrome MCP Bridge Socket Error

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/null

Prevention: Add cleanup to shell startup:

# In ~/.zshrc or ~/.bashrc
rm -f /var/folders/*/T/claude-mcp-browser-bridge-$(whoami) 2>/dev/null

Notes

  • 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_"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment