/helpView commands, flags, and help entry points supported by the current version.
AI Programming Quick Reference
Covers the main categories of the Claude Code reference, plus common Codex entry points. Commands may vary slightly between versions — always check the terminal help for accuracy.
Session, context, review, background tasks, extension management, and workflow entry points.
/helpView commands, flags, and help entry points supported by the current version.
/clearClear the current session context, suitable for starting fresh on a new question.
/compactCompact long session history, retain key summaries, reduce context pressure.
/contextView or declare the files, directories, and background to focus on for this turn.
/context read README, CLAUDE.md, package.json first/diffView file changes for this turn, useful for verifying the scope of changes before committing.
/modelView or switch models, useful for trading off between speed and reasoning intensity.
/costView the token count and estimated cost for the current session.
/statusView login status, project path, model, permissions, and runtime environment.
/cdSwitch working directory so subsequent commands run in the specified project.
/cd apps/web/doctorCheck if CLI, permissions, dependencies, network, and project configuration are working correctly.
/initInitialize project documentation, generate or update CLAUDE.md.
/memoryView, edit, or refresh long-term memory and project memory.
/reviewEnter code review mode, focusing on risks, regressions, and test gaps.
/permissionsView or adjust permission policies for tool calls, file writes, command execution, etc.
/configOpen the configuration entry point to modify model, permissions, output, and project settings.
/loginLog in or switch accounts to restore authorization and subscription status.
/branchCreate or switch to an isolated branch, suitable for experimental changes.
/rewindRoll back to an earlier conversation checkpoint and choose a different implementation path.
/resumeResume a historical session to continue an unfinished task.
/renameRename the current session for easier retrieval in history.
/exportExport session content, changes, or summaries for review and handover.
/effortAdjust reasoning intensity; increase for complex design and review tasks.
/effort high/planPlan before executing, suitable for high-risk, multi-file, or unclear requirements tasks.
/btwInsert side-channel information so the assistant remembers supplementary constraints without interrupting the current task.
/batchExecute similar tasks in batches, e.g., batch review, batch document updates.
/batch review every package README/loopPeriodically execute check tasks, suitable for monitoring logs, CI, or local services.
/loop 5m npm test/scheduleSchedule timed tasks or reminders so the assistant continues processing at a specified time.
/workflowsView or run preset workflows, chaining multiple operations together.
/deep-researchEnter deep research mode, suitable for finding information, comparing solutions, and writing reports.
/debugDebug following the 'Reproduce, Locate, Fix, Verify' rhythm.
/code-reviewStructured code review for PRs or local diffs.
/simplifyAsk the assistant to reduce complexity, compress abstraction and repetitive logic.
/security-reviewPerform security checks around permissions, injection, keys, supply chain, and data leaks.
/agentsView, select, or manage available subagents.
/mcpView MCP servers, tools, and connection status.
/pluginBrowse, install, or manage Plugins.
/reload-pluginsReload local Plugins, commonly used when debugging Plugins.
/goalSet the current session goal and budget, giving long tasks a clear endpoint.
/recapGenerate a brief progress and next-step summary for the current session.
/less-permission-promptsReduce the frequency of permission confirmations, suitable for high-trust local projects.
/tuiSwitch or view terminal interaction interface settings.
/focusNarrow the context scope so the assistant focuses on the current file or task.
/sandboxView or adjust sandbox policies to control command and file system access.
/usage-creditsView quota, usage, or subscription information.
/plugin DiscoverGo to the Plugins discovery page to find installable extensions.
/plugin BrowseBrowse installed Plugins and available commands.
High-frequency keys for terminal sessions, input, history, sidebar, and mode switching.
Shift+TabSwitch between plan mode, auto-edit, or normal input interaction modes.
Option+T / Alt+TSwitch theme or terminal display style.
Ctrl+CInterrupt the current output or ongoing operation.
Ctrl+DExit the current interactive session.
Ctrl+BShow or hide the sidebar.
Ctrl+OOpen the context, file, or command selector.
Ctrl+RSearch command history or session history.
Ctrl+GOpen goal, task, or session navigation.
Ctrl+KClear the input line or open the search entry point, depending on the terminal version.
EscCancel current input, close popover, or exit selection state.
↑ / ↓Browse input history and candidates.
TabComplete commands, file paths, or candidates.
Non-interactive calls, model selection, output format, permissions, session recovery, and Plugins loading.
claude -p "prompt"Execute a prompt once in non-interactive mode, suitable for scripts and CI.
claude -p "summarize this diff"--output-format jsonOutput results in JSON, for easy script parsing.
claude -p "review" --output-format json--output-format stream-jsonStream JSON events, suitable for long tasks and real-time UIs.
--model <name>Specify the model name.
claude --model sonnet--permission-mode <mode>Specify Permission Modes, e.g., default, plan, auto-accept edits, or bypass permissions.
--sandboxEnable sandboxed execution to restrict command and file system side effects.
--safe-modeRun in a more conservative mode, suitable for untrusted projects or demo environments.
--max-turns <n>Limit maximum turns to avoid infinite loops in script tasks.
--no-session-persistenceDon't save this session state, suitable for temporary batch processing.
--resumeResume a specified or the most recent historical session.
--continueContinue the most recent session.
--agent <name>Specify a subagent to execute tasks.
claude --agent code-reviewer--plugin-dir <path>Load plugins from the specified directory.
claude --plugin-dir ./plugins--plugin-url <url>Install or load plugins from a URL.
--bareStart in a more lightweight mode, without loading some project decorators and additional context.
--worktreeRun in an isolated worktree, isolating experimental changes.
--dangerously-skip-permissionsSkip permission confirmations; only use in fully trusted isolated environments.
--add-dir <path>Add extra directories to the readable context.
claude --add-dir ../shared--mcp-config <file>Specify an MCP config file.
claude --mcp-config .mcp.json--channels <plugin>Enable channels provided by plugins or extensions.
claude auth loginLog in to an account or refresh authorization.
claude project purge [path]Clean up project-level cache, sessions, or index data.
claude agentsList available subagents.
claude agents --jsonOutput the subagent list in JSON format.
claude plugin details <name>View plugin details, commands, and capability descriptions.
claude plugin enable <name>Enable an installed plugin.
claude plugin disable <name>Disable an installed plugin.
Project instructions, personal preferences, local private settings, skills, agents, and MCP config.
CLAUDE.mdProject-level instructions: write project structure, commands, constraints, and collaboration rules.
CLAUDE.local.mdMachine-private project notes, suitable for personal paths and temporary preferences.
.claude/settings.jsonShared project settings, can be committed to the repository.
.claude/settings.local.jsonMachine-private settings, usually not committed.
~/.claude/CLAUDE.mdGlobal personal instructions, effective across projects.
~/.claude/settings.jsonGlobal settings, suitable for default models and personal preferences.
.claude/skills/Project skills directory, for encapsulating reusable workflows and domain knowledge.
.claude/agents/Project subagents directory, for defining roles like review, testing, and writing.
.claude/rules/*.mdSplit rules files, for maintaining project constraints by topic.
.mcp.jsonProject MCP server configuration.
~/.claude.jsonUser-level state and global metadata file.
Connect external capabilities like databases, browsers, GitHub, and documentation systems into the terminal assistant.
claude mcp add <name> <uri>Add an MCP server.
claude mcp add browser http://localhost:3000claude mcp add --headerAdd an MCP server with authentication headers.
claude mcp listList configured MCP servers.
claude mcp get <name>View details of a specific MCP server.
claude mcp remove <name>Remove an MCP server.
claude mcp add-from-claude-desktopImport MCP configuration from the desktop app.
/mcpView MCP connection status and available tools within a session.
mcp__server__toolMCP tool naming format, typically a 'server + tool' combination.
Insert automated actions on tool calls, user input, stop, subagent start and stop events.
PreToolUseTriggers before tool execution, suitable for intercepting dangerous commands or supplementing audits.
PostToolUseTriggers after tool execution, suitable for formatting, logging, and syncing state.
UserPromptSubmitTriggers when the user submits a prompt; can inject context or perform compliance checks.
StopTriggers when the main session stops, suitable for summarizing, notifying, or cleaning up resources.
SubagentStartTriggers when a subagent starts, suitable for preparing isolated directories or environment variables.
SubagentStopTriggers when a subagent stops, suitable for collecting results and cleaning up temporary files.
Hook typesHook type determines trigger timing.
Hook matchersMatchers determine which tools, commands, or contexts trigger the hook.
Hook args (exec form)Receives input as command arguments, suitable for calling scripts.
Skill-level hooksHooks declared within Skills, only active when the Skill is in use.
Stop input fieldsStop event input fields, can be used to read session state and last output.
SubagentStop input fieldsSubagent stop event input fields, for reading agent name, status, and artifacts.
Control boundaries for file read/write, command execution, network access, and auto-accept edits.
defaultDefault mode, key operations require confirmation.
planPlan mode, only discuss approaches, don't modify files directly.
acceptEditsAuto-accept file edits, but high-risk commands may still require confirmation.
autoMore proactively executes routine tool calls, suitable for low-risk tasks.
bypassPermissionsBypass permission confirmations, only suitable for trusted isolated environments.
Allow patternsAllow specific commands, paths, or tool patterns.
Deny patternsDeny specific commands, paths, or tool patterns.
sandbox rulesUse sandbox boundaries to restrict process, network, and file system access.
Delegate review, research, testing, documentation and other tasks to specialized roles.
@"agent-name"Call a specific subagent by name in the conversation.
@"code-reviewer" review this diffclaude --agent <name>Specify the default subagent at startup.
.claude/agents/*.mdProject subagent definition file.
Built-in agentsBuilt-in agents, typically covering review, research, implementation, and testing scenarios.
isolation: worktreeLet subagents work in isolated worktrees to reduce interference.
background: trueAllow subagents to run in the background while the main session continues other tasks.
/agentsView, select, and manage available subagents.
Install commands, skills, MCP, app connectors, and internal team extensions.
/plugin install <name>Install plugins from a plugin source.
/plugin install github:user/repoInstall plugins from a GitHub repository.
/plugin listList installed plugins.
/reload-pluginsReload local plugins without restarting the CLI during debugging.
claude --plugin-dir ./pathLoad local plugin directory at startup.
.claude-plugin/plugin.jsonPlugin manifest file declaring name, version, commands, and capabilities.
plugin-name:commandPlugin command naming convention to avoid conflicts with system commands.
Plugin marketplacePlugin marketplace or discovery page for finding team and community extensions.
Model, session, output, updates, safety mode, and provider API keys.
ANTHROPIC_API_KEYAnthropic API key.
OPENAI_API_KEYOpenAI or compatible gateway key.
DEEPSEEK_API_KEYDeepSeek or compatible model provider key.
CLAUDE_EFFORTDefault reasoning intensity.
CLAUDE_CODE_SESSION_IDCurrent session ID, useful for log correlation.
CLAUDE_CODE_DISABLE_ALTERNATE_SCREENDisable terminal alternate screen for easier copying of historical output.
CLAUDE_CODE_FORCE_SYNC_OUTPUTForce synchronous output, suitable for scripts and log collection.
CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATEControl package manager automatic update behavior.
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERYEnable gateway model discovery.
CLAUDE_CODE_HIDE_CWDHide the current working directory, suitable for screen recording or public demos.
CLAUDE_CODE_SAFE_MODEEnable safety mode.
CLAUDE_CODE_DISABLE_BUNDLED_SKILLSDisable built-in skills, only use explicitly configured capabilities.
DISABLE_UPDATESDisable automatic update checks.
CLAUDE_CODE_USE_POWERSHELL_TOOLPrioritize PowerShell tools in Windows environments.
CLAUDE_CODE_DISABLE_WORKFLOWSDisable workflow capabilities.
Fine-grained control of worktrees, sandboxes, inheritance, cleanup cycles, and model scope.
worktree.baseRefBase branch or reference used when creating a worktree.
sandbox.bwrapPathSpecify the Linux bubblewrap sandbox path.
sandbox.socatPathSpecify the socat path for sandbox network bridging.
parentSettingsBehaviorControl whether parent directory settings are inherited.
cleanupPeriodDaysSet the cleanup cycle for cache, temporary data, or history.
prUrlTemplateConfigure PR link templates for jumping from the terminal to code hosting platforms.
disableBundledSkillsDisable built-in skills.
enforceAvailableModelsRestrict the selectable model range, suitable for team-wide cost and compliance policies.
footerLinksRegexesIdentify links in the terminal footer and provide navigation.
Combine commands into reusable paths, ideal for teaching, team standards, and daily development.
High-risk ChangesFirst increase reasoning intensity, then enter plan mode, implement after confirmation.
/effort high -> /plan -> approve -> implementPre-commit Self-checkFirst check diff, then check cost, export summary and compact context if necessary.
/diff -> /cost -> /export -> /compactBatch ReviewDelegate similar review tasks to batch processing commands.
/batch review all changed markdown filesLoop CheckPeriodically run tests, logs, or health checks.
/loop 5m npm testBranch ExperimentCreate a new branch for experiments, then merge or restore the main line upon success.
/branch -> experiment -> /resumeScript ReviewPipe diff to the CLI, output JSON for automated systems to read.
git diff | claude -p "review" --output-format jsonProject InitializationGenerate documentation, add rules, then commit to the repository.
/init -> edit CLAUDE.md -> commitDebug LoopReproduce, locate, add tests, fix, then run verification.
/debug -> add failing test -> fix -> /diffSupplements the most common entry points and configurations for Codex CLI and Codex projects.
AGENTS.mdCodex project instructions: write project commands, code standards, and collaboration constraints.
~/.codex/config.tomlCodex global config file, typically for model, sandbox, and approval policies.
.codex/Project or user-level Codex extensions directory, commonly for skills, plugins, and memory.
sandbox_modeControl the file system sandbox scope for Codex command execution.
approval_policyControl when Codex requires user approval for commands or network operations.
model_reasoning_effortSet reasoning intensity; increase for complex tasks.
codex --helpView commands and flags supported by the Codex CLI.
codex exec "<task>"Non-interactively execute a task once, suitable for automation scripts.
codex exec "review the current diff"/statusView the current model, directory, sandbox, permissions, and tool status.
/modelSwitch or view the model currently used by Codex.
/approvalsView or adjust the approval policy.
/reviewView current changes in code review mode.
/mcpView available MCP servers and tools for Codex.
/skillsView available skills and their trigger methods.
/compactCompress long session context and continue the current task.
OPENAI_API_KEY / DEEPSEEK_API_KEYCommonly used when connecting OpenAI-compatible or low-cost models like DeepSeek.