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.

June 17, 2026
claude-codeanthropicai-codingterminal-agentsetup

Claude Code — AI Coding Agent

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:

  1. Run claude in your project root and describe a task in plain English.
  2. Let it plan — review its proposed approach before it starts editing.
  3. Watch it work, approving file edits and commands as they come up.
  4. 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

FeatureClaude CodeCursorGitHub Copilot
InterfaceTerminal agentVS Code forkIDE extension + CLI
AutonomyHigh (plans + executes)Medium-high (agent mode)Medium (agent mode)
Long-running tasks✓ (best-in-class context)
SubagentsPartialPartial
Custom rulesCLAUDE.md.cursorrulescopilot-instructions.md
MCP support
IDE requiredNo (pure terminal)YesYes (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