Claude Code 2.1 Power User Guide
Terminal-first agentic coding from Anthropic. Built for developers who already use Kilo Code, Kiro.dev, or Antigravity.
What This Guide Covers
Quick Start
Full Installation Steps
-
1.
Install Node.js 18+
Required runtime. Download from nodejs.org
-
2.
Install Claude Code globallynpm install -g @anthropic-ai/claude-code
-
3.
Navigate to your project & launchcd your-project && claude
-
4.
Authenticate
Browser opens automatically. Log in with your Anthropic account (Pro subscription required).
-
5.
Start coding!
Type your task or use
/helpto see commands.
npm update -g @anthropic-ai/claude-code
TUI vs IDE: When to Use What
Claude Code's terminal-first approach vs traditional IDE agents — pick the right tool:
Terminal (Claude Code) Wins
- Multi-file refactors — renames, migrations, bulk updates
- Background tasks — tests, builds, monitoring while you work
-
Git workflows —
!gitintegration, automated commits/PRs - SSH/Remote dev — works anywhere you have a terminal
- Sub-agents — parallel tasks, code review without context pollution
- MCP ecosystem — browser, database, API integrations
IDE Agent (Kilo/Kiro/Antigravity) Wins
- Visual diff review — inline changes, side-by-side compare
- Single-file edits — quick fixes in current context
- Debugger integration — breakpoints, variable inspection
- TypeScript/LSP context — deep symbol understanding
- Selective accept — cherry-pick individual changes
- Familiar UI — less learning curve if IDE-native
IDE Agent Mapping
Translation from your existing workflows:
| Concept | Kilo/Kiro/Antigravity | Claude Code |
|---|---|---|
| Workspace Rules | .kilorc, .kiro/rules |
CLAUDE.md (project root) |
| Global Rules | Settings/Config files | ~/.claude/CLAUDE.md |
| Spec-Driven Dev | Kiro specs, PRD files | Plan Mode + markdown specs |
| MCP Servers | Extension settings | .claude/settings.json |
| Tool Permissions | Per-session approvals | --allowedTools, --dangerously-skip-permissions |
| Usage Tracking | Antigravity Cockpit | /cost, CUStats extension |
| Background Tasks | N/A | claude --background |
Task Tiers Strategy Boris Cherny's Approach
Categorize tasks to choose the right workflow:
Easy Tasks
One-shotBug fixes, small refactors, docs updates
Medium Tasks
IterativeNew features, API integrations, component work
Hard Tasks
Multi-phaseArchitecture changes, complex systems, greenfield projects
spec.md with phases
Plan Mode to refine
Plan Mode Mastery
Forces Claude to think through the problem multiple times and outline a technical strategy before writing any code.
PRD-First Workflow
Example Spec Template
# Feature: [Name]
## Goal
What problem does this solve?
## Success Criteria
- [ ] Criterion 1
- [ ] Criterion 2
## Technical Approach
### Phase 1: Foundation
- Setup, scaffolding, types
### Phase 2: Core Logic
- Main implementation
### Phase 3: Polish
- Error handling, tests, docs
## Non-Goals
What we're NOT building
Memory System
Three-tier memory hierarchy (like workspace rules in IDE agents):
~/.claude/CLAUDE.md
Global
Your personal preferences, coding style, global rules across all projects
./CLAUDE.md
Project Root
Project-specific context, architecture decisions, team conventions. Commit this!
./folder/CLAUDE.md
Subdirectory
Nested overrides for specific modules or packages
Example CLAUDE.md for Experienced Dev
# Project Context
## Architecture
- Monorepo with pnpm workspaces
- TypeScript strict mode
- React 19 + TanStack Query
## Conventions
- Use `type` over `interface`
- Barrel exports in index.ts
- Error boundaries per route
## Testing
- Vitest for unit tests
- Playwright for E2E
- Test files co-located with source
## Commands
- `pnpm dev` - Start dev server
- `pnpm test` - Run tests
- `pnpm lint` - ESLint + Prettier
## Don't
- No `any` types without comment
- No console.log in production
- No direct DOM manipulation in React
/memory
- Quick save to CLAUDE.md
Use during conversations: "Remember that we use Zod for validation" → automatically appends to memory file
Boris Cherny's Workflow Creator's Setup
Now that you understand the core concepts, here's how Claude Code's creator actually uses it. Step-by-step guide to replicate his exact setup:
1 Set Up Folder Structure
2 Create Your CLAUDE.md (Boris's Template)
# Project: [Name]
## Tech Stack
- Language: TypeScript
- Framework: Next.js 14
- Database: PostgreSQL + Prisma
- Testing: Vitest, Playwright
## Project Structure
src/
├── app/ # Next.js app router
├── components/ # React components
├── lib/ # Shared utilities
└── server/ # API routes
## Code Conventions
- Use functional components with hooks
- Prefer `type` over `interface`
- Use absolute imports (@/)
- Co-locate tests with source files
## Common Commands
- `pnpm dev` - Start dev server
- `pnpm test` - Run unit tests
- `pnpm lint` - ESLint + Prettier
## Development Workflow
1. Create feature branch from main
2. Write tests first (TDD preferred)
3. Run lint before committing
4. Use conventional commits
## Things to Remember
- Auth uses NextAuth with GitHub provider
- All API routes need rate limiting
- Images served via Cloudinary
## Do NOT
- Use `any` type without justification
- Commit without running tests
- Use npm (we use pnpm)
- Push directly to main
3 Add Boris's Essential Custom Commands
.claude/commands/git-push.md
Check git status and diff.
Create a conventional commit message based on changes.
Push to the current branch.
If remote branch doesn't exist, create it.
.claude/commands/pr.md
Create a pull request for the current branch.
Generate title from branch name and commits.
Write a detailed description with:
- What changed
- Why it changed
- How to test
Use `gh pr create` command.
.claude/commands/review.md
Review the staged changes for:
- Bugs and logic errors
- Security vulnerabilities
- Performance issues
- Code style violations
Be concise. Only flag real issues.
4 Adopt Boris's Key Habits
- Always use Plan Mode for medium+ tasks (Shift+Tab before prompting)
- Keep CLAUDE.md updated — treat it as living documentation the whole team edits
-
Use
!prefix for quick bash commands (e.g.,!git status) — output feeds into context - Spawn sub-agents for code review to keep main context focused
- Use @claude on GitHub for simple one-shot tasks (bugs, deps, docs)
Claude Skills New in 2.1
Skills are reusable, modular capabilities that extend Claude Code. Think of them as plugins for your AI agent — they auto-load based on context and can spawn sub-agents for parallel work.
Skills vs MCP Servers vs Custom Commands
| Feature | Custom Commands | MCP Servers | Skills |
|---|---|---|---|
| Invocation | Manual (/command) |
Manual (tools) | Auto or manual |
| Context | Main agent | Main agent | Can fork sub-agents |
| Hot reload | Yes | Restart needed | Yes (2.1+) |
| Async | No | No | Yes (--async) |
| Marketplace | No | Community repos | Official + community |
Getting Started with Skills
Recommended Skills
Automated commits, PRs, and branch management with conventional commit messages.
claude plugin install git-workflow
Auto-generates unit tests for your code. Supports Jest, Vitest, Pytest.
claude plugin install test-generator
Generates JSDoc, TypeDoc, or markdown documentation from your codebase.
claude plugin install docs-writer
Scans for vulnerabilities, outdated deps, and security anti-patterns.
claude plugin install security-audit
Database migration helper for Prisma, Drizzle, TypeORM schemas.
claude plugin install db-migrate
Intelligent refactoring suggestions with safe multi-file updates.
claude plugin install refactor-assist
Creating Your Own Skill
Skills are markdown files with YAML frontmatter in .claude/skills/:
# .claude/skills/my-deploy.md
---
name: deploy-preview
description: Deploy to preview environment
context: fork # Runs in isolated sub-agent
model: sonnet # Use faster model
hooks:
post-tool-use: notify-slack
---
## Instructions
1. Run the build command: `pnpm build`
2. Deploy to Vercel preview: `vercel --prebuilt`
3. Return the preview URL
4. Post to #deploys Slack channel
context: fork run in isolated sub-agents. This means a long-running security audit won't pollute your main conversation context — perfect for parallel workflows.
Sub-Agents & Background Tasks New in 2.1
Forked Sub-Agents
Spawn isolated sub-agents with context: fork in skill frontmatter. Parallel execution without polluting main context.
Main ("Mama Claude") orchestrates, sub-agents execute
Async Background Agents
Long-running tasks via --background or Ctrl+B. Continue working while they run.
Ideal for monitoring logs, builds, migrations
/teleport
New
Move your terminal session to Claude Desktop or web UI for complex visualization or collaboration.
Custom Slash Commands
Define reusable workflows in .claude/commands/ — auto hot-reloads (no restart needed)
.claude/commands/commit-push-pr.md
Check git status and diff.
Create a conventional commit message.
Push to origin.
Create a PR with a descriptive title and body.
Use gh cli for PR creation.
/commit-push-pr
— automates entire git flow
More Command Examples (Copy & Use)
/review
→ .claude/commands/review.md
Review staged changes for bugs, security issues, and style.
Be concise. Only flag real issues worth fixing.
/test $ARGUMENTS
→ .claude/commands/test.md
Generate comprehensive unit tests for: $ARGUMENTS
Use the project's testing framework (check package.json).
Include edge cases and error scenarios.
Co-locate tests with source files.
Usage: /test src/utils/parser.ts
/explain
→ .claude/commands/explain.md
Explain the current file or selection in detail.
Cover: purpose, key functions, data flow, gotchas.
Assume reader is senior dev unfamiliar with this codebase.
/fix-lint
→ .claude/commands/fix-lint.md
Run linter, capture errors, and fix them:
!pnpm lint 2>&1
Fix each error. Re-run lint to verify.
Note the ! prefix for inline bash
/migrate $ARGUMENTS
→ .claude/commands/migrate.md
Create a database migration for: $ARGUMENTS
Use Prisma/Drizzle based on project setup.
Generate migration file and update schema.
!pnpm prisma migrate dev --name $ARGUMENTS
! prefix in your command files to run shell commands. Example: !git status runs git and Claude sees the output. Chain with && or pipes.
MCP Server Integration
Configure in .claude/settings.json (project) or ~/.claude/settings.json (global)
Example MCP Configuration
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@anthropic/context7-mcp"]
},
"browser": {
"command": "npx",
"args": ["-y", "@anthropic/browser-mcp"]
},
"filesystem": {
"command": "npx",
"args": ["-y", "@anthropic/filesystem-mcp", "/path/to/allowed"]
}
}
}
Recommended MCPs
- Context7 (docs lookup)
- Browser (web automation)
- Filesystem (extended access)
- GitHub (repo operations)
MCP Commands
claude mcp listclaude mcp add [name]claude mcp remove [name]/mcp(in session)
Hooks System New in 2.1
Run custom scripts at specific lifecycle points:
PreToolUse
Before any tool executes (validation, logging)
PostToolUse
After tool completes (formatting, notifications)
Stop
When agent completes (cleanup, reporting)
Notification
Custom notification routing
Example: Auto-lint on File Write
// .claude/settings.json
{
"hooks": {
"PostToolUse": [{
"matcher": "Write|Edit",
"hooks": [{
"type": "command",
"command": "pnpm lint --fix $CLAUDE_FILE_PATH"
}]
}]
}
}
VSCode Extension
The official VSCode extension embeds Claude Code inside your editor, not as a chat sidebar but as an integrated terminal experience.
When to Use What
Terminal (Standalone)
- • Large refactors spanning many files
- • Background tasks
- • When you want full terminal power
- • Running alongside any editor
VSCode Extension
- • Quick edits while coding
- • File-context aware prompts
- • Inline diff viewing
- • Seamless editor integration
Chrome Extension Beta
Native browser integration allows Claude to navigate, inspect, and interact with web apps directly from the terminal.
Capabilities
- Screenshot & analyze UI
- Access DevTools console
- Click, type, navigate
- Use existing session cookies
Use Cases
- • E2E debugging with live UI
- • Testing auth flows
- • Scraping data during dev
- • Visual regression feedback
Record Custom Skills (Workflow Automation)
Record multi-step browser workflows by screen capture. Claude captures screenshots and DOM interactions to generate reusable /commands.
GitHub Integration
@Claude GitHub App
Tag @claude in issues or PRs for one-shot tasks:
Issue comment:
"@claude fix the TypeScript error in src/utils.ts and create a PR"
GitHub Action Setup Steps
-
1.
Install the Claude GitHub App
Go to github.com/apps/claude and install on your repo
-
2.
Add API key to repository secrets
Settings → Secrets → Actions → New secret:
ANTHROPIC_API_KEY -
3.
Create workflow file
Add
.github/workflows/claude.yml:name: Claude Code Action on: issue_comment: types: [created] pull_request_review_comment: types: [created] jobs: claude: if: contains(github.event.comment.body, '@claude') runs-on: ubuntu-latest permissions: contents: write pull-requests: write issues: write steps: - uses: actions/checkout@v4 - uses: anthropics/claude-code-action@v1 with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} -
4.
Start using!
Comment
@claude [your request]on any issue or PR
Best For
- Bug fixes from issues
- Dependency updates
- Documentation fixes
- Simple feature additions
Limitations
- No interactive iteration
- Limited context window
- Can't run local tests
- One-shot only
Model Selection
Claude Opus 4.5
RecommendedBest for complex coding, architecture, multi-file operations
Claude Sonnet 4
DefaultFast, capable, good balance for most tasks
Claude Haiku
BudgetQuick lookups, simple tasks, preserving quota
/model
Switch models mid-session
Start complex tasks with Opus, switch to Sonnet for iterations
Usage Tracking
Built-in Tracking
/cost
View current session cost & token usage
/status
Check connection & rate limit status
CUStats - Community Usage Tracker
Browser extension that tracks your Claude Pro usage across all interfaces.
custats.infoUnderstanding the 5-Hour Window
Claude Pro uses a rolling 5-hour window for rate limits. Heavy Opus usage can trigger cooldowns.
Antigravity Cockpit Auto-Wake (for comparison)
If you're familiar with Antigravity's auto-wake feature:
- • You set a wake time (e.g., 6 AM) before your work starts (e.g., 9 AM)
- • Extension pings the LLM with "hi" at 6 AM
- • The 5-hour window starts at 6 AM and resets at 11 AM
- • You get fresh quota when you actually start working
Claude Code alternative: No built-in auto-wake yet. Workaround: open Claude Code briefly in the morning with a simple prompt, then close. Check CUStats to monitor when your window resets.
Pro Subscription Optimization
Strategic Model Switching
Start with Opus for planning and architecture. Switch to Sonnet for implementation iterations. Use Haiku for quick lookups.
Compact Context
Use /compact to summarize long conversations. Reduces token count while preserving key context.
Pre-allow Tools
Use --allowedTools to skip permission prompts. Saves tokens on approval messages.
Use ! for Bash
Drop into bash mode with ! prefix for quick commands. Results feed back into context without extra prompts.
Resume Sessions
Use claude --resume to continue previous sessions without rebuilding context.
Keyboard Shortcuts
Slash Commands Reference
Built-in commands — type / to see autocomplete
/help
Show all available commands
/model
Switch AI model → /model opus for complex tasks
/memory
Save to CLAUDE.md → /memory We use Zod for validation
/compact
Summarize long conversation to save tokens
/clear
Fresh start — clears conversation history
/cost
Check token usage — run often to avoid rate limits
/status
Connection health + rate limit status
/teleport
Move to Desktop/web UI New
/mcp
List connected MCP servers
/config
Open settings (verbosity, permissions, etc.)
/bug
Report issue to Anthropic
Common Workflows
/memory API rate limit is 100 req/min
/model opus
then describe complex task
/cost
→ switch to sonnet if high
/compact
→ keeps key context, drops noise
CLI Flags Reference
--model [model]
Specify model (opus, sonnet, haiku)
--resume
Continue previous session
--print
Output only, no interactive session
--background
Run as background agent
--allowedTools "[tools]"
Pre-approve specific tools
--dangerously-skip-permissions
Skip all permission prompts ⚠️
--verbose
Show detailed logging
--version
Show version number
Community Tools Third-Party
Useful community-built extensions and integrations (not official Anthropic products):
Zed IDE + Claude Code
Official IntegrationZed has native Claude Code integration via ACP (Agent Communication Protocol). Provides a visual IDE experience while using Claude Code's agentic capabilities.
Claude Canvas
Community PluginTUI toolkit that gives Claude Code rich terminal interfaces. Spawns tmux panes for interactive UIs like calendars, email drafts, and flight bookings.
Search "Claude Canvas TUI" for community implementations
CUStats
Browser ExtensionTracks Claude Pro usage across web interface. Shows remaining quota, usage history, and cooldown timers.
custats.infoResources & Documentation
Official Anthropic
-
Claude Code Documentation
Official setup, commands, and configuration
-
Best Practices Guide
Anthropic's recommended workflows
-
Memory & CLAUDE.md
Context persistence deep dive
-
MCP Server Setup
Model Context Protocol integration
Video Guides
-
Claude Code Deep Dive
Comprehensive walkthrough (recommended)
-
Agentic Coding with Boris Cherny
Creator's workflow and philosophy
-
Boris's Setup Walkthrough
CLAUDE.md and commands in detail
-
Claude Code 2.1 Features
New features: sub-agents, skills, canvas