Claude Code

Claude Code is Anthropic’s agentic coding tool. It runs in the terminal, reads your codebase, edits files, runs commands, and manages git - all through natural language.

What It Is

An AI agent that lives in your development environment. Unlike chat-based coding assistants that work on snippets, Claude Code operates on your actual project: reading files, searching code, making edits, running tests, and committing changes.

Available as:

  • Terminal CLI - npm install -g @anthropic-ai/claude-code, then claude in any project
  • VS Code extension - sidebar panel with inline diffs and code actions
  • Web - claude.ai/code for browser-based sessions

The Agent Loop

Claude Code follows the same pattern as every agentic system:

User prompt
    |
    v
+-------------------+
| Claude decides:   |
| - read a file?    |<--+
| - edit code?      |   |
| - run a command?  |   |
| - respond?        |   |
+-------------------+   |
    |                   |
    v                   |
+-------------------+   |
| Execute tool      |   |
| (Read, Edit,      |---+
|  Bash, Grep...)   |
+-------------------+
    |
    v
Final response to user

Claude receives your prompt, decides what action to take, executes it, observes the result, and repeats until it has a complete answer. A single prompt might trigger dozens of tool calls.

Built-in Tools

ToolPurpose
ReadRead file contents
EditMake targeted edits to files
WriteCreate new files
BashRun shell commands
GlobFind files by pattern
GrepSearch file contents
AgentSpawn subagents for parallel work
WebSearchSearch the web
WebFetchFetch web page content

Project Conventions

CLAUDE.md

The most important file for configuring Claude Code’s behavior in your project. Place it at the project root:

# Project Name

## Build & Test
- `npm run build` to build
- `npm test` to run tests

## Code Style
- Use TypeScript strict mode
- Prefer named exports over default exports

## Architecture
- src/api/ contains REST endpoints
- src/db/ contains database queries

Claude reads CLAUDE.md at the start of every session. It shapes how Claude approaches your codebase.

.claude/ Directory

.claude/
├── skills/           # Custom skills (SKILL.md files)
├── settings.json     # Permission rules, model preferences
└── settings.local.json  # Personal overrides (gitignored)

Permission Model

Claude Code asks before taking actions. You control the level of autonomy:

LevelRead filesEdit filesRun commands
DefaultAutoAsk first timeAsk always
AllowlistedAutoAuto (for allowed patterns)Auto (for allowed commands)
Full autonomyAutoAutoAuto

Configure in .claude/settings.json:

{
  "permissions": {
    "allow": [
      "Bash(npm test)",
      "Bash(npm run build)",
      "Edit"
    ]
  }
}

Wildcard patterns work: Bash(git *) allows all git commands. Bash(*-h*) allows any command with a help flag.

Three Interaction Modes

Terminal - most powerful, full tool access:

cd my-project
claude

VS Code - sidebar panel with inline diffs, code lens actions, and file-level suggestions.

Web (claude.ai/code) - browser-based sessions with the same agentic loop. Useful for working from any device.

Key Commands

CommandWhat it does
/helpShow available commands
/clearReset conversation context
/compactSummarize and compress context
Cmd+KTopic switcher (jump between tasks)
Esc EscUndo last change (checkpoint restore)
/rewindRewind to a specific checkpoint
/teleportContinue session at claude.ai/code

Next