Claude Code — AI Coding Agent
Complete guide to Claude Code, Anthropic's terminal-based AI coding agent. Covers installation, prompt engineering, configuration, CLAUDE.md patterns, and best practices.
Claude Code — AI Coding Agent

Claude Code is Anthropic's terminal-based AI coding agent. Unlike editor-embedded assistants, it runs directly in your terminal: it reads your codebase, writes and edits files, runs shell commands, and can autonomously complete multi-step engineering tasks end to end. You review its changes as it works, step by step.
It's built on Claude's models and designed around a prompt-first, agentic workflow — you describe the goal, it plans, executes, and reports. That makes it one of the most capable options for large, loosely-specified engineering tasks where an editor-assistant would struggle to keep context.
How Claude Code Works
Claude Code is a CLI tool that treats the terminal as the interface to your whole project:
- Project awareness — It scans your repository, reads relevant files on demand, and builds a working understanding of the codebase before making changes.
- Read-write-execute — It can create and edit files, run tests, execute commands, and iterate on failures until the task is complete.
- Permission model — You approve each category of action (file edits, command execution) once or per-action, so you stay in control of what it touches.
- CLAUDE.md conventions — A project-level memory file that tells Claude Code how your team works: architecture, style, and gotchas.
The result is a workflow that feels closer to pairing with a senior engineer than using autocomplete: you give direction, it handles the mechanics, and you review the outcome.
Core Features
- Extended thinking — Chain-of-thought reasoning that lets Claude plan complex multi-step tasks before acting.
- CLAUDE.md — Project-specific instructions and conventions that persist across sessions and shape every response.
- Subagents — Specialized background agents (e.g., a docs writer or test runner) that work in parallel on narrow tasks.
- Hook scripts — Automate actions around Claude Code: run formatters after edits, block dangerous commands, send notifications.
- MCP support — Full Model Context Protocol integration, so Claude Code can use your external MCP servers and tools.
- Checkpointing — Save and restore session states, so you can roll back a bad change or explore approaches safely.
Quick Start
# Install globally
npm install -g @anthropic-ai/claude-code
# Run in your project directory
claude
On first launch Claude Code walks you through authentication. Then:
- Run
claudein your project root and describe a task in plain English. - Let it plan — review its proposed approach before it starts editing.
- Watch it work, approving file edits and commands as they come up.
- When it hits a wall, give it feedback and let it iterate.
For a full walkthrough, see Getting Started with Claude Code.
Writing Effective Prompts
Claude Code responds to the same prompt discipline that works for any Claude model, amplified because it operates on your real codebase:
- State the goal, not the implementation — "Add rate limiting to the API layer" lets Claude choose the approach; dictating a specific library can force worse outcomes.
- Reference existing code — "Match the error-handling style in
utils/http.ts" produces consistent, idiomatic changes. - Set acceptance criteria — "Make the tests pass, add tests for the new path, and update the README" gives it a definition of done.
- Use CLAUDE.md for recurring context — Put stable facts (architecture, conventions, common pitfalls) there so you don't repeat them in every prompt.
For the full set of conventions, including extended thinking and prompt patterns, see Prompt Engineering with Claude Code.
Claude Code vs Cursor vs Copilot
| Feature | Claude Code | Cursor | GitHub Copilot |
|---|---|---|---|
| Interface | Terminal agent | VS Code fork | IDE extension + CLI |
| Autonomy | High (plans + executes) | Medium-high (agent mode) | Medium (agent mode) |
| Long-running tasks | ✓ (best-in-class context) | ✓ | ✓ |
| Subagents | ✓ | Partial | Partial |
| Custom rules | CLAUDE.md | .cursorrules | copilot-instructions.md |
| MCP support | ✓ | ✓ | ✓ |
| IDE required | No (pure terminal) | Yes | Yes (or CLI) |
Claude Code's edge is autonomy and context on large, complex codebases. Cursor wins on in-editor UX and visual review; Copilot wins on GitHub-native integration. Many teams pair Claude Code for deep agentic work with an IDE-based assistant for everyday editing.
Pricing
Claude Code is billed per-token through the Anthropic API, and is also included in Claude Pro and Max subscription plans for individual use. Enterprise teams typically provision it through Anthropic's managed offering or via API access with usage-based billing.
Frequently Asked Questions
Related Resources
- Getting Started — install, configure, and run your first session
- Prompt Engineering — CLAUDE.md conventions, extended thinking, and prompt patterns
- Configuration Reference — complete reference for CLAUDE.md, hooks, and settings
- Cost Optimization — cut Claude Code costs 70–95% with hooks, routing, and model selection
- Tool Comparison — Claude Code vs Cursor vs Copilot vs OpenCode
Related Articles
AI Coding Tools — Prompt Engineering & Configuration
Complete guides for Claude Code, OpenCode, Gemini CLI, Cursor, GitHub Copilot, and more. Tool-specific prompt patterns, configuration files, and setup guides for every major AI coding assistant.
Claude Code Cost Optimization
Cut Claude Code costs by 70-95% using shell scripts, provider switching, and task routing. When to use extended thinking vs cheap execution.
Claude Driving Gemini CLI with Ralph Loop Verification
Claude designs the approach, Gemini CLI executes with iterative self-verification via the Ralph loop. Split reasoning from execution across tools.