Seedling Planted January 20, 2026 8 min read

Coding Agent Cheat Codes

CLI flags, environment variables, and proxy tricks for agentic engineering (or vibe coding, whatever you call it)

You know how old video games had cheat codes? ↑↑↓↓←→←→BA and suddenly you’re invincible?

Claude Code has its own version. CLI flags for granular permissions, undocumented environment variables that unlock hidden behaviors, and proxy configurations that let you route through different backends.

Some of this is documented (the CLI flags). Most of it isn’t. You’re welcome.


God Mode: Permission Bypasses

For authorized pen-testing and CI/CD pipelines where you need to skip the permission prompts:

export IS_SANDBOX=1                           # Sandbox environment flag - bypasses some permission checks
export CLAUDE_CODE_ACTION="bypassPermissions" # Auto-accept all operations (use in CI/CD)
export CLAUDE_CODE_ACTION="acceptEdits"       # Ask before file changes only
export CLAUDE_CODE_ACTION="plan"              # Analysis only, no modifications
WarningThese are meant for controlled environments. Don’t run

bypassPermissions on your production machine unless you enjoy chaos.


CLI Flags: The Command Line Arsenal

These are the flags you pass directly to the claude command.

Permission & Tool Control

# Granular tool permissions (the smart way)
claude --allowedTools "Bash(git *)" "Bash(npm *)" "Write" "Read"

# Block specific dangerous tools
claude --disallowedTools "Bash(rm:*)" "Bash(sudo:*)"

# YOLO mode - skip ALL permission prompts
claude --dangerously-skip-permissions

# Set permission mode at startup
claude --permission-mode <mode>

