Master Claude Code: Install, Shortcuts, and Advanced Workflows
This guide walks you through installing Claude Code on multiple platforms, using its rich set of shortcut keys, configuring CLI parameters, managing agents and plugins, and applying advanced workflows such as plan mode, rewind, and Git worktree integration for efficient AI‑assisted development.
Installation
Claude Code can be installed on macOS/Linux, Homebrew, Windows PowerShell, or via npm (Node 18+): curl -fsSL https://claude.ai/install.sh – macOS/Linux brew install --cask claude-code – Homebrew irm https://claude.ai/install.ps1 – Windows PowerShell npm install -g @anthropic-ai/claude-code – npm
Basic CLI Commands
cd your-project && claude– start an interactive session in a project claude update – update to the latest version claude -c – continue the previous conversation claude "prompt" – start a session with an initial prompt claude -r <session-id> – resume a specific session claude -t – enable Git worktree mode
Shortcut Keys (interactive UI)
Enter – send / submit
Esc – interrupt generation
Esc Esc – open rewind UI
Ctrl C – open main menu
Ctrl R – open external editor / search history
Ctrl E – exit Claude Code
Shift Tab – toggle Auto‑Accept mode (cycle with Shift Tab Tab for Plan mode)
Ctrl L – toggle tool list
Ctrl \ – toggle side panel
Ctrl J / Ctrl V – paste image
Ctrl K – show prompt or delete after cursor
Ctrl A / Ctrl E – move to line start / end
Opt F / Opt B – word forward / backward
↑ / ↓ – browse command history
Shift F – model selector
Shift T – extend thinking
Ctrl Tab – run background task
Slash Commands
/clear– clear conversation history /compact – compress token usage /resume – resume a paused conversation /reset or /rewind – rollback to a previous code node or conversation state /cost – display token usage and estimated cost /rate-limits – show current rate limits /convert – visualise token stream /config – open settings panel /permissions – manage permission mode /vim – toggle Vim editing mode /init – create CLAUDE.md in the project /memory – edit the memory file /review – run code review /doctor – perform environment diagnostics /agents – list or manage sub‑agents /mcp – manage MCP (external tool) servers /tasks – list pending tasks
Permission Modes
Normal – each action requires confirmation (most secure)
Auto‑Accept – actions are executed automatically (fast)
Plan – only generate a plan; no code execution
Switch modes with Shift Tab (cycle: Normal → Auto‑Accept → Plan).
CLI Startup Parameters
--model sonnet|haiku|opus– select the Anthropic model --agent <name> – invoke a specific sub‑agent --permission-mode plan|auto|normal – set initial permission mode --max-turns N – limit the number of interaction turns --output-format text|json|stream-json – choose output serialization --allowedTools <list> – whitelist tools --disallowedTools <list> – blacklist tools --verbose – enable detailed logging --no-browser – disable automatic browser integration
Headless (non‑interactive) Mode
claude -p "query"– output result directly to stdout echo "fix bug" | claude -p --output-format json – pipe input and receive JSON response
Extensions System
Project‑level memory files: ~/CLAUDE.md or .claude/CLAUDE.md Global memory file: ~/.claude/CLAUDE.md Project slash‑commands directory: .claude/commands/ Global slash‑commands directory: ~/.claude/commands/ Built‑in tools: Bash, Read, Write (auto‑invoked)
Hook system: event‑driven automation (e.g., PostToolUse)
MCP server: external tool extensions
Sub‑Agents and Skills
Agents stored in .claude/agents/ (project) or ~/.claude/agents/ (global)
Skills stored in .claude/skills/ (project) or ~/.claude/skills/ (global)
MCP Server Management
claude mcp add <url>– add a server claude mcp list – list configured servers claude mcp remove <url> – remove a server
Git Worktree Integration
git worktree add <path> <branch>– create a new worktree for parallel development git worktree list – list existing worktrees git worktree remove <path> – delete a worktree
Use worktrees to develop features, hot‑fixes, or experiments without affecting the main branch.
Typical Project Workflow
Navigate to the project directory and start Claude Code: cd my-project && claude Initialize the project memory file: /init Press Shift Tab to enter Plan mode, review the generated plan, then switch to execution (Auto‑Accept or Normal mode).
Use slash commands (e.g., /review, /doctor) and shortcuts to iterate quickly.
Efficient Debugging
Paste an error stack trace; Claude Code will locate the problematic code.
Command example: cat error.log | claude -p "fix" returns a suggested fix.
Run background tasks with Ctrl Tab while continuing the main conversation.
Hook Configuration Example (JSON)
{
"PostToolUse": [{
"matcher": "Edit|Write",
"command": "npx prettier --write $FILE_PATH"
}]
}Configuration Files (priority order)
/etc/claude-code/managed-settings.json .claude/settings.json .claude/settings.local.json ~/.claude/settings.jsonRewind Options
Conversation Only – rollback only the dialogue.
Code – rollback only generated code.
Full Rewind – rollback both conversation and code.
Note: Checkpoints do not track external Bash changes; use Git for full traceability.
AI Architecture Hub
Focused on sharing high-quality AI content and practical implementation, helping people learn with fewer missteps and become stronger through AI.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
