Claude Code FAQ
22 answers from 6 months of daily practice: setup, pricing, security, hooks, agents, and more.
Getting Started
What is Claude Code and how does it work?
Claude Code is Anthropic's official CLI that brings Claude AI directly into your terminal. Unlike IDE plugins, it operates at the terminal level with full system access: reads your codebase, writes code, runs tests, and manages git workflows in a single session. An AI pair programmer that works where you work.
How do I install Claude Code?
Install globally via npm: npm install -g @anthropic-ai/claude-code. Requires Node.js 18+. Then run claude in any project directory to start. You'll need an API key from console.anthropic.com. See the cheatsheet for a quick reference.
What programming languages does Claude Code support?
Claude Code works with any programming language: it reads and writes files regardless of syntax. It's particularly strong with TypeScript, JavaScript, Python, Go, Rust, and Ruby. Community reports confirm effective use with Scala, Elixir, Swift, and even niche languages like Zig and Haskell.
Pricing & Costs
Is Claude Code free to use?
The CLI is free to install, but you pay per API token. Sonnet (default) costs ~$3/$15 per million input/output tokens. Opus costs ~$15/$75. For comparison: GitHub Copilot is $10/month flat, Cursor Pro is $20/month. Claude Code can cost $5-50/day for heavy usage without optimization strategies.
How can I reduce costs or avoid rate limits?
cc-copilot-bridge routes Claude Code through GitHub Copilot Pro+ ($10/month flat) instead of per-token billing, saving 99%+ on costs. It also supports offline mode via Ollama for air-gapped environments. Other strategies: use /compact to reduce context, prefer Sonnet over Opus for routine tasks, and use subagents to isolate expensive operations.
Features & Concepts
What is a CLAUDE.md file?
CLAUDE.md is a project memory file that gives Claude persistent context. Place it in your project root with tech stack, coding conventions, and build commands. Claude reads it automatically at session start. There are 3 levels: ~/.claude/CLAUDE.md (global), project root (team-shared), and .claude/CLAUDE.local.md (personal, gitignored). See our 199 templates for inspiration.
What are Claude Code hooks?
Hooks are shell commands that run automatically in response to Claude Code events: before/after tool calls, on notifications, or on session stop. Use cases: block dangerous commands (rm -rf, force-push), scan for secrets in outputs, enforce coding standards, or auto-format files. Configured in .claude/settings.json with PreToolUse, PostToolUse, Notification, and Stop events. The guide includes 31 production-ready hook templates.
What's the difference between agents, skills, and commands?
Agents are AI personas with specific expertise (code-reviewer, security-auditor) defined in .claude/agents/. Skills are reusable capability modules with bundled resources, invoked via /skill-name. Commands are simple slash-command templates in .claude/commands/ for repetitive tasks. Rule of thumb: commands for single-step ops, skills for multi-step workflows with context, agents for specialized review or analysis roles. See the features section for detailed comparison.
How do I manage the context window in Claude Code?
Context management is the #1 skill to master. At 70% usage, Claude starts losing precision. At 85%, hallucinations increase. At 90%+, responses become erratic. Strategy: 0-50% (work freely), 50-70% (stay focused), 70-85% (/compact to compress history), 90%+ (/clear mandatory). Monitor usage with /cost. Use subagents to offload heavy research without polluting your main context.
What are MCP servers in Claude Code?
MCP (Model Context Protocol) servers extend Claude's capabilities by connecting to external tools. Examples: Playwright for browser automation, Context7 for library docs, Sentry for error tracking, PostgreSQL for database queries. Configure in ~/.claude/mcp.json or .mcp.json per project. Always vet MCP servers before use. 19 CVEs have been identified in the ecosystem.
What's the difference between Claude Code and Cowork?
Claude Code is a terminal-based CLI for developers (code, scripts, git). Claude Cowork is a Desktop app for knowledge workers (Excel, Word, PDF, file organization). Same AI model underneath, different interfaces for different audiences. This guide covers Claude Code. See the Cowork Guide for the non-dev version.
Is Claude Code better than GitHub Copilot?
Both have agentic capabilities since early 2025. Claude Code excels at terminal-first workflows with native MCP protocol, CLAUDE.md project memory, Agent SDK for custom automation, and event hooks. Copilot integrates tightly with VS Code via Agent Mode. Many developers use both: Copilot for inline autocomplete, Claude Code for complex multi-file tasks. See our comparison table for a detailed breakdown.
AI Ecosystem
Which AI tools complement Claude Code?
Claude Code works best in an ecosystem: Perplexity for deep research with verified sources, Gemini for visual understanding (design → code), NotebookLM for document review and audio synthesis, v0/Bolt for rapid UI prototyping, Cursor/Copilot for inline autocomplete, and Wispr Flow for voice-to-text (4x faster than typing at 150 WPM). Chain them: Research (Perplexity) → Implement (Claude Code) → Deliver.
How do I use voice-to-text with Claude Code?
Tools like Wispr Flow or Superwhisper transcribe speech directly into the terminal at ~150 WPM (vs 40 WPM typing). This is particularly effective for writing detailed prompts and specifications. Setup is simple: install the app, select the terminal as input target, and dictate naturally.
Can Claude Code work offline or with local models?
Not natively. Claude Code requires Anthropic's API. However, cc-copilot-bridge enables offline mode via Ollama, running 100% locally with open-source models. Trade-off: local models are significantly less capable than Claude Sonnet/Opus for complex coding tasks, but work for basic operations in air-gapped environments.
Trust & Security
Is Claude Code secure for production use?
Claude Code requires careful hardening for production. This guide tracks 15 vulnerabilities and 655 malicious skills in the supply chain. Key risks: prompt injection via MCP servers, data exfiltration through tool calls, and code injection via malicious CLAUDE.md files. Mitigations: use hooks to block dangerous commands, vet all MCP servers with our 5-minute audit checklist, enable permission prompts, and never run in production environments without sandboxing.
Is my code sent to Anthropic?
Yes. Claude Code sends prompts and file contents to Anthropic's API servers. Default data retention is 5 years with training enabled. You can opt out via Settings to reduce retention to 30 days (no training). Enterprise plans offer 0-day retention. See Anthropic's official privacy documentation for details.
How much should I trust AI-generated code?
Research shows AI-assisted code can contain 1.75x more logic errors than human-written code (ACM 2025 study). Nuance: a 2-phase blind RCT (Borg et al., 2025, n=151 professional developers) found no significant difference in downstream maintainability — colleagues who evolve AI-generated code are not measurably slower than with human-written code. The quality risk is real but more narrowly scoped than often claimed. Trust calibration: auto-accept boilerplate and repetitive patterns, review business logic and non-trivial changes, manually verify security-critical code. Use TDD to catch errors early: write tests first, then let Claude implement.
About the Guide
Is this guide official?
No. This is an independent community resource based on 6 months of daily Claude Code usage. It is not affiliated with or endorsed by Anthropic. For official documentation, visit code.claude.com/docs.
What version of Claude Code is covered?
The guide is continuously updated to track the latest Claude Code releases. Check the CHANGELOG for recent updates and the releases section for version-specific feature tracking.
Who is behind this guide?
Florian Bruniaux, Founding Engineer at Méthode Aristote (EdTech + AI). 12 years in tech across Dev, Lead, Engineering Manager, VP Engineering, and CTO roles. Also creator of RTK (CLI token reduction), ccboard (Claude Code dashboard), and cc-copilot-bridge.
Can I contribute to the guide?
Yes! The guide is open-source (CC BY-SA 4.0) and welcomes contributions: corrections, new quiz questions, workflow templates, and resource evaluations. Check the contributing guide on GitHub for submission guidelines.