Pattern matching works too:

  • Write(src/**) - Allow writes only in src/
  • Bash(git *) - Allow git commands
  • Bash(npm test) - Allow only npm test

Model Selection

claude --model opus                    # Use Opus
claude --model sonnet                  # Use Sonnet
claude --model claude-3-5-sonnet-20241022  # Full model name
claude --fallback-model sonnet         # Fallback when overloaded (print mode)

Session Management

claude -c                              # Continue most recent conversation
claude -r "session-name"               # Resume specific session by name/ID
claude --session-id <uuid>             # Use specific session ID
claude -c --fork-session               # Fork last session into new branch
claude -r "session" --fork-session     # Fork specific session into new branch
claude --no-session-persistence        # Don't save session
Tip

--fork-session creates a new session ID from the resumed point, leaving the original untouched. Like git branching for conversations.

System Prompts

# Replace entire system prompt
claude --system-prompt "You are a Python expert"
claude --system-prompt-file ./my-prompt.txt

# Append to default prompt (keeps Claude Code behavior)
claude --append-system-prompt "Always use TypeScript"
claude --append-system-prompt-file ./extra-instructions.txt

Output Formats (Print Mode)

claude -p "query" --output-format text          # Plain text (default)
claude -p "query" --output-format json          # JSON output
claude -p "query" --output-format stream-json   # Streaming JSON

# Get validated JSON matching a schema
claude -p "query" --json-schema '{"type": "object", ...}'

Limits & Budgets

claude --max-turns 10                  # Limit agentic turns
claude --max-budget-usd 5.00           # Cap spending at $5

Directories & Config

claude --add-dir /path/to/other/project   # Add extra working directories
claude --settings ./my-settings.json      # Custom settings file
claude --mcp-config ./mcp-servers.json    # Load MCP servers from file
claude --strict-mcp-config                # Only use specified MCP servers

Debugging

claude --debug                         # Debug mode
claude --verbose                       # Full turn-by-turn output
claude -v                              # Show version

IDE & Browser

claude --ide                           # Auto-connect to IDE on startup
claude --chrome                        # Enable Chrome integration
claude --no-chrome                     # Disable Chrome integration

Custom Agents (Advanced)

claude --agents '{
  "code-reviewer": {
    "description": "Expert code reviewer",
    "prompt": "You are a senior code reviewer...",
    "tools": ["Read", "Edit", "Bash"],
    "model": "sonnet"
  }
}'

Web Sessions

claude --remote                        # Create session on claude.ai
claude --teleport                      # Resume web session locally

The Banner Hack

Tired of seeing your name and account info every time you launch Claude Code?

export IS_DEMO=1    # Hides identity from welcome banner

Useful for screen recordings, pair programming, or just not wanting your email displayed constantly.


Proxy Your Requests

Want to route Claude Code through a different API endpoint? Maybe you’re using a proxy service, a custom gateway, or want to experiment with compatible models.

Custom API Endpoint

export ANTHROPIC_BASE_URL="https://your-proxy-endpoint.com/api/anthropic"
export ANTHROPIC_AUTH_TOKEN="your-api-key"
export ANTHROPIC_MODEL="your-model-name"

Local Models with Ollama

Run Claude Code against local models:

export ANTHROPIC_AUTH_TOKEN=ollama
export ANTHROPIC_BASE_URL=http://localhost:11434

Ollama Cloud

For hosted Ollama instances:

import os
from ollama import Client

client = Client(
    host="https://ollama.com",
    headers={'Authorization': 'Bearer ' + os.environ.get('OLLAMA_API_KEY')}
)

messages = [{'role': 'user', 'content': 'Why is the sky blue?'}]

for part in client.chat('your-model', messages=messages, stream=True):
    print(part['message']['content'], end='', flush=True)

Authentication & API Configuration

ANTHROPIC_API_KEY                # Primary API key for Claude
ANTHROPIC_AUTH_TOKEN             # Alternative auth token
ANTHROPIC_BASE_URL               # Custom endpoint (proxies, gateways)
ANTHROPIC_BETAS                  # Comma-separated beta features to enable
ANTHROPIC_CUSTOM_HEADERS         # Custom HTTP headers (JSON format)
CLAUDE_CODE_OAUTH_TOKEN          # OAuth token for authentication

AWS Bedrock

CLAUDE_CODE_USE_BEDROCK=1        # Use AWS Bedrock instead of direct API
AWS_ACCESS_KEY_ID                # AWS access key
AWS_SECRET_ACCESS_KEY            # AWS secret key
AWS_SESSION_TOKEN                # For temporary credentials
AWS_REGION                       # AWS region for Bedrock
AWS_PROFILE                      # AWS profile name
BEDROCK_BASE_URL                 # Custom Bedrock endpoint
CLAUDE_CODE_SKIP_BEDROCK_AUTH=1  # Skip Bedrock auth (for custom setups)

Google Vertex AI

CLAUDE_CODE_USE_VERTEX=1                   # Use Google Vertex AI
ANTHROPIC_VERTEX_PROJECT_ID                # GCP Project ID
VERTEX_BASE_URL                            # Custom Vertex endpoint
VERTEX_REGION_CLAUDE_4_0_OPUS              # Region for Opus
VERTEX_REGION_CLAUDE_4_0_SONNET            # Region for Sonnet
GOOGLE_APPLICATION_CREDENTIALS             # Path to service account JSON
CLAUDE_CODE_SKIP_VERTEX_AUTH=1             # Skip Vertex auth

Model Selection

ANTHROPIC_MODEL                  # Default model to use
ANTHROPIC_SMALL_FAST_MODEL       # Smaller model for quick operations
CLAUDE_CODE_SUBAGENT_MODEL       # Model for sub-agent operations

Token & Output Limits

CLAUDE_CODE_MAX_OUTPUT_TOKENS    # Max output tokens for responses
MAX_THINKING_TOKENS              # Max tokens for model thinking steps
MAX_MCP_OUTPUT_TOKENS            # Max tokens for MCP server outputs
BASH_MAX_OUTPUT_LENGTH           # Max length of bash command output

Timeout Configuration

API_TIMEOUT_MS                   # API request timeout
BASH_DEFAULT_TIMEOUT_MS          # Default timeout for bash commands
BASH_MAX_TIMEOUT_MS              # Maximum timeout for bash commands
MCP_TIMEOUT                      # General MCP operations timeout
MCP_TOOL_TIMEOUT                 # Specific MCP tool execution timeout

Execution Controls

CLAUDE_CODE_ACTION                              # Permission modes (see God Mode above)
FORCE_CODE_TERMINAL=1                           # Force CLI mode in GUI environments
CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1      # Keep bash in project directory
CLAUDE_CODE_SHELL_PREFIX                        # Prefix for shell commands
CLAUDE_CODE_DISABLE_COMMAND_INJECTION_CHECK=1   # Disable injection security checks

Thinking & Response Modes

DISABLE_INTERLEAVED_THINKING=1   # Traditional responses (no interleaved reasoning)
DISABLE_MICROCOMPACT=1           # Verbose output (disable compression)
USE_API_CONTEXT_MANAGEMENT=1     # Better memory/context handling

MCP (Model Context Protocol) Settings

MCP_TIMEOUT                        # General timeout for MCP operations
MCP_TOOL_TIMEOUT                   # Timeout for MCP tool execution
MAX_MCP_OUTPUT_TOKENS              # Max tokens for MCP outputs
MCP_OAUTH_CALLBACK_PORT            # Port for OAuth callback
MCP_SERVER_CONNECTION_BATCH_SIZE   # Batch size for server connections

IDE Integration

CLAUDE_CODE_AUTO_CONNECT_IDE=1      # Auto-connect to IDE
CLAUDE_CODE_IDE_HOST_OVERRIDE       # Custom host for IDE communication
CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL=1 # Skip IDE extension auto-install
CLAUDE_CODE_IDE_SKIP_VALID_CHECK=1  # Bypass IDE validation
CLAUDE_CODE_GIT_BASH_PATH           # Path to Git Bash (Windows)

Debugging & Telemetry

DEBUG=1                          # Verbose logging
DEBUG_AUTH=1                     # Authentication debugging
DISABLE_TELEMETRY=1              # Turn off data collection
CLAUDE_CODE_ENABLE_TELEMETRY=1   # Explicitly enable telemetry
DISABLE_ERROR_REPORTING=1        # Disable automatic error reporting

Sentry Error Tracking

SENTRY_DSN                       # Sentry Data Source Name
SENTRY_ENVIRONMENT               # Sentry environment name
SENTRY_RELEASE                   # Sentry release version
SENTRY_TRACES_SAMPLE_RATE        # Performance monitoring sample rate

OpenTelemetry

OTEL_EXPORTER_OTLP_ENDPOINT      # OTLP exporter endpoint
OTEL_EXPORTER_OTLP_HEADERS       # OTLP exporter headers
OTEL_LOG_USER_PROMPTS=1          # Log user prompts in telemetry
CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS  # OTEL shutdown timeout

Performance Tuning

CHOKIDAR_USEPOLLING=1            # File watching via polling (VMs/containers/WSL)
CHOKIDAR_INTERVAL=500            # Polling interval in ms (default: 100)
DISABLE_PROMPT_CACHING=1         # Disable response caching
USE_BUILTIN_RIPGREP=1            # Use bundled ripgrep instead of system
CLAUDE_CODE_MAX_RETRIES          # Max request retries on failure

Disable Commands

Don’t want users running certain commands? Block them:

DISABLE_AUTOUPDATER=1                      # No automatic updates
DISABLE_BUG_COMMAND=1                      # No bug reporting
DISABLE_COST_WARNINGS=1                    # No API cost warnings
DISABLE_DOCTOR_COMMAND=1                   # No diagnostic command
DISABLE_LOGIN_COMMAND=1                    # No login
DISABLE_LOGOUT_COMMAND=1                   # No logout
DISABLE_UPGRADE_COMMAND=1                  # No upgrade command
DISABLE_INSTALL_GITHUB_APP_COMMAND=1       # No GitHub app install
DISABLE_MIGRATE_INSTALLER_COMMAND=1        # No installer migration

TLS/SSL Configuration

CLAUDE_CODE_CLIENT_CERT            # Path to client certificate
CLAUDE_CODE_CLIENT_KEY             # Path to client private key
CLAUDE_CODE_CLIENT_KEY_PASSPHRASE  # Passphrase for encrypted key
NODE_EXTRA_CA_CERTS                # Additional CA certificates

Network & Proxy

HTTP_PROXY                                     # HTTP proxy URL
HTTPS_PROXY                                    # HTTPS proxy URL
NO_PROXY                                       # Domains to exclude from proxy
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1     # Minimize network calls
CLAUDE_CODE_DONT_INHERIT_ENV=1                 # Don't inherit env vars

Misc & Experimental

CLAUDE_CONFIG_DIR                  # Custom config directory
CLAUDE_FORCE_DISPLAY_SURVEY=1      # Force display user surveys
CLAUDE_CODE_ENTRYPOINT             # Custom app entrypoint
CLAUDE_CODE_EXTRA_BODY             # Additional JSON for API requests
CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1           # Don't update terminal title
CLAUDE_CODE_DISABLE_FINE_GRAINED_TOOL_STREAMING=1  # Disable detailed streaming
CLAUBBIT                           # Internal dev/debug flag (don't touch)

Making It Permanent

Add to your shell config (~/.bashrc, ~/.zshrc):

# Claude Code tweaks
export IS_DEMO=1
export DISABLE_TELEMETRY=1
export CHOKIDAR_USEPOLLING=1  # if you're in WSL/Docker

Then reload:

source ~/.zshrc

Why This Matters

The gap between official docs and real-world settings is massive. These variables exist in the codebase but aren’t advertised.

Some are intentionally hidden. Some are just undocumented. All of them give you more control over how your coding agent behaves.

Use them wisely. Or don’t. I’m not your mom.