Claude Code

An agentic coding tool that lives in your terminal, IDE, and browser


code.claude.com

Getting Started

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.

The Agentic Loop

Claude works in a continuous loop: gather context, take action, verify results — repeating until done.

The agentic loop

You can interrupt and steer at any point in the loop.

Tools Under the Hood

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.

What Claude Can Access

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.

Environments & Interfaces

The agentic loop is the same everywhere. What changes is where code runs and how you interact.

Execution Environments

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

Interfaces

Terminal Desktop App VS Code JetBrains claude.ai/code Remote Control Slack CI/CD

Same agentic loop, same tools — different surface.

Sessions

  • Every message, tool use, and result is saved locally
  • File snapshots taken before edits — rewind anytime with Esc Esc
  • Each session starts with a fresh context window — no prior conversation history
  • Persistent knowledge via CLAUDE.md and auto memory

Resume 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
Session continuity

Sessions are tied to your working directory. Run parallel sessions using git worktrees for separate branches.

The Context Window

Holds your conversation history, file contents, command outputs, CLAUDE.md, skills, and system instructions. As you work, it fills up.

When context fills up

  • Older tool outputs cleared first
  • Conversation summarised if needed
  • Your requests & key code preserved
  • Early detailed instructions may be lost

Manage context

  • Skills load on demand, not at startup
  • Subagents get their own fresh context
  • MCP servers add tool defs to every request — check costs with /mcp

Useful 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.

Permissions & Safety

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

  • Every file edit is snapshotted
  • Press Esc Esc to rewind
  • Or ask Claude to undo

Allow-list commands

  • Trust commands like npm test
  • Configure in .claude/settings.json
  • Scoped from org-wide to personal

Workflow: Explore a Codebase

1. 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.

Workflow: Debugging Code

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.

Workflow: Unix Piping & Scripting

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

Workflow: Plan Mode

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.

Other Common Use Cases

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.

Models

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

Same Prompt, Three Models

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

Haiku table flip

Sonnet 4.6

Sonnet table flip

Opus 4.6

Opus table flip

CLAUDE.md

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.

Writing Effective Instructions

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

Auto Memory

Claude writes notes for itself as you work — build commands, debugging insights, your preferences. No effort from you.

How it works

  • First 200 lines of MEMORY.md loaded each session
  • Detailed notes split into topic files
  • Read on demand, not all at startup

Where 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

Extending Claude Code

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

MCP — Model Context Protocol

An open standard for connecting Claude to external services and data sources.

What MCP provides

  • Tools Claude can call (query DB, post to Slack)
  • Resources you reference with @server:resource
  • Tool definitions loaded at session start

Example servers

  • Database — query & update your data
  • Slack — read channels, post messages
  • Google Drive — read design docs
  • Browser — control via Puppeteer
/mcp                           # check connected servers & token costs
claude mcp add my-server -- npx my-mcp-server  # add a server

Skills

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

Skill Example

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`

Subagents

Isolated workers with their own fresh context. They do the work, return a summary — your main session stays clean.

Why use them

  • Context isolation — doesn't bloat your session
  • Parallel tasks across files or features
  • Specialised roles (reviewer, debugger)

How to use

  • Claude spawns them automatically when needed
  • Or request: use a subagent to review auth
  • Define custom agents in .claude/agents/
/agents                              # view & create custom subagents
"in a subagent, research how auth works" # ad-hoc, no setup needed

Subagent Example

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/.

Hooks

Shell commands that run automatically before or after Claude Code actions. No LLM involved — deterministic scripts.

Hook events

  • PostToolUse — after file edits, bash runs
  • Notification — when Claude needs attention
  • SessionStart / SessionStop
  • PrePromptSubmit — before your prompt sends

Example uses

  • Auto-format after every file edit
  • Run lint before commits
  • Desktop notification when idle
  • Log tool usage for auditing
/hooks                         # configure hooks interactively

Plugins

Bundle skills, hooks, subagents, and MCP servers into a single installable unit. Share across repos or distribute via marketplaces.

What a plugin contains

  • Skills (namespaced: /my-plugin:review)
  • Hooks for automation
  • Custom subagent definitions
  • MCP server configs

When to use

  • Same setup needed across multiple repos
  • Sharing workflows with your team
  • Publishing to a marketplace
  • Multiple plugins coexist via namespacing

Start with individual skills and hooks. Package into a plugin when you want to reuse or distribute.

Best Practices

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.

Cheat Sheet

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 session

Keyboard shortcuts

  • Shift+Tab — cycle permission modes
  • Esc Esc — rewind to checkpoint
  • Ctrl+G — open plan in editor
  • Ctrl+O — toggle verbose mode
  • Alt+T — toggle thinking
  • Ctrl+C — interrupt Claude

CLI flags

  • --continue — resume last session
  • --resume — pick a session
  • --model — set model
  • --worktree — isolated worktree
  • -p "prompt" — headless mode

Resources & Next Steps

  • Docscode.claude.com/docs
  • Quickstartcode.claude.com/docs/en/quickstart
  • Best practicescode.claude.com/docs/en/best-practices
  • Common workflowscode.claude.com/docs/en/common-workflows
  • GitHubgithub.com/anthropics/claude-code
  • Product pagecode.claude.com

Built with reveal.js — this presentation was made entirely by Claude Code