Claude Code Reference

v2.1.178 · 87 auto-discovered · Commands, shortcuts, hooks, Python/AWS tips.

Workflow Recipes

Real workflows by task. Copy-paste into terminal.

Code Review

Review a diff or PR before merging

git diff main | claude -p "review this"

Pipe diff directly — no file setup needed

gh pr diff 42 | claude -p "security issues only"

Focus on specific concern

claude -p "review src/auth/*.ts for OWASP issues"

Scope to folder

Debug Session

Investigate a bug with full repo context

claude

Open interactive — describe bug in plain language

cat error.log | claude -p "find the root cause"

Feed real error log

claude -c

Continue session after reviewing suggested fix

New Feature

Scaffold with repo context intact

claude --permission-mode plan

Plan first — no edits until you approve

claude -p "add user notifications to src/api"

One-shot scaffold

git diff --staged | claude -p "write a commit message"

Commit what was built

Refactor

Clean up code without breaking behavior

claude --permission-mode plan -p "refactor src/utils — keep exports stable"

Verify scope before any edits

claude -p "split this 300-line file into modules" src/big.ts

Scope to one file

npm test 2>&1 | claude -p "fix any regressions"

Feed test output to auto-fix

Docs

Generate or update docs from code

claude -p "write README for this project"

Reads actual code context

claude -p "add JSDoc to all exports in src/lib"

Batch doc generation

git diff main | claude -p "update CHANGELOG for this release"

Diff-driven changelog

Pipe & Analyze

Feed any output into Claude for instant analysis

npm run build 2>&1 | claude -p "fix the build errors"

Build errors → fix in one step

docker logs myapp | claude -p "find the crash cause"

Container log analysis

curl api.example.com/health | claude -p "anything wrong?"

API response inspection

Git Flow

Smart commits and PR descriptions

git diff --staged | claude -p "write a conventional commit message"

Staged diff → commit msg

claude -w feature-x

Isolated worktree — no stash juggling

gh pr diff | claude -p "write a PR description with test plan"

Auto PR description

MCP Tools

Connect external tools to your session

claude mcp add github -- npx @modelcontextprotocol/server-github

Add GitHub MCP tool

claude mcp list

See all connected tools

claude -p "open PR #42 and summarize the review comments"

GitHub tool active in session