Claude Code
Anthropic's official AI coding agent with extended thinking, plugins, and subagents.
Key Features
See Claude's reasoning process in real-time. Watch as it analyzes code, considers options, and explains its approach before taking action.
Extend capabilities with plugins. Load specialized skills for frameworks, languages, or custom workflows.
Spawn specialized agents for focused tasks. Create a code reviewer, documentation writer, or test generator that runs in parallel.
Every user message creates a checkpoint. Undo file changes to any point in the conversation with a single action.
Setup
Installation
# Install Claude Code CLI
curl -fsSL https://claude.ai/install.sh | bash
# Verify installation
claude --versionAuthentication
Choose one authentication method:
# Add to your shell profile (~/.zshrc or ~/.bashrc)
export ANTHROPIC_API_KEY=sk-ant-your-key-here
# Then start the bridge
broski# Authenticate via browser
claude login
# Then start the bridge
broskiPermission Modes
Claude Code has different permission modes that control how it handles file edits and shell commands:
| Mode | File Edits | Shell Commands | Use Case |
|---|---|---|---|
default | Ask | Ask | Safe exploration, review each change |
acceptEdits | Auto-approve | Ask | Trust file changes, review commands |
plan | Blocked | Blocked | Read-only analysis, no modifications |
bypassPermissions | Auto-approve | Auto-approve | Full trust, automated workflows |
bypassPermissions only in trusted environments. The agent can execute any command without confirmation.Built-in Tools
| Tool | Description | Permission Required |
|---|---|---|
Read | Read file contents with optional line range | Safe |
Write | Create new files (requires prior read) | Approval |
Edit | String replacement in existing files | Approval |
Bash | Execute shell commands with timeout | Approval |
Glob | Find files matching pattern (e.g., **/*.ts) | Safe |
Grep | Regex search in file contents | Safe |
WebFetch | Fetch web page contents | Safe |
WebSearch | Search the web for documentation | Safe |
Task | Spawn subagents for parallel work | Safe |
TodoRead | Read current task list | Safe |
TodoWrite | Update task list | Safe |
Subagents
Define specialized agents for focused tasks in your project's .claude/ directory:
{
"agents": {
"code-reviewer": {
"description": "Expert code review focusing on security and best practices",
"prompt": "Review code for security vulnerabilities, performance issues, and best practices",
"tools": ["Read", "Grep", "Glob"],
"model": "sonnet"
},
"test-writer": {
"description": "Generate comprehensive test cases",
"prompt": "Write thorough unit and integration tests",
"tools": ["Read", "Write", "Glob"],
"model": "sonnet"
}
}
}MCP Configuration
Add MCP servers to extend Claude Code's capabilities:
{
"mcpServers": {
"filesystem": {
"type": "stdio",
"command": "npx",
"args": ["@modelcontextprotocol/server-filesystem"],
"env": {
"ALLOWED_PATHS": "/Users/me/projects"
}
},
"github": {
"type": "stdio",
"command": "npx",
"args": ["@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}mcp__filesystem__list_files. You can allow or block specific MCP tools in your settings.Session Storage
Claude Code stores sessions as JSONL files on your computer:
~/.claude/projects/[project-path-encoded]/[session-id].jsonl| Feature | Description |
|---|---|
| Resume | Continue any previous conversation |
| Fork | Branch from any message (creates new file) |
| Delete | Remove session files to free space |
| Transcript | Full history with tool calls and results |
Troubleshooting
Authentication Failures
ANTHROPIC_API_KEY is set or run claude login.# Check if API key is set
echo $ANTHROPIC_API_KEY
# If empty, add to your shell profile:
echo 'export ANTHROPIC_API_KEY=sk-ant-your-key' >> ~/.zshrc
source ~/.zshrc
# Or re-authenticate:
claude logout
claude loginRate Limiting
Check your usage at the Anthropic Console. Higher tier plans have increased rate limits.
Context Length
Start a new session or use the summarize feature to compact the conversation. Long sessions with many file operations can hit context limits.
Tool Permission Denied
{
"allowedTools": ["Read", "Write", "Edit", "Bash", "Glob", "Grep"],
"disallowedTools": []
}