An agentic coding tool that lives in your terminal, IDE, and browser
code.claude.com
1. Install
# macOS / Linux / WSL
curl -fsSL https://claude.ai/install.sh | bash
# Windows PowerShell
irm https://claude.ai/install.ps1 | iex
# Or via Homebrew / WinGet
brew install --cask claude-code
winget install Anthropic.ClaudeCode
2. Start in any project
cd your-project
claude
3. Log in on first use — that's it!
claude --version # check your version
claude --help # see all flags
Requires a Claude subscription or Anthropic Console account.
Claude works in a continuous loop: gather context, take action, verify results — repeating until done.
You can interrupt and steer at any point in the loop.
File Operations
Read Edit Write Glob
Read, create, rename, and edit files
Search
Grep Glob Agent
Find files by pattern, search with regex
Execution
Bash
Run shell commands, tests, git, builds
Web
WebSearch WebFetch
Search the web, fetch documentation
Claude chooses which tools to use based on your prompt — you describe the goal, it figures out the steps.
Your Project
Files in your directory and subdirectories, plus files elsewhere with your permission.
Your Terminal
Build tools, git, package managers, system utilities, scripts — if you can run it, Claude can too.
Git State
Current branch, uncommitted changes, and recent commit history.
CLAUDE.md
Project-specific instructions, conventions, and context loaded every session.
Auto Memory
Learnings Claude saves automatically — project patterns, preferences. First 200 lines of MEMORY.md loaded each session.
Extensions
MCP servers, custom skills, subagents, and Chrome integration.
Claude sees your whole project, not just the current file — it can search, read, edit, test, and commit across your entire codebase.
The agentic loop is the same everywhere. What changes is where code runs and how you interact.
| Environment | Where code runs | Use case |
|---|---|---|
| Local | Your machine | Default — full access to files, tools, environment |
| Cloud | Anthropic-managed VMs | Offload tasks, work on repos you don't have locally |
| Remote Control | Your machine, via browser | Web UI while keeping everything local |
Same agentic loop, same tools — different surface.
Esc EscCLAUDE.md and auto memoryResume or fork:
claude --continue # pick up where you left off
claude --resume # choose from recent sessions
claude --resume abc123 \
--fork-session # branch off into new session
Sessions are tied to your working directory. Run parallel sessions using git worktrees for separate branches.
Holds your conversation history, file contents, command outputs, CLAUDE.md, skills, and system instructions. As you work, it fills up.
When context fills up
Manage context
/mcpUseful commands:
/context # see what's using space
/compact focus on the API changes # compact with a focus
CLAUDE.md → "Compact Instructions" # control what's preserved
Put persistent rules in CLAUDE.md — don't rely on conversation history surviving compaction.
Claude asks before acting. You control how much autonomy it has with Shift+Tab.
Default
Asks before edits and commands
Auto-accept
Edits files freely, still asks for commands
Plan Mode
Read-only — analyses but won't change anything
Checkpoints
Esc Esc to rewindAllow-list commands
npm test.claude/settings.json1. Navigate and start
cd /path/to/project
claude
2. Get a high-level overview
give me an overview of this codebase
3. Dive deeper
explain the main architecture patterns used here
what are the key data models?
how is authentication handled?
Start broad, then narrow down. Ask about coding conventions, project-specific terms, and how components connect.
Paste an error, describe a symptom, or just say what's wrong — Claude investigates and fixes it.
1. Share the problem
I'm seeing a TypeError when I run npm test
2. Let Claude investigate
suggest a few ways to fix the @ts-ignore in user.ts
3. Apply and verify
apply the null check fix, then run the tests again
Give Claude the command to reproduce the issue — a stack trace is worth a thousand words.
Claude Code follows the Unix philosophy — pipe data in, get structured output back, chain with other tools.
Pipe errors for diagnosis
cat build-error.txt | claude -p 'explain the root cause' > diagnosis.txt
Use as a linter in package.json
"lint:claude": "claude -p 'look at changes vs main, report typos
with filename:line and description'"
Bulk review changed files
git diff main --name-only | claude -p 'review for security issues'
Structured output formats
claude -p 'analyze code' --output-format json # full JSON
claude -p 'analyze code' --output-format text # plain text
claude -p 'analyze code' --output-format stream-json # streaming
Starting from scratch or tackling a large codebase? Plan first, build second. Claude analyses with read-only tools before writing any code.
Enter Plan Mode
Shift+Tab Shift+Tab # toggle in-session
claude --permission-mode plan # start in plan mode
Ask Claude to plan
I need to refactor our auth system to use OAuth2.
Create a detailed migration plan.
Refine, then execute
What about backward compatibility?
How should we handle the database migration?
Press Ctrl+G to open the plan in your editor. Review and edit before Claude proceeds.
Write & run tests
add tests for the auth module, run them, fix any failures
Refactor code
refactor utils.js to use ES2024 features, keep the same behaviour
Create PRs & commits
commit my changes with a descriptive message
Generate documentation
add JSDoc comments to the undocumented functions in auth.js
Work with images
Drag & drop screenshots, mockups, or diagrams — Claude analyses them
Reference files with @
explain the logic in @src/utils/auth.js
Claude is conversational — start with what you want, then refine. You don't need perfect prompts.
| Model | Best for | ID |
|---|---|---|
| Opus 4.6 | Complex reasoning, architecture decisions | claude-opus-4-6 |
| Sonnet 4.6 | Everyday coding tasks (default) | claude-sonnet-4-6 |
| Haiku 4.5 | Fast, lightweight tasks | claude-haiku-4-5 |
Switching models:
/model # interactive picker mid-session
claude --model claude-opus-4-6 # set at launch
Prompt: "write a simple python script that draws to the terminal through print commands an animated ascii art of someone flipping a table"
Haiku 4.5
Sonnet 4.6
Opus 4.6
A markdown file Claude reads at the start of every session. You write it, Claude follows it.
| Scope | Location | Shared with |
|---|---|---|
| Project | ./CLAUDE.md or ./.claude/CLAUDE.md |
Team (via version control) |
| User | ~/.claude/CLAUDE.md |
Just you (all projects) |
| Organisation | /etc/claude-code/CLAUDE.md |
All users on machine |
Add build commands, coding standards, architecture decisions, naming conventions, and common workflows.
Run /init to generate a starting CLAUDE.md automatically — Claude analyses your codebase and creates one for you.
Be specific
"Use 2-space indentation"
not "Format code properly"
Keep it concise
Target < 200 lines per file
Split large files with imports or rules
Use structure
Markdown headers & bullets
Organised sections > dense paragraphs
Import files
@README @docs/guide.md
Pull in context with @ syntax
Organise with .claude/rules/
your-project/
├── .claude/
│ ├── CLAUDE.md # Main project instructions
│ └── rules/
│ ├── code-style.md # Code style guidelines
│ ├── testing.md # Testing conventions
│ └── security.md # Security requirements
Claude writes notes for itself as you work — build commands, debugging insights, your preferences. No effort from you.
How it works
MEMORY.md loaded each sessionWhere it lives
~/.claude/projects/<project>/memory/
├── MEMORY.md
├── debugging.md
├── api-conventions.md
└── ...
Useful commands:
/memory # browse & edit memory files
"remember that API tests need Redis" # Claude saves to auto memory
"always use pnpm, not npm" # Claude remembers for next time
The built-in tools cover most tasks. These extensions let you go further.
| Feature | What it does | When to use |
|---|---|---|
| MCP | Connect to external services | Database queries, Slack, browser control |
| Skills | Reusable knowledge & workflows | Deploy checklists, API docs, /review-pr |
| Subagents | Isolated workers with own context | Parallel tasks, heavy research, specialised workers |
| Hooks | Deterministic scripts on events | Auto-lint after edits, notify on completion |
| Plugins | Bundle & share feature sets | Distribute skills + hooks + MCP across repos |
An open standard for connecting Claude to external services and data sources.
What MCP provides
@server:resourceExample servers
/mcp # check connected servers & token costs
claude mcp add my-server -- npx my-mcp-server # add a server
Markdown files containing knowledge, workflows, or instructions. Load on demand, not every session.
Reference skills
Knowledge Claude draws on when relevant
API style guide, data model docs
Action skills
Workflows you invoke with /name
/deploy /review-pr /release
# Skills live in .claude/skills/ or ~/.claude/skills/
.claude/skills/
├── deploy.md # /deploy — your deployment checklist
├── api-guide.md # loaded automatically when relevant
└── review.md # /review — code review workflow
A skill is just a markdown file with optional frontmatter. Invoke with /deploy.
.claude/skills/deploy.md
---
name: deploy
description: Deploy the application to production
disable-model-invocation: true
---
# Deployment Checklist
1. Run the full test suite: `npm test`
2. Check for uncommitted changes: `git status`
3. Build the production bundle: `npm run build`
4. Verify the build output in `dist/`
5. Tag the release: `git tag -a v$(node -p "require('./package.json').version")`
6. Push the tag: `git push --tags`
7. Deploy: `npm run deploy:prod`
## Rollback
If something goes wrong:
- Revert to previous tag: `git checkout <previous-tag>`
- Redeploy: `npm run deploy:prod`
Isolated workers with their own fresh context. They do the work, return a summary — your main session stays clean.
Why use them
How to use
use a subagent to review auth.claude/agents//agents # view & create custom subagents
"in a subagent, research how auth works" # ad-hoc, no setup needed
Define reusable agents as markdown files. Claude delegates to them automatically when the task matches.
.claude/agents/reviewer.md
---
name: reviewer
description: Reviews code for security and performance issues
model: claude-sonnet-4-6
tools:
- Read
- Glob
- Grep
skills:
- security-guidelines
isolation: worktree
---
You are a code reviewer. Focus on:
- Security vulnerabilities (injection, auth bypass)
- Performance bottlenecks
- Error handling gaps
Return a summary of findings with file:line references.
Use /agents to browse and create agents interactively, or just drop a .md file in .claude/agents/.
Shell commands that run automatically before or after Claude Code actions. No LLM involved — deterministic scripts.
Hook events
PostToolUse — after file edits, bash runsNotification — when Claude needs attentionSessionStart / SessionStopPrePromptSubmit — before your prompt sendsExample uses
/hooks # configure hooks interactively
Bundle skills, hooks, subagents, and MCP servers into a single installable unit. Share across repos or distribute via marketplaces.
What a plugin contains
/my-plugin:review)When to use
Start with individual skills and hooks. Package into a plugin when you want to reuse or distribute.
Give Claude a way to verify
Include tests, screenshots, or expected output so Claude can check its own work.
Be specific upfront
Reference files, mention constraints, point to patterns. Fewer corrections needed.
Clear between tasks
Run /clear between unrelated tasks. Stale context degrades performance.
Delegate research to subagents
Keep your main context clean — subagents explore and return summaries.
Course-correct early
Press Esc as soon as Claude goes off track. After two failed corrections, /clear and start fresh.
Avoid common pitfalls
Don't mix unrelated tasks. Don't over-specify CLAUDE.md. Don't ship without verification.
Slash commands
/init — generate a CLAUDE.md/model — switch model/context — see context usage/compact — compress context/memory — browse memory files/hooks — configure hooks/agents — manage subagents/mcp — check MCP servers/resume — switch sessions/rename — name current sessionKeyboard shortcuts
Shift+Tab — cycle permission modesEsc Esc — rewind to checkpointCtrl+G — open plan in editorCtrl+O — toggle verbose modeAlt+T — toggle thinkingCtrl+C — interrupt ClaudeCLI flags
--continue — resume last session--resume — pick a session--model — set model--worktree — isolated worktree-p "prompt" — headless modecode.claude.com/docscode.claude.com/docs/en/quickstartcode.claude.com/docs/en/best-practicescode.claude.com/docs/en/common-workflowsgithub.com/anthropics/claude-codecode.claude.comBuilt with reveal.js — this presentation was made entirely by Claude Code