Skills MCP Learn Benchmarks Tools News
Learn · Guides · Tooling

Claude Code for Web Developers.

The complete Claude Code reference — permissions, MCP, subagents, session forking, hooks, and the model picker that keeps Sonnet on the bill.

SPONSOR

AppSignal — Stop vibe-debugging. Every exception, every backtrace, grouped so you see patterns, not noise.

↗
On this page
  1. Install and authenticate
  2. CLAUDE.md vs AGENTS.md
  3. Model and mode picker
  4. Permissions and sandbox
  5. MCP servers
  6. Subagents and session forking
  7. Hooks worth setting up
  8. Live: permission profile builder
  9. Common pitfalls
CH 01

Install and authenticate.

Claude Code is a terminal-native agent. Install it once, then run it from any repo root.

$ install Claude Code
# npm (macOS / Linux / WSL)
npm install -g @anthropic-ai/claude-code

# Homebrew (macOS)
brew install --cask claude-code

# First run — opens browser OAuth or prompts for API key
cd my-app && claude

# Verify model access
claude --version

Two auth paths: a Claude subscription (Pro/Max/Team) for bundled agent usage, or an Anthropic API key for pay-per-token billing. Web teams on a subscription often still add an API key for CI automations where OAuth is awkward.

Global config lives under ~/.claude/. Project overrides go in .claude/settings.json (committed) and .claude/settings.local.json (gitignored, machine-specific).

CH 02

CLAUDE.md vs AGENTS.md.

Claude Code looks for project context the same way every modern agent does: a markdown file at the repo root loaded into every turn. Historically that file was CLAUDE.md; the cross-vendor standard is now AGENTS.md.

Our recommendation: maintain one canonical AGENTS.md (use the AGENTS.md guide's generator) and add a one-line symlink or note in docs if your Claude Code version prefers CLAUDE.md. Never maintain two different files with diverging rules.

Claude Code also reads, in order:

  1. AGENTS.md or CLAUDE.md at repo root
  2. .claude/rules/*.md — always-on constraints (glob-scoped when possible)
  3. .claude/skills/ or project skills/ — on-demand capabilities
  4. Nested AGENTS.md in subdirectories when editing inside them
.claude/rules/no-inline-styles.md
---
paths:
  - "src/components/**"
  - "src/app/**"
---

# Styling rules

- Use design tokens from `src/styles/tokens.css`.
- No inline `style={{ }}` except for truly dynamic values (transforms, calculated widths).
- Prefer native CSS over runtime CSS-in-JS.
CH 03

Model and mode picker.

Claude Code defaults to Sonnet for good reason. The token cost guide math applies directly: Opus on a 50-turn refactor session adds up fast. Switch models inside a session with /model.

TaskModelNotes
Feature work across 3–8 files Sonnet 4.6 Default. Best cost-to-quality for tool-heavy loops.
Flaky test / race condition hunt Opus 4.7 Extended thinking pays off when the bug is non-obvious.
Read-only security or a11y audit Opus 4.7 Pair with a read-only permission profile (see widget below).
Mechanical migration (rename API, update imports) Sonnet 4.6 High volume, low ambiguity. Don't burn Opus on grep-shaped work.
Quick one-file tweak Haiku 4.5 When the change is obvious and you want a cheap second opinion.

Auto mode (when enabled) picks Sonnet vs Opus from request shape. Fine once your AGENTS.md is stable; on a brand-new repo, manually pick Sonnet for the first dozen turns so Auto has signal about complexity.

CH 04

Permissions and sandbox.

Claude Code's permission system is the difference between "helpful pair programmer" and "ran npm install evil-package while I was at lunch." Every tool call (read, edit, bash) can be allow-listed, denied, or prompted.

Three profiles web teams actually use:

ProfileWhenShellWrites
Cautious Production repos, client work, first week on a codebase npm run *, pnpm *, git status only Prompt on every edit outside src/
Balanced Daily feature development Test/lint/dev scripts; deny install, push, curl Auto-approve edits under repo root; deny .env*
Full agent Throwaway branches, scaffolding, trusted sandboxes Broader bash; still deny secrets and git push Auto-approve with post-turn review discipline
.claude/settings.json (balanced starter)
{
  "permissions": {
    "allow": [
      "Read(**/*)",
      "Edit(**/*)",
      "Bash(npm run *)" ,
      "Bash(pnpm *)" ,
      "Bash(git status)",
      "Bash(git diff *)" 
    ],
    "deny": [
      "Read(.env*)",
      "Read(**/*.pem)",
      "Bash(npm install*)" ,
      "Bash(pnpm add *)" ,
      "Bash(git push*)" ,
      "Bash(curl *)" ,
      "Bash(wget *)" 
    ]
  }
}

Match this with the security guide: disable auto package install in the UI and deny install commands in permissions. Belt and suspenders.

CH 05

MCP servers.

Claude Code was the first major agent to ship MCP support at scale. Config lives in ~/.claude.json or project .mcp.json depending on version; the shape matches Cursor and OpenCode.

The same seven servers from the MCP guide earn their keep here: Playwright, Postgres, GitHub, Linear, Sentry, Figma, Filesystem. Start with two, not seven.

.mcp.json (project-scoped example)
{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["-y", "@playwright/mcp"]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }
    }
  }
}
CH 06

Subagents and session forking.

Claude Code's subagent model is the most polished in the terminal-CLI category. The agent can spawn focused workers (test writer, doc updater, reviewer) that inherit context but run with narrower tools.

Session forking (branch sessions) lets you explore an approach without polluting the main conversation. Reach for it when you want two competing implementations: fork, run both, merge the winner back. Don't fork every turn; each fork still costs tokens to re-establish context.

For true parallelism across four agents, graduate to git worktrees or Conductor as described in the parallel agents guide. Subagents handle delegation inside one session; worktrees handle delegation across machines and editors.

PatternToolingBest for
Delegate a subtask inside one feature Claude Code subagent "Write tests while I finish the component"
Try two approaches, pick one Session fork API design spikes, refactor strategies
Four unrelated tasks at once Worktrees + Conductor Sprint crunch with review discipline
CH 07

Hooks worth setting up.

Hooks fire on agent lifecycle events. Three that pay off for web repos (same philosophy as the Cursor hooks section):

  • PostToolUse (Edit) — run Prettier on the touched file.
  • Stop — run eslint --fix on changed paths only.
  • PreToolUse (Bash) — block commands matching npm install, curl, or git push unless you explicitly override.

Keep hook runtime under two seconds or the agent loop feels broken.

.claude/settings.json (hooks excerpt)
{
  "hooks": {
    "PostToolUse": [{
      "matcher": "Edit|Write",
      "command": "pnpm exec prettier --write $CLAUDE_FILE_PATHS"
    }],
    "Stop": [{
      "command": "pnpm exec eslint --fix $(git diff --name-only -- '*.ts' '*.tsx')"
    }]
  }
}
DEMO · INTERACTIVE

Live: permission profile builder.

Pick a baseline profile and toggle the rules your repo needs. Copy the generated .claude/settings.json into your project. Runs entirely in your browser.

Permission profile builder In-browser only · No network calls
Allow rules
Deny rules (recommended)
.claude/settings.json
0 rules

                                    
PITFALLS

Common pitfalls.

Opus as default

Claude Code makes Opus feel effortless. That doesn't mean it's cheap. Run Sonnet until you hit a wall you can name; then escalate.

Permissions too loose on monorepos

Edit(**/*) includes infra/terraform, .github/workflows, and prisma/migrations. Deny or prompt on paths that should never be agent-edited without human review.

Subagents without a merge plan

Three subagents writing in the same directory produces the same conflicts as three human devs. Scope each worker to a folder or file set before spawning.

What to read next.

  • Guide Cursor for Web Developers Editor-first workflow when you want the same agent patterns in an IDE.
  • Guide Codex CLI for Web Developers OpenAI's terminal agent when long autonomous runs are the job.
  • Guide Running 4 Agents at Once When one Claude Code session isn't enough: worktrees and review discipline.
Changelog
  • 2026-06-15Initial publish covering Claude Code feature set as of June 2026.
STATUS ● BUILDING THE FUTURE
MISSION LLM RESOURCES
VERSION BETA 3.0

BUILD WITH AI. SHIP WITH CONFIDENCE.

@WEBDEVELOPERHQ ↗
TERMS / PRIVACY
FRIENDS
Authentic Jobs
Authentic Jobs ↗
Web Reference
Web Reference ↗
Ready.dev
Ready.dev ↗
Design.dev
Design.dev ↗
© 2026 WEB DEVELOPER / ALL RIGHTS RESERVED