Claude Terminal Commands
Reference Sheet
Use this page as a quick command launcher for Claude Code. Commands are ordered from the ones most people use first to the more specialized ones later. Each card shows the command name, what it does, and a full example you can copy directly with the button on the right. Replace any placeholder text like file names, prompts, paths, session names, or PR numbers before running it in your terminal.
Most Popular Claude CLI Commands
Start an interactive Claude Code session in the current project.
claude
Start Claude with an initial prompt already provided.
claude "give me an overview of this codebase"
Run a single prompt non-interactively, print the result, then exit.
claude -p "explain what this repository does"
Pipe file content into Claude for quick analysis or summarization.
cat build-error.txt | claude -p "concisely explain the root cause of this build error"
Continue the most recent conversation in the current directory.
claude --continue
Open the conversation picker or resume a named/session-specific conversation.
claude --resume auth-refactor
Start a session and give it a memorable name for easier resuming later.
claude -n auth-refactor
Return structured JSON output for scripting and automation workflows.
cat code.py | claude -p "analyze this code for bugs" --output-format json > analysis.json
Return plain text output explicitly for scripts and redirection.
cat data.txt | claude -p "summarize this data" --output-format text > summary.txt
Stream JSON events in real time while Claude processes the request.
cat log.txt | claude -p "parse this log file for errors" --output-format stream-json
Interactive Slash Commands
Show available slash commands inside an active Claude session.
/help
Generate a starter CLAUDE.md file for the current project.
/init
Switch to a different saved conversation from inside Claude.
/resume
Rename the current session so it is easier to find later.
/rename auth-refactor
Open Claude Code settings and configuration options.
/config
Review and adjust permission rules for tools and domains.
/permissions
Inspect or configure hooks tied to Claude Code lifecycle events.
/hooks
Run installation and environment diagnostics.
/doctor
Configure or inspect custom subagents.
/agents
Compact conversation context when a session becomes long.
/compact
Install, Setup, and Integrations
Install Claude Code with the recommended shell installer.
curl -fsSL https://claude.ai/install.sh | bash
Install Claude Code on macOS with Homebrew stable channel.
brew install --cask claude-code
Install Claude Code from PowerShell.
irm https://claude.ai/install.ps1 | iex
Install Claude Code from Command Prompt.
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Connect an MCP server so Claude can use external tools and data sources.
claude mcp add my-server -- npx -y @modelcontextprotocol/server-filesystem /path/to/project
Popular Workflow Examples
Start Claude and ask for a high-level architectural summary.
claude "give me an overview of this codebase and identify the main architecture patterns"
Ask Claude to locate files relevant to a feature area.
claude "find the files that handle user authentication and explain how they work together"
Continue a prior session and give a precise next task.
claude --continue -p "check for type errors introduced by the latest changes"
Resume work associated with a specific pull request number.
claude --from-pr 123
Use Claude as a scripted lint/review step inside package.json.
"lint:claude": "claude -p 'you are a linter. please look at the changes vs. main and report any issues related to typos. report the filename and line number on one line, and a description of the issue on the second line. do not return any other text.'"