By Anthropic
Claude Code
AI coding assistant
/
Setup
Install Claude Code
Install Claude Code globally via npm
npm install -g @anthropic-ai/claude-codeRun without installing
Run Claude Code directly with npx
npx @anthropic-ai/claude-codeAuthenticate
Sign in to your Anthropic account
claude authBasics
Start session
Launch interactive Claude Code session
claudeShow help
Display available commands and options
claude --helpCheck version
Show installed Claude Code version
claude --versionInline prompt
Run a single prompt without interactive mode
claude "your prompt here"Code Operations
Review code
Get feedback on staged git changes
claude "review my staged changes"Explain code
Get detailed explanation of code
claude "explain this function"Write tests
Generate test cases for your code
claude "write tests for this module"Refactor code
Improve code structure and readability
claude "refactor this to be more readable"Fix bugs
Identify and fix issues in code
claude "fix the bug in this file"Git Integration
Generate commit
Create commit with AI-generated message
claude "commit these changes"Create PR
Generate pull request with description
claude "create a PR for these changes"Explain diff
Understand changes between commits
claude "explain what changed in this diff"MCP & Tools
List MCP servers
Show configured MCP servers
claude mcp listAdd MCP server
Configure a new MCP server
claude mcp add <name> <command>Advanced
Custom slash commands
Run custom slash commands from .claude/commands/
/project:commandPipe input
Pipe file contents to Claude
cat file.txt | claude "summarize this"Output to file
Save Claude output to file
claude "generate readme" > README.mdMCP Servers
Extend Claude with tools