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, thenclaudein 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
| Tool | Purpose |
|---|---|
| Read | Read file contents |
| Edit | Make targeted edits to files |
| Write | Create new files |
| Bash | Run shell commands |
| Glob | Find files by pattern |
| Grep | Search file contents |
| Agent | Spawn subagents for parallel work |
| WebSearch | Search the web |
| WebFetch | Fetch 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:
| Level | Read files | Edit files | Run commands |
|---|---|---|---|
| Default | Auto | Ask first time | Ask always |
| Allowlisted | Auto | Auto (for allowed patterns) | Auto (for allowed commands) |
| Full autonomy | Auto | Auto | Auto |
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
| Command | What it does |
|---|---|
/help | Show available commands |
/clear | Reset conversation context |
/compact | Summarize and compress context |
| Cmd+K | Topic switcher (jump between tasks) |
| Esc Esc | Undo last change (checkpoint restore) |
/rewind | Rewind to a specific checkpoint |
/teleport | Continue session at claude.ai/code |
Next
- Claude Code quickstart - install and configure
- Claude Code features - checkpoints, hooks, subagents, agent teams