diff --git a/README.md b/README.md index 12bd32a..b0ac88d 100644 --- a/README.md +++ b/README.md @@ -80,20 +80,33 @@ practice makes claude perfect ## KEYWORDS -**Claude:** +**CLI STARTUP FLAGS:** -| | | | -|---|---|---| -| `btw` (background task) | `"defaultMode": "bypassPermissions"` | ~~`ultrathink`~~ (deprecated) | +| | | | | | +|---|---|---|---|---| +| `--dangerously-skip-permissions` | `--model` | `--print` | `--resume` | `--continue` | +| `--system-prompt` | `--verbose` | `--debug` | `--init` | `--max-turns` | -**Community:** +[**See Complete List →**](reports/claude-cli-startup-flags.md) + +**AI TERMS:** + +| | | | | | +|---|---|---|---|---| +| Agentic Engineering | AI Slop | Context Bloat | Context Engineering | Context Rot | +| Dumb Zone | Hallucination | Scaffolding | Orchestration | Vibe Coding | + +[**See Complete List →**](https://github.com/shanraisshan/claude-code-codex-cursor-gemini/blob/main/reports/ai-terms.md) + +**COMMANDS:** + +| | | | | | +|---|---|---|---|---| +| `/compact` | `/context` | `/model` | `/plan` | `/config` | +| `/clear` | `/cost` | `/memory` | `/doctor` | `/rewind` | + +[**See Complete List →**](reports/claude-commands.md) -| | | | | | | -|---|---|---|---|---|---| -| Agentic Workflow | AI Slop | Closing the loop | Context Bloat | Context Engineering | Context Rot | -| Dumb Zone | Hallucination | Harness | One Shot | Orchestration | Progressive Disclosure | -| Rate Limit Jail | Scaffolding | Slot Machine Method (save→run→revert→retry) | Stop | The Holy Trinity (Skills+Agents+Hooks) | Token Burn | -| Vibe Coding | | | | | | ## CLAUDE CODE FEATURES INSPIRATION @@ -128,6 +141,8 @@ See [reports/claude-settings.md](reports/claude-settings.md) for a comprehensive |--------|-------------| | [Agent SDK vs CLI System Prompts](reports/claude-agent-sdk-vs-cli-system-prompts.md) | Why Claude CLI and Agent SDK outputs may differ—system prompt architecture and determinism | | [Browser Automation MCP Comparison](reports/claude-in-chrome-v-chrome-devtools-mcp.md) | Comparison of Playwright, Chrome DevTools, and Claude in Chrome for automated testing | +| [Claude Code CLI Startup Flags](reports/claude-cli-startup-flags.md) | Complete reference of all CLI flags, subcommands, and environment variables | +| [Claude Code Commands Reference](reports/claude-commands.md) | Complete reference of all slash commands, keyboard shortcuts, and input modes | | [Claude Code Settings Reference](reports/claude-settings.md) | Comprehensive guide to all `settings.json` configuration options | | [CLAUDE.md Loading in Monorepos](reports/claude-md-for-larger-mono-repos.md) | Understanding ancestor vs descendant loading behavior for CLAUDE.md files | | [Skills Discovery in Monorepos](reports/claude-skills-for-larger-mono-repos.md) | How skills are discovered and loaded in large monorepo projects | diff --git a/reports/claude-cli-startup-flags.md b/reports/claude-cli-startup-flags.md new file mode 100644 index 0000000..2ed39df --- /dev/null +++ b/reports/claude-cli-startup-flags.md @@ -0,0 +1,211 @@ +# Claude Code CLI Startup Flags Reference + +A comprehensive reference of all available command-line flags when launching Claude Code from the terminal. + +## Table of Contents + +1. [Session Management](#session-management) +2. [Model & Configuration](#model--configuration) +3. [Permissions & Security](#permissions--security) +4. [Output & Format](#output--format) +5. [System Prompt](#system-prompt) +6. [Agent & Subagent](#agent--subagent) +7. [MCP & Plugins](#mcp--plugins) +8. [Directory & Workspace](#directory--workspace) +9. [Budget & Limits](#budget--limits) +10. [Integration](#integration) +11. [Initialization & Maintenance](#initialization--maintenance) +12. [Debug & Diagnostics](#debug--diagnostics) +13. [Settings Override](#settings-override) +14. [Version & Help](#version--help) +15. [Subcommands](#subcommands) +16. [Environment Variables](#environment-variables) + +--- + +## Session Management + +| Flag | Short | Description | +|------|-------|-------------| +| `--continue` | `-c` | Continue the most recent conversation in the current directory | +| `--resume` | `-r` | Resume a specific session by ID or name, or show interactive picker | +| `--from-pr ` | | Resume sessions linked to a specific GitHub PR | +| `--fork-session` | | Create a new session ID when resuming (use with `--resume` or `--continue`) | +| `--session-id ` | | Use a specific session ID (must be valid UUID) | +| `--no-session-persistence` | | Disable session persistence (print mode only) | +| `--remote` | | Create a new web session on claude.ai | +| `--teleport` | | Resume a web session in your local terminal | + +--- + +## Model & Configuration + +| Flag | Short | Description | +|------|-------|-------------| +| `--model ` | | Set model with alias (`sonnet`, `opus`, `haiku`) or full model ID | +| `--fallback-model ` | | Auto-fallback model when default is overloaded (print mode only) | +| `--betas ` | | Beta headers to include in API requests (API key users only) | + +--- + +## Permissions & Security + +| Flag | Short | Description | +|------|-------|-------------| +| `--dangerously-skip-permissions` | | Skip ALL permission prompts. Use with extreme caution | +| `--allow-dangerously-skip-permissions` | | Enable permission bypassing as an option without activating it | +| `--permission-mode ` | | Begin in specified permission mode: `default`, `plan`, `acceptEdits`, `bypassPermissions` | +| `--allowedTools ` | | Tools that execute without prompting (permission rule syntax) | +| `--disallowedTools ` | | Tools removed from model context entirely | +| `--tools ` | | Restrict which built-in tools Claude can use (use `""` to disable all) | +| `--permission-prompt-tool ` | | Specify MCP tool to handle permission prompts in non-interactive mode | + +--- + +## Output & Format + +| Flag | Short | Description | +|------|-------|-------------| +| `--print` | `-p` | Print response without interactive mode (headless/SDK mode) | +| `--output-format ` | | Output format: `text`, `json`, `stream-json` | +| `--input-format ` | | Input format: `text`, `stream-json` | +| `--json-schema ` | | Get validated JSON matching schema (print mode only) | +| `--include-partial-messages` | | Include partial streaming events (requires `--print` and `--output-format=stream-json`) | +| `--verbose` | | Enable verbose logging with full turn-by-turn output | + +--- + +## System Prompt + +| Flag | Short | Description | +|------|-------|-------------| +| `--system-prompt ` | | Replace entire system prompt with custom text | +| `--system-prompt-file ` | | Load system prompt from file, replacing default (print mode only) | +| `--append-system-prompt ` | | Append custom text to default system prompt | +| `--append-system-prompt-file ` | | Append file contents to default prompt (print mode only) | + +--- + +## Agent & Subagent + +| Flag | Short | Description | +|------|-------|-------------| +| `--agent ` | | Specify an agent for the current session | +| `--agents ` | | Define custom subagents dynamically via JSON | +| `--teammate-mode ` | | Set agent team display: `auto`, `in-process`, `tmux` | + +--- + +## MCP & Plugins + +| Flag | Short | Description | +|------|-------|-------------| +| `--mcp-config ` | | Load MCP servers from JSON file or string | +| `--strict-mcp-config` | | Only use MCP servers from `--mcp-config`, ignore all others | +| `--plugin-dir ` | | Load plugins from directory for this session only (repeatable) | + +--- + +## Directory & Workspace + +| Flag | Short | Description | +|------|-------|-------------| +| `--add-dir ` | | Add additional working directories for Claude to access | + +--- + +## Budget & Limits + +| Flag | Short | Description | +|------|-------|-------------| +| `--max-budget-usd ` | | Maximum dollar amount for API calls before stopping (print mode only) | +| `--max-turns ` | | Limit number of agentic turns (print mode only) | + +--- + +## Integration + +| Flag | Short | Description | +|------|-------|-------------| +| `--chrome` | | Enable Chrome browser integration for web automation | +| `--no-chrome` | | Disable Chrome browser integration for this session | +| `--ide` | | Automatically connect to IDE on startup if exactly one valid IDE available | + +--- + +## Initialization & Maintenance + +| Flag | Short | Description | +|------|-------|-------------| +| `--init` | | Run initialization hooks and start interactive mode | +| `--init-only` | | Run initialization hooks and exit (no interactive session) | +| `--maintenance` | | Run maintenance hooks and exit | + +--- + +## Debug & Diagnostics + +| Flag | Short | Description | +|------|-------|-------------| +| `--debug ` | | Enable debug mode with optional category filtering (e.g., `"api,hooks"`) | + +--- + +## Settings Override + +| Flag | Short | Description | +|------|-------|-------------| +| `--settings ` | | Path to settings JSON file or JSON string to load | +| `--setting-sources ` | | Comma-separated list of sources to load: `user`, `project`, `local` | +| `--disable-slash-commands` | | Disable all skills and slash commands for this session | + +--- + +## Version & Help + +| Flag | Short | Description | +|------|-------|-------------| +| `--version` | `-v` | Output the version number | +| `--help` | `-h` | Show help information | + +--- + +## Subcommands + +These are not flags but top-level subcommands run as `claude `: + +| Subcommand | Description | +|------------|-------------| +| `claude` | Start interactive REPL | +| `claude "query"` | Start REPL with initial prompt | +| `claude update` | Update to latest version | +| `claude mcp` | Configure MCP servers (`add`, `remove`, `list`, `get`, `enable`) | +| `claude doctor` | Run diagnostics from the command line | + +--- + +## Environment Variables + +These environment variables modify Claude Code behavior at startup: + +| Variable | Description | +|----------|-------------| +| `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` | Enable experimental agent teams | +| `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1` | Disable experimental beta features | +| `CLAUDE_CODE_TMPDIR` | Override temp directory for internal files | +| `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS` | Disable background task functionality | +| `CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1` | Enable additional directory CLAUDE.md loading | +| `DISABLE_AUTOUPDATER=1` | Disable auto-updates | +| `MAX_THINKING_TOKENS` | Limit thinking token budget (set to `0` to disable) | +| `CLAUDE_CODE_EFFORT_LEVEL` | Control thinking depth: `low`, `medium`, `high` | +| `USE_BUILTIN_RIPGREP=0` | Use system ripgrep instead of built-in (Alpine Linux) | + +--- + +## Sources + +- [Claude Code CLI Reference](https://code.claude.com/docs/en/cli-reference) +- [Claude Code Headless Mode](https://code.claude.com/docs/en/headless) +- [Claude Code Setup](https://code.claude.com/docs/en/setup) +- [Claude Code CHANGELOG](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md) +- [Claude Code Common Workflows](https://code.claude.com/docs/en/common-workflows) diff --git a/reports/claude-commands.md b/reports/claude-commands.md new file mode 100644 index 0000000..8e271ca --- /dev/null +++ b/reports/claude-commands.md @@ -0,0 +1,236 @@ +# Claude Code Commands Reference + +A comprehensive reference of all available slash commands in Claude Code's interactive mode. + +## Table of Contents + +1. [Session Management](#session-management) +2. [Context & Cost](#context--cost) +3. [Model & Planning](#model--planning) +4. [Project & Memory](#project--memory) +5. [Configuration](#configuration) +6. [Extensions & Integrations](#extensions--integrations) +7. [Diagnostics & Debugging](#diagnostics--debugging) +8. [Import / Export](#import--export) +9. [Authentication](#authentication) +10. [Input Modes & Prefixes](#input-modes--prefixes) +11. [Dynamic Commands](#dynamic-commands) +12. [CLI Flags](#cli-flags) +13. [Keyboard Shortcuts](#keyboard-shortcuts) + +--- + +## Session Management + +| Command | Description | +|---------|-------------| +| `/clear` | Clear conversation history and start fresh | +| `/compact [instructions]` | Compress conversation to free context window. Optional instructions focus the compaction on specific topics | +| `/rename ` | Rename the current session for easier identification | +| `/resume [session]` | Resume a previous conversation by ID or name, or open the session picker | +| `/rewind` | Rewind the conversation and/or code to an earlier point, or summarize from a selected message | +| `/fork` | Fork the current conversation into a new session | +| `/teleport` | Resume a remote session from claude.ai (subscribers only) | +| `/exit` | Exit the REPL | + +--- + +## Context & Cost + +| Command | Description | +|---------|-------------| +| `/context` | Visualize current context usage as a colored grid with token counts and percentages | +| `/cost` | Show token usage statistics and spending for the current session | +| `/usage` | Show plan usage limits and rate limit status (subscription plans only) | +| `/stats` | Visualize daily usage, session history, streaks, and model preferences. Supports date range filtering | + +--- + +## Model & Planning + +| Command | Description | +|---------|-------------| +| `/model` | Switch models (haiku, sonnet, opus) and adjust Opus 4.6 effort level with arrow keys | +| `/plan` | Enter read-only planning mode where Claude suggests approaches without making changes | +| `/fast` | Toggle fast mode — same Opus 4.6 model with faster output | + +--- + +## Project & Memory + +| Command | Description | +|---------|-------------| +| `/init` | Initialize a new project with CLAUDE.md guide | +| `/memory` | View and edit CLAUDE.md memory files (user, project, and local scope) | + +--- + +## Configuration + +| Command | Description | +|---------|-------------| +| `/config` | Open the interactive Settings interface with search functionality | +| `/permissions` | View or update tool permissions | +| `/theme` | Change the color theme | +| `/vim` | Enable vim-style editing mode | +| `/keybindings` | Customize keyboard shortcuts per context, create chord sequences | +| `/statusline` | Set up Claude Code's status line UI | +| `/sandbox` | Configure sandboxing with dependency status | + +--- + +## Extensions & Integrations + +| Command | Description | +|---------|-------------| +| `/agents` | Manage custom subagents — view, create, edit, delete | +| `/skills` | View available skills and their descriptions | +| `/hooks` | Interactive interface to manage hooks | +| `/mcp` | Manage MCP server connections — add, enable, list, get info, OAuth authentication | +| `/plugin` | Manage plugins — install, uninstall, enable, disable, browse marketplaces | +| `/ide` | Connect to IDE integration | + +--- + +## Diagnostics & Debugging + +| Command | Description | +|---------|-------------| +| `/doctor` | Check the health of your Claude Code installation. Detects unreachable permissions, config issues, and updates | +| `/debug [description]` | Troubleshoot the current session by reading the session debug log | +| `/tasks` | List and manage background tasks | +| `/todos` | List current TODO items | +| `/help` | Show all available slash commands and usage help | +| `/feedback` | Generate a GitHub issue URL for reporting bugs or feedback | + +--- + +## Import / Export + +| Command | Description | +|---------|-------------| +| `/copy` | Copy the last assistant response to clipboard | +| `/export [filename]` | Export the current conversation to a file or clipboard | + +--- + +## Authentication + +| Command | Description | +|---------|-------------| +| `/login` | Authenticate with Claude Code via OAuth | +| `/logout` | Log out from Claude Code | + +--- + +## Input Modes & Prefixes + +These are special prefixes you can type at the prompt, not slash commands per se: + +| Prefix | Description | +|--------|-------------| +| `/` | Trigger command or skill autocomplete | +| `!` | Bash mode — run shell commands directly and add output to conversation | +| `@` | File path mention — trigger file path autocomplete for context | + +--- + +## Dynamic Commands + +These commands are not built-in but are discovered at runtime from your configuration: + +### MCP Prompts + +MCP servers can expose prompts that appear as commands: + +``` +/mcp____ +``` + +### Plugin Commands + +Installed plugins can provide their own commands, namespaced by plugin name: + +``` +/plugin-name:command-name +``` + +### Custom Skills + +Skills defined in `.claude/skills/` appear as invocable commands: + +``` +/skill-name +``` + +--- + +## CLI Flags + +These flags are used when launching Claude Code from the terminal, not as interactive commands: + +| Flag | Description | +|------|-------------| +| `--doctor` | Run diagnostics from the command line | +| `--debug` | Launch in debug mode with hook execution details | +| `--resume` | Resume most recent session | +| `--plan` | Start in plan mode | +| `--init` | Initialize repository with CLAUDE.md setup | +| `--init-only` | Run repository initialization only, then exit | +| `--maintenance` | Run repository maintenance operations | +| `--from-pr ` | Resume a session linked to a specific GitHub PR | + +--- + +## Keyboard Shortcuts + +### Navigation & Control + +| Shortcut | Description | +|----------|-------------| +| `Ctrl+C` | Cancel current input or generation | +| `Ctrl+D` | Exit Claude Code session | +| `Ctrl+L` | Clear terminal screen | +| `Ctrl+R` | Reverse search command history | +| `Ctrl+O` | Toggle verbose output | +| `Esc` + `Esc` | Rewind or summarize | + +### Model & Mode Switching + +| Shortcut | Description | +|----------|-------------| +| `Option+P` / `Alt+P` | Switch model | +| `Option+T` / `Alt+T` | Toggle extended thinking | +| `Shift+Tab` / `Alt+M` | Toggle permission modes | +| `Ctrl+B` | Background running tasks | +| `Ctrl+T` | Toggle task list | + +### Text Editing + +| Shortcut | Description | +|----------|-------------| +| `Ctrl+G` | Open prompt in default text editor | +| `Ctrl+V` / `Cmd+V` | Paste image from clipboard | +| `Ctrl+K` | Delete to end of line | +| `Ctrl+U` | Delete entire line | +| `Ctrl+Y` | Paste deleted text | +| `Alt+Y` | Cycle paste history | + +### Multiline Input + +| Shortcut | Description | +|----------|-------------| +| `\` + `Enter` | Quick escape for multiline | +| `Option+Enter` | macOS default multiline | +| `Shift+Enter` | Multiline (iTerm2, WezTerm, Ghostty, Kitty) | +| `Ctrl+J` | Line feed character for multiline | + +--- + +## Sources + +- [Claude Code Interactive Mode](https://code.claude.com/docs/en/interactive-mode) +- [Claude Code CLI Reference](https://code.claude.com/docs/en/cli-reference) +- [Claude Code Slash Commands](https://code.claude.com/docs/en/slash-commands) +- [Claude Code CHANGELOG](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md) +- [Claude Code Common Workflows](https://code.claude.com/docs/en/common-workflows) diff --git a/reports/claude-settings.md b/reports/claude-settings.md index 19b2c84..82e9c8e 100644 --- a/reports/claude-settings.md +++ b/reports/claude-settings.md @@ -48,6 +48,7 @@ Claude Code uses a 4-tier configuration hierarchy (highest to lowest priority): | `cleanupPeriodDays` | number | `30` | Sessions inactive longer than this are deleted at startup | | `autoUpdatesChannel` | string | `"latest"` | Release channel: `"stable"` or `"latest"` | | `alwaysThinkingEnabled` | boolean | `false` | Enable extended thinking by default for all sessions | +| `skipWebFetchPreflight` | boolean | `false` | Skip WebFetch blocklist check before fetching URLs | **Example:** ```json @@ -394,11 +395,15 @@ Configure bash command sandboxing for security. | `sandbox.autoAllowBashIfSandboxed` | boolean | `true` | Auto-approve bash when sandboxed | | `sandbox.excludedCommands` | array | `[]` | Commands to run outside sandbox | | `sandbox.allowUnsandboxedCommands` | boolean | `true` | Allow `dangerouslyDisableSandbox` | -| `sandbox.network.allowUnixSockets` | array | `[]` | Unix sockets accessible in sandbox | -| `sandbox.network.allowLocalBinding` | boolean | `false` | Allow binding to localhost ports (macOS) | -| `sandbox.network.httpProxyPort` | number | - | HTTP proxy port (custom proxy) | -| `sandbox.network.socksProxyPort` | number | - | SOCKS5 proxy port (custom proxy) | +| `sandbox.ignoreViolations` | object | `{}` | Map of command patterns to path arrays — suppress violation warnings | | `sandbox.enableWeakerNestedSandbox` | boolean | `false` | Weaker sandbox for Docker (reduces security) | +| `sandbox.network.allowUnixSockets` | array | `[]` | Specific Unix socket paths accessible in sandbox | +| `sandbox.network.allowAllUnixSockets` | boolean | `false` | Allow all Unix sockets (overrides allowUnixSockets) | +| `sandbox.network.allowLocalBinding` | boolean | `false` | Allow binding to localhost ports (macOS) | +| `sandbox.network.allowedDomains` | array | `[]` | Network domain allowlist for sandbox | +| `sandbox.network.deniedDomains` | array | `[]` | Network domain denylist for sandbox | +| `sandbox.network.httpProxyPort` | number | - | HTTP proxy port 1-65535 (custom proxy) | +| `sandbox.network.socksProxyPort` | number | - | SOCKS5 proxy port 1-65535 (custom proxy) | **Example:** ```json @@ -429,6 +434,9 @@ Configure Claude Code plugins and marketplaces. | `enabledPlugins` | object | Any | Enable/disable specific plugins | | `extraKnownMarketplaces` | object | Any | Add custom plugin marketplaces | | `strictKnownMarketplaces` | array | Managed only | Allowlist of permitted marketplaces | +| `skippedMarketplaces` | array | Any | Marketplaces user declined to install | +| `skippedPlugins` | array | Any | Plugins user declined to install | +| `pluginConfigs` | object | Any | Per-plugin MCP server configs (keyed by `plugin@marketplace`) | **Example:** ```json @@ -728,6 +736,7 @@ Set environment variables for all Claude Code sessions. ## Sources - [Claude Code Settings Documentation](https://code.claude.com/docs/en/settings) +- [Claude Code Settings JSON Schema](https://www.schemastore.org/claude-code-settings.json) - [Claude Code Configuration Guide](https://claudelog.com/configuration/) - [Claude Code GitHub Settings Examples](https://github.com/feiskyer/claude-code-settings) - [Eesel AI - Developer's Guide to settings.json](https://www.eesel.ai/blog/settings-json-claude-code)