Educational synthesis · Claude Code sessions

Maximizing the value of your Claude Code sessions

How to run efficient Claude Code sessions that get the most from every token — less noise in context, smarter model and effort choices, and habits that keep prompt cache working for you.

Cache
~0.05× read
Output
~5× input
Cache TTL
~1h sub
Bust risk
model/effort

Quick wins

TL;DR habit cards

High-leverage habits that keep sessions lean, cache-friendly, and workflow-aware.

/clear

Clear between distinct tasks

Start a fresh context when the goal changes. Leftover exploration becomes expensive noise on every later turn.

/model · /effort

Set model at start; dial effort as needed

Default stays Opus 5.5 for open-ended judgment. Use /model sonnet (Sonnet 5.5 from v2.1.284) for well-scoped everyday work. Pick /model once at session start (switches still bust cache). On Opus 5.5 / Fable 5.1 you can raise /effort mid-session without resetting cache — still prefer medium for day-to-day.

/usage

Measure cost on real tasks

End a task with /usage (or /cost). Compare turns, cache share, and output. Since v2.1.299 /usage also warns when max effort, workflows, always-on context, or large tool results are driving the bill, and since v2.1.305 you can press f to apply its suggested fixes.

@file

@-mention files instead of paths

Attaching with @ puts the file in context directly and skips unnecessary Read/search round-trips.

quiet / subagent

Quiet noisy commands

Add quiet flags to verbose tools, or run chatty work in a subagent so only the summary returns.

/context

Inspect what is loaded

In a fresh session, run /context to see CLAUDE.md, skills, MCP, and other always-on payload before you start.

/compact

Compact before a long break

On subscription plans the cache expires around an hour. Since v2.1.299 the terminal auto-compacts idle chats over 200K tokens just before that; for smaller ones, compact yourself before stepping away.

ultracode

Workflows only for big jobs

Dynamic workflows burn far more usage. Ultracode is its own /effort toggle (no longer forces xhigh). Reserve it / “create a workflow” for audits, migrations, and adversarial checks — not everyday edits.

claude agents

Steer many sessions from one screen

Use agent view (or the desktop sidebar) when several tickets should each keep their own transcript. Background with /bg; jump in only when a row needs you.

Projects

Let a coordinator own multi-part goals

For cloud builds that span repos or long-running outcomes, open a Project: Claude routes threads, keeps shared memory, and you steer from the main chat (or your phone).

skills

Push procedures into skills

Keep CLAUDE.md lean. Move multi-step playbooks, scripts, and verification checklists into on-demand skills so they load only when the task matches.

AGENTS.md · /memory

Share one instruction file; let Claude remember the rest

Reuse AGENTS.md when the repo already has one (or @-import it from CLAUDE.md). Use /memory to audit auto memory so corrections stick without bloating the shared file.

/schedule

Automate with routines

For backlog triage, deploy checks, or PR babysitting, schedule a routine so Claude runs on web infra without your laptop staying open.

migrations

Port the process, not files

For language or framework ports, invest in a rulebook, a mechanical judge, and adversarial review — then fan out. Fixing one file by hand does not scale.

Economics

Token economics

You are billed for inference work. Model size, input vs output, and caching decide what each turn costs. Efficiency means tokens go toward the ask — not toward noise.

Every Claude Code turn reuses conversation history. Cached tokens are cheap to re-read; new tokens — especially model output and fresh tool results — dominate the bill. Output tends to cost on the order of ~5× input in illustrative terms.

  • Model size
    Larger weights usually mean higher per-token rates and stronger reasoning.
  • Input vs output
    Generated tokens are typically much more expensive than prompt tokens.
  • Caching
    Stable prefixes (system, CLAUDE.md, early messages) can be cache-read cheaply.
  • Noise tax
    Verbose logs and irrelevant files still occupy context and re-enter each turn.

Chart values are illustrative multipliers for teaching — not Anthropic list prices.

Input
1×
Output
≈5×
Cache read
≈0.05×
Cache write
≈1–2×

Code Mode · batch tool calls in one step

Experimental · opt-in · v2.1.323+

Normally Claude requests one tool call, reads the whole result, then decides the next one — every intermediate output re-enters the context. In Code Mode, Claude instead writes a short JavaScript snippet that runs several tool calls (searches, edits, test runs) inside your session, chains results together, and hands back only the slice it needs. Fewer round trips, less noise in the window.

Good fit

The same edit across many files, searches that need filtering before Claude reads them, and independent commands that can run in parallel.

Turn it on

Start with CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude (or set it in the env block of ~/.claude/settings.json — project settings cannot enable it). Confirm the prompt once; press Ctrl+O to inspect the generated code.

Know the limits

Interactive terminal only on Opus/Sonnet/Haiku 5.5 or Fable 5.2 with a subscription or Console account — no -p, SDK, IDE panel, gateways or cloud providers. Auto mode reviews the code as a whole, and such sessions resume only with Code Mode on.

Infographic

Prompt caching walkthrough

A typical fix session writes the prefix once, then rides cheap cache reads — until something busts the key.

Request lifecycle · typical bugfix

System + CLAUDE.mdcache write (once)User askfull inputLater turns · cache-read≈0.05× historyNew tool results + outputfull price (new tokens)Keep the prefix stable → maximize cache-read share of each turn
1

Write once

System prompt, CLAUDE.md, and your first message establish a stable prefix.

2

Cache hit

Later turns cache-read that history. You mainly pay full price for new tool results and the model’s reply.

3

Cheap moments

Session start and right after /clear are ideal times to set /model and /effort — no big cache to lose.

What busts the cache

⇄
/model switch
Different weights → new cache key
⚡
/effort (older models)
Still can bust cache — Opus 5.5 / Fable 5.1 keep it
🚀
Fast mode on
Mode flip can invalidate the prefix
✂
/compact rewrite
Summary replaces history (costs some)
⏱
Time expiry
~1h idle on subscription; terminal auto-compacts 200K+ chats just before (v2.1.299)

/rewind — keep the cache

Trims the end of the conversation without rewriting the whole history. Useful when you want to undo a dead-end while preserving earlier cache-friendly turns.

/compact — always costs something

Summarizes and replaces history. Worth it before long breaks or when context is bloated — but expect a write cost and a new prefix afterward. From v2.1.299 the terminal does this for you: a conversation over 200K tokens left idle about 54 minutes is compacted before its one-hour cache lapses, so your next message doesn't reprocess the whole history at full price. Tune the threshold with CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS or turn it off with "idleCompaction": false.

Protect cache-read share

Pick the model at session start, compact smaller sessions yourself before you step away (idle compaction only covers 200K+ chats), and on API or cloud keys opt into a one-hour cache lifetime for long runs. Forked subagents can inherit the parent's warm cache instead of rebuilding it.

Context

Session hygiene

Sessions are longer and more context-heavy than a year ago. Everything Claude reads or prints stays in the transcript and is re-sent every turn — so keep only necessary context, and ride cheap cache reads for the rest.

Prefer short, relevant sessions

  • →@-mention a file once; avoid re-asking Claude to re-read the same path repeatedly.
  • →Put common quiet command recipes in CLAUDE.md so Claude doesn’t invent verbose variants.
  • →End or /clear when the task is done — don’t pile unrelated chores into one mega-session.
  • →Think twice before resuming a long, cold conversation: its cache is gone, so the first turn re-reads everything. Since v2.1.304 Pro/Max plans warn when that would eat a noticeable slice of the 5-hour limit — often a new session that refers back to the old one is cheaper.

Output size traps

Huge (>~30k chars)

Claude Code often writes to a file and shows a preview. Painful, but partially mitigated.

Medium noisy (under the limit)

The real problem: verbose test/lint/build logs that fit entirely in context and get re-cached forever. Quiet flags and subagents matter most here.

Context grows; cache softens the cost

Turn 1 · ask
Turn 2 · + tool output
Turn 3 · + more files
Turn 4 · noise accumulates

Illustrative: later turns re-send the whole transcript. Cache-read discounts history, but window pressure remains.

Model family

Choosing the right model

As of Claude Code 2.1.284, /model sonnet resolves to Sonnet 5.5 (1M context), from 2.1.293 the Haiku slot is Haiku 5.5 (also 1M context), and from 2.1.321 /model fable resolves to Fable 5.2. The default session model stays Opus 5.5. The ladder is still: specialist → expert → everyday helper → fast worker.

Haiku 5.5fast workerSonnet 5.5everydayOpus 5.5daily driverFable 5.2frontiercapability → · cost & depth typically rise with the ladder
ModelRoleBest forCost / speed posture
Fable 5.2 / Mythos 5.2Specialist / frontier (v2.1.321+)Hardest reasoning, hours-long agent runs, otherwise-infeasible migrations, orchestrating agent teams$8/$40 per Mtok (was $10/$50 on 5.1) · cache reads $0.20 · 1M context · up to ~30% faster output than 5.1 · optional fast mode $16/$80
Opus 5.5Expert · daily driver (v2.1.280+)Open-ended judgment, long-horizon agentic coding, migrations you supervise1M context · default model stays Opus · fewer wasted turns on hard work
Sonnet 5.5Fast everyday coder (v2.1.284+)Well-scoped bugs/features, iterative polish, design-aware docs/slides, fan-out agents$2/$10 · cache reads $0.10 per Mtok (halved Oct 7) · ~30%+ faster than Sonnet 5 · medium default in Claude Code
Haiku 5.5Fast worker (v2.1.293+)Search/read/summarize subagents, condensing long context, classification, cheap fan-out that is easy to spot-check$0.10/$0.50 per Mtok · 1M context · medium default effort · not for complex agentic coding, escalate to Sonnet/Opus
New: Fable 5.2 (Nov 9). Claude Code 2.1.321 makes claude-fable-5-2 the default Fable model, and saved Fable 5.1 picks move to fable automatically (on Team and Enterprise once the org allows it). The climb to the top rung got cheaper: list price drops about 20% to $8/$40 per Mtok, cache reads are $0.20, and output streams up to ~30% faster. It still pays to treat it as the specialist rung, not the default: Anthropic positions Opus 5.5 for everyday work and Fable 5.2 for hard, open-ended engineering. Fast mode (up to ~2.5× faster tokens) costs double, $16/$80, so save it for a blocking turn you are actively waiting on. Need the old model for a comparison? /model claude-fable-5-1 switches back.
Opus 5.5 value tip: keep it as the default for open-ended judgment. List prices cut input/output ~20% vs Opus 5 and cache reads ~60%; typical token-billed savings sit around ~40% as sessions get longer and more cache-heavy. Measure with /usage.
Sonnet 5.5 value tip: switch with /model sonnet for clear-spec everyday work. Same $2/$10 list as Sonnet 5, but fewer tokens per task and ~30%+ faster output — often up to ~30% less cost. Since Oct 7 its cache reads cost $0.10 per Mtok (5% of input, was 10%), so long Sonnet sessions that ride a stable prefix get noticeably cheaper; /cost reflects this from v2.1.296. Default effort in Claude Code is medium; no fast mode.
Advisor strategy: put narrow search / log / summary subagents on Haiku 5.5, review and scoped edits on Sonnet 5.5; keep architecture and ambiguous edits on Opus 5.5. Haiku 5.5 counts the same text as roughly 30% more tokens than Haiku 4.5, so judge it by cost per finished task, not per token. Climb to Fable 5.2 only for high-stakes sprawl — then switch back so new sessions do not stay on the premium default.

Model × effort

Model vs effort

Model = which frozen weights (capability ceiling). Effort = how much work — files read, verification, steps before check-in — not merely “thinking longer.” On Opus 5.5 and Sonnet 5.5 the ladder is low → medium → high → xhigh (plus max for one session).

Wrong because too hard → larger model

The approach keeps failing on subtle reasoning or unfamiliar domains. Climb the model ladder; more tokens of a weak model won’t invent capability. Prefer raising effort on Opus 5.5 first — then Fable if high stalls twice on the same blocker. For clear-spec everyday work, try Sonnet 5.5 before burning Opus turns.

Wrong because skipped checks → higher effort

The model could do it but rushed: missed call sites, shallow search, incomplete edge cases. Raise effort so it invests more steps before declaring done — and give it a test or build to verify, which often beats burning thinking on every turn.

Fable · specialist

Like bringing a domain expert. Effort decides how many sources they consult before answering.

× effort = how long they spend before check-in

Opus 5.5 · expert

Daily driver for supervised open work. Default effort is medium — raise to high before you climb models.

× effort = how long they spend before check-in

Sonnet 5.5 · everyday

Strong on clear-spec coding and polish. Default effort is medium in Claude Code; prefer it over Opus when the task is well scoped.

× effort = how long they spend before check-in

Routine work: Sonnet 5.5 or low effort wins on cost/speed. Hard open-ended work: Opus 5.5 that finishes in fewer turns can beat a cheap model that flails — chart is illustrative only.

New model = reset effort. A level you saved before /effort became per-model does not carry to newly released models such as Opus 5.5 or Sonnet 5.5 — they start at their default until you pick again. Run /effort status after upgrading. On Opus 5.5 and Fable 5.1, changing effort mid-session no longer resets the prompt cache — so raise effort before climbing to a heavier model when the same session should continue.

Ultracode is now its own toggle in /effort (Tab, or /effort ultracode on|off). As of Claude Code 2.1.284 it no longer forces xhigh — it stays on at whatever effort you already set and lets Claude decide when to spin up a dynamic workflow. Use it for hard, high-value work; keep it off for everyday tickets so you do not burn usage on orchestration overhead.

One hard turn, not a whole session. Since Claude Code 2.1.311, putting ultrathink in a prompt in the interactive terminal (and, from 2.1.316, the VS Code chat box) runs just that turn at xhigh on Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.1 (Anthropic API). Typed while Claude is already working, it raises effort for the rest of that turn. It is the cheap way to spend extra effort on a single tricky step — a gnarly bug, a design decision — while the session stays at its everyday level. The rainbow highlight only appears where the keyword can actually raise effort, so no rainbow means no boost (for example inside quotes or a file path). Admins who don't want it can switch the keyword off with CLAUDE_CODE_DISABLE_ULTRATHINK.

Persistent context

CLAUDE.md, AGENTS.md & auto memory

Project memory loaded every session. Keep instruction files lean — they are always in the prompt. Bootstrap with /init, capture repeating instructions with #, push long procedures into on-demand skills, and let auto memory hold your corrections.

Put in CLAUDE.md

  • ✓Architecture map — where key modules live and how they talk
  • ✓Common commands with quiet flags (test, lint, build, typecheck)
  • ✓Coding standards and review expectations
  • ✓Recurring workflows (PR checklist, release steps)
  • ✓Pointers to deeper docs; keep this file lean

Keep out / move elsewhere

  • ✗Secrets, tokens, or private credentials
  • ✗Novel-length prose that bloats every session
  • ✗Procedural multi-step playbooks better suited as skills
  • ✗Stale commands that no longer match the repo
/init

Bootstrap a starter CLAUDE.md from the repo, then edit ruthlessly.

#

Capture a repeating instruction into CLAUDE.md mid-session when you notice the pattern.

subdir CLAUDE.md

In monorepos, add local CLAUDE.md files so packages get package-specific context.

AGENTS.md · shared agent instructions

v2.1.277+

Repos that already ship an AGENTS.md for other coding agents no longer need a duplicate playbook. When there is no project CLAUDE.md (or CLAUDE.local.md) on the path, Claude Code loads AGENTS.md as project instructions. Prefer a thin CLAUDE.md with an @AGENTS.md import when you also want Claude-specific notes, or set Project instructions in /config to read both files together.

Default

CLAUDE.md wins when present; otherwise AGENTS.md is used alone.

Both files

Choose claude-md-and-agents-md in /config when teammates keep separate CLAUDE.md and AGENTS.md.

Providers

Some Bedrock / no-telemetry sessions still need an @AGENTS.md import from CLAUDE.md.

Value tip: one shared instruction file beats three drifting copies. Keep Claude-only quirks under a short CLAUDE.md import rather than forking the whole handbook.

Auto memory · Claude takes notes

On by default

Alongside files you write, Claude can save short learnings about your preferences, corrections, and project facts it cannot derive from the code. Notes live under the machine-local project memory folder; the index is loaded every session so you are not re-teaching “always use pnpm” every Monday.

/memory

Browse CLAUDE.md locations, toggle auto memory, and open the memory folder in your editor.

/context

Confirm which instruction files loaded this session before you burn tokens on a wrong playbook.

.claude/rules/

Split path-scoped rules (e.g. API-only conventions) so they load when matching files are in play — keep the root file short.

Value tip: put durable team standards in CLAUDE.md / AGENTS.md (shared via git). Leave personal corrections and ephemeral deadlines to auto memory — and prune the index if it grows past a couple hundred lines. Keep nested CLAUDE.md files in subfolders short too: since v2.1.309 one over the size limit loads only its beginning, so put the rules that matter at the top.

On-demand knowledge

Skills & verification loops

Skills are folders Claude loads when the task matches — instructions plus scripts and assets, not just a markdown note. Good skills teach judgment and close the loop with the same checks you would run yourself.

What a skill actually is

Think of a skill as a small toolkit: a description that tells Claude when to reach for it, plus files it can follow — prompts, helper scripts, fixtures, screenshots. Discovery is description-driven: if the “when to use” text matches the user’s intent, the skill surfaces; otherwise it stays out of the prompt and keeps context lean.

Where skills live

  • • Project skills under .claude/skills/ — shared with the repo
  • • Marketplace / plugin skills — reusable packs you install once
  • • Verification can be standalone, embedded in a skill, chained after another skill, or required on every PR path

Skill design tips

Skip the obvious

Do not restate what any competent engineer already knows. Spend skill text on project-specific judgment, naming, and failure modes.

Keep a Gotchas section

Capture recurring traps — flaky tests, environment quirks, “never do X here” — so Claude stops rediscovering them every session.

Progressive disclosure

Put the trigger description up front; park long scripts, fixtures, and deep docs in sibling files the skill can load only when needed.

Write for model triggering

The “when to use” description is how Claude discovers the skill. Be concrete about situations, not just the skill’s name.

Avoid over-railroading

Guardrails beat rigid scripts. Leave room for Claude to adapt when the repo or error surface does not match the happy path.

Encode verification loops

Turn the checks you would run by hand (lint, tests, screenshots, diff review) into steps the skill closes itself — so work does not stop at “looks done.”

Verification loops

The highest-leverage skills encode the manual checklist you already trust: typecheck, tests, lint, visual or API smoke checks, then a short “done when” definition. Claude keeps iterating until those gates pass instead of stopping at a plausible-looking diff. That is how skills turn “generate code” into “ship checked work.”

Standalone

A dedicated verify skill you invoke after a change.

Embedded

Checks baked into an implementation skill’s final steps.

Chained

Build skill hands off to a verify skill before declaring done.

Every PR

Verification that always runs as part of your PR / review path.

/skill-creator

Scaffold or refine a skill folder with structure and a trigger description — then edit the project-specific parts yourself.

/verify

High-level entry to run or attach verification so a change is not “done” until the checks you care about actually pass.

/skill-doctor

Audit which loaded skills go unused and what they cost in context — prune so always-on skills do not quietly tax every turn.

Delegation

Subagents & dynamic workflows

Each subagent gets its own context window and returns only the answer. Dynamic workflows go further: Claude writes an orchestration script that fans work across many parallel agents, verifies results, and keeps coordination out of your main transcript.

Use when

  • • Heavy research that would flood the main transcript
  • • Parallel independent tasks (explore A while planning B)
  • • Fresh review of code the main agent just wrote
  • • Pipeline stages (research → plan → implement) with clean handoffs
  • • Forked workers that should reuse the parent's warm prompt cache

Avoid when

  • • Tiny one-shot tasks (overhead exceeds benefit)
  • • Parallel edits to the same file (merge conflicts / race risk)
  • • Tightly sequential steps that each depend on the last micro-decision
  • • "Specialist" splits that always run together — a skill in the main session keeps the shared context instead of a lossy summary

Fold before you fan out

New · Oct 2026

Anthropic's Applied AI team now finds that one capable agent with progressively loaded skills and tools often beats a router-plus-specialists design on quality, and costs less time and tokens. The same test works inside a Claude Code session: before adding another subagent, ask whether the main session would do better seeing the whole story.

Keep in the main loop

Coupled steps whose results build on each other. Package the know-how as a skill so it loads only when needed.

Keep as a subagent

Truly independent parallel work, a fresh-context verifier, or a job that needs different permissions or tools.

Measure, then cut

Merge subagents that always run together first, then try folding the rest one at a time and keep only those that earn their own context.

Built-in

Explore

Read-only codebase discovery without polluting the parent session.

Built-in

Plan

Design an approach and tradeoffs before implementation.

Built-in

General-purpose

Flexible worker for bounded tasks that should return a summary.

Dynamic workflows

High leverage · high cost

For migrations, audits, adversarial review, or research that a single pass cannot finish cleanly, ask Claude to create a workflow (or include the keyword ultracode). Claude writes a harness that spawns many focused subagents, checks findings before folding them in, and can resume if interrupted. Expect meaningfully more usage than a normal session — scope the first run tightly.

Fan-out & synthesize

Split many independent units (files, claims, tickets), then merge structured results.

Adversarial verify

Pair each producer with a skeptic so self-preferential bias does not ship unchecked.

Loop until done

Keep spawning until a stop condition (clean tests, no new findings) instead of one fixed pass.

Session tip: /effort ultracode turns on automatic workflow decisions for substantive tasks while keeping the effort level you already set (it no longer forces xhigh). Toggle it off for routine work. Pair long workflows with auto mode so Claude is not blocked on every tool call.

Per-subagent effort (v2.1.292+): the Agent tool now takes an effort level, so you can ask Claude to run a quick lookup subagent at low effort and a verifier at high, without changing the main session. Combine it with the model choice: Haiku 5.5 at low effort for cheap scans, Opus 5.5 at high for the one agent whose answer you will act on.

A default effort for every subagent (v2.1.316+): subagents used to inherit the session's effort, so an xhigh main session quietly made every helper expensive too. Setting CLAUDE_CODE_SUBAGENT_EFFORT (for example to low) gives subagents their own fallback level whenever nothing more specific is named. Keep the main thread at the effort the hard thinking needs, let fan-out workers run lean by default, and still ask for high effort on the one verifier that matters.

Subagent context and workflow model (v2.1.296+): a custom agent can set autoCompactWindow in its frontmatter so a long-running worker compacts earlier than the main session and stays lean. To keep a whole workflow on one model, set CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL (for example Sonnet 5.5 for a wide fan-out) while your other subagents keep their own model.

Custom agents live under .claude/agents/. Put team policy in CLAUDE.md, reusable multi-step procedures in skills, and consider hooks later for automation around tool events. Saved workflows can live under ~/.claude/workflows or ship inside a skill. For skill design tips and verification loops, see Skills & verification loops. For many independent full sessions (not nested subagents), see Parallel sessions & agent view.

Orchestration

Parallel sessions, agent view & Projects

Subagents share one conversation. Agent view and the desktop sidebar steer many independent sessions. Redesigned Projects add a coordinator that owns a goal and fans work into cloud threads with shared memory.

Projects · coordinator + threads

Beta · Pro / Max cloud

Instead of you splitting a build into handoffs, you describe the outcome and Claude directs the work: scope, delegate, review, assemble. Examples Anthropic highlights include profiling checkout latency across endpoints in parallel, or retiring a deprecated API across web, mobile, and backend repos with one thread per repo.

Coordinator chat

Brief the goal once. Claude scopes the work, routes tasks to threads, reviews outputs, and assembles what landed — including from your phone.

Worker threads

Each thread is a full Claude Code cloud session on its own branch and repo copy. Overlaps become ordinary merge conflicts.

Shared memory

Decisions, status, and style accumulate across threads so you are not re-explaining “release moved to Friday” every morning.

Project library

Files you add and artifacts Claude produces stay collectible, so later threads build on prior deliverables instead of starting blank.

How to steer

  • • Set a goal plus repo(s) or other context when you open the project
  • • Guide from the main chat or dive into a single thread for detail
  • • Configure cloud environment, connectors, plugins, instructions, model, and effort for coordinator and workers
  • • Threads can still spawn subagents, loops, and dynamic workflows when a slice needs more horsepower

Usage reality check

Every thread is a full session, so Projects can burn through plan limits faster than a single chat. Watch project-specific usage. Threads run in the cloud today; local tools and private-network access are still rolling out. Beta access started with select Pro/Max cloud users and expands over time — existing projects keep working until upgraded.

Value tip: treat the coordinator like a chief of staff — clear goals, explicit merge order, and narrow thread scopes. Parallel workers pay off when they touch different surfaces; same-file thrash still costs you merge time.

Agent view (CLI)

Research preview

Run claude agents (or press the left arrow from a session) to open one screen for every background session: waiting on you, still working, or done. Peek the last turn, answer a permission inline, or press enter to attach to the full transcript. Background the current session with /bg, or start detached with claude --bg [task].

Fan out ideas

Dispatch several bounded tasks (optionally each with a skill), then return to a list of PRs or findings ready to review.

Babysit long loops

PR watchers, dashboard refreshers, and other looping jobs stay visible with status — jump in only when one needs you.

Side-question without derailing

From a mid-task session, open agent view, ask a quick codebase question elsewhere, then arrow back. Peek shows the answer when it lands.

Scan what shipped

Status words and peek titles make it obvious which sessions produced a PR versus which are still blocked on a decision.

Value tip: keep each background session narrowly scoped and named (/rename). Parallel sessions multiply usage the same way parallel humans do — agent view reduces the cognitive tax, not the token bill.

Desktop · parallel workspace

The redesigned Claude Code desktop app is built for the same orchestrator seat: a sidebar of active sessions (filter by status, project, or environment), drag-and-drop panes for terminal, diff, preview, and chat, plus an in-app file editor so you can tweak and ship without leaving the app.

  • • Side chat (⌘/Ctrl + ;) borrows context for a question without writing back into the main thread
  • • Verbose / Normal / Summary view modes dial tool-call noise up or down
  • • Usage button shows context window and session usage at a glance
  • • Merged or closed PR sessions archive themselves so the sidebar stays live

When to use which

  • Subagent / workflow — one parent session needs isolated research or a scripted fan-out; results fold back as a summary.
  • Agent view / desktop sidebar — several independent tickets or repos should each keep their own transcript and PR.
  • Projects (coordinator) — one multi-part goal should own shared memory, a library of artifacts, and cloud threads that Claude routes for you.
  • Routine — the job should wake on a schedule or GitHub event without any laptop session open.

Prefer one well-scoped unit of work over five vague ones. Parallelism pays when the work units do not thrash the same files.

Automation & artifacts

Routines & shareable artifacts

Routines (research preview) run Claude Code jobs on Anthropic’s web infrastructure — scheduled, webhook-driven, or GitHub-triggered — so your laptop does not need to stay open. Artifacts turn a session into a live, org-private page you can share and republish in place.

Routines

Think of a routine as a Claude Code session that starts without you: it wakes on a schedule or an event, does bounded work under your subscription, and reports back. Caps apply per day and differ by plan; routine runs also consume normal usage.

Scheduled

Cron-style or calendar runs — morning triage, nightly health checks, weekly digests.

API webhook

Kick off from your own systems when an external event fires (deploy finished, alert opened).

GitHub events

Respond to PR opens, reviews, pushes, or issue labels without babysitting the CLI on your laptop.

Backlog triage

Label, prioritize, and draft first replies on new issues so humans start from a sorted queue.

Deploy verification

After a release signal, smoke-check staging/prod signals and open a short status note if something looks off.

PR babysitting

Watch open PRs for CI flakes, review comments, or missing checklist items and nudge or patch within policy.

Daily routine caps (approx.)

From Anthropic’s routines announcement — treat as order-of-magnitude, not a billing guarantee. Exact limits can change.

PlanRough daily cap
Pro~5 / day
Max~15 / day
Team / Enterprise~25 / day

Getting started

  • • Open claude.ai/code to create and manage routines in the browser
  • • Or use /schedule from the CLI to set up a recurring or event-tied job
  • • Keep each routine narrowly scoped so caps and usage stay predictable

Artifacts

Team / Enterprise · beta

Artifacts turn session context into a live, shareable page — PR walkthroughs, incident timelines, design notes — that can republish in place as the story updates. Published artifacts can also call each viewer’s own MCP connectors on open, so a dashboard pulls live data (and can take approved actions) instead of freezing a one-time snapshot. Viewers approve connector access before the first call.

PR walkthroughs

A durable narrative of what changed and why, linked from the pull request.

Incident timelines

A living postmortem draft that updates as investigation continues.

Live MCP data

Name the connector in the prompt so the page refreshes from GitHub, Notion, or your own tools on each view.

Share & co-edit

Public links when you need them; editor roles on Team/Enterprise for shared editing.

Where cloud sessions run

By default, routines and Claude Code on the web use Anthropic-hosted compute. Team and Enterprise orgs that need sessions next to internal networks, custom toolchains, or compliance boundaries can deploy self-hosted environments (public beta): runners inside your network pick up sessions from web, mobile, desktop, or routines. Prefer hosted unless you have a concrete network or compliance reason — self-hosting needs a platform team to own images and capacity.

Quality

Verify before you ship

The cheapest bug is the one Claude catches inside the session. Anthropic’s Claude Code team now does most review before a pull request exists — and reports more merged PRs with fewer reverts.

1

Hand Claude a check it can run

A test command, a build, a linter, or a screenshot to compare against. Put these in a short CLAUDE.md so every session knows how to prove its work.

2

Ask for evidence, not “done”

Request the actual command output in the reply. A claim of success without a run is the most common way bad changes slip through.

3

Review in a clean context

Spin up a subagent (or run /code-review and /security-review) that sees only the diff, not the reasoning that produced it. Fresh eyes catch what the author session rationalized.

4

Fix repeat findings at the source

If the same comment keeps appearing, move it into CLAUDE.md, a lint rule, a skill, or a REVIEW.md file instead of correcting it by hand each time.

Layers, not a single gate

Each layer filters some problems; bar width shows how much is still in flight (illustrative).

Self-check before the PRClaude
Runs tests, build, lint; shows the output
Fresh-context reviewSubagent
A second agent reads only the diff
Required CIAutomated
Red blocks the merge
AI + security reviewAutomated
Findings must be resolved before merge
Human approvalPerson
Scaled by risk: zero, one, or two people
Flags, staged release, rollbackRecovery
Make undo cheap for what slips through
Why it pays inside a session

A failed check found now costs one more turn. Found after merge it costs a revert, a new session, and re-loading all the context you already paid for.

A good REVIEW.md is short
  • • Say what “broken” means in this repo.
  • • Cap nitpicks and list paths to skip.
  • • Require a file and line as evidence.
  • • Open the summary with a count; say plainly when nothing needs fixing.
Match review depth to risk

Quick pass for routine edits, a deep one where a miss is expensive. Keep auth, billing, CI and release paths behind a human via CODEOWNERS; a bot approval never replaces a required person.

Which tests give Claude the strongest evidence

New · Nov 2026 · value bars are editorial

Verification loops are what let you run many sessions in parallel instead of checking every diff yourself. Flaky tests teach the agent to re-run instead of fix, and slow ones get run less, so invest in a few fast, trustworthy kinds.

End-to-endStart here

Drives a real user flow; hard to fool because the feature either works or it doesn’t. Shows what broke, not just a timeout.

PropertyEdge cases

State a rule that must always hold (round-trip, invariant, idempotent, matches a naive version) and let a library throw thousands of inputs at it.

DifferentialRewrites & migrations

Feed old and new systems the same random or sampled inputs; any difference is a bug or an approved change.

Write a verify skill

Put a skill named verify in .claude/skills/ near the code, explaining how to boot and drive the app. Claude reaches for it before committing; keep it fast and solid.

Three strikes, then a human

Let Claude fix failing checks itself, but stop and hand over if a check is still red after three rounds.

Cheap checks first

Tests, build and lint run locally before a PR, so shared CI and review time is not spent on bugs the session could catch.

Checks out of reach

A change must never be able to edit the rule that judges it. Keep gating rules on the base branch.

No flaky-test escapes

No retries, sleeps or skips to turn red green. Find the root cause, or remove the test and record why.

Roll out gates in observe mode

Log what a new gate would block, review false positives, then enforce, with a written escape hatch so Claude never gets stuck.

Supervised hardening loop: let Claude try to break staging

New · Nov 2026

For load, failure and memory work, one long-running session acts as a coordinator: pick a failure scenario (kill a node, stall the database, deploy mid-spike), run the load script, read telemetry, propose a fix, ship it to staging, repeat. Subagents take the parallel pieces. Anthropic used this pattern for weeks before a large launch, so it pays off only with a real staging copy and clean metrics.

1
Prompt the outcome

Ask for a result (“survive 10× real traffic on staging”), not a list of fixes. The agent picks the next failure to chase.

2
Write invariants first

Two or three rules that must never break, e.g. “acknowledged edits are never lost”. Put them in the kickoff prompt or CLAUDE.md so they survive compaction.

3
Draw the approval line

Reversible changes (a query rewrite, a flag) Claude ships to staging itself. Schema, storage layout and other one-way doors: stop, list options, recommend one, wait.

4
Make the system legible

Connect your observability MCP and let Claude add missing telemetry every loop. Fewer opaque dependencies means each number traces back to code it can change.

Watch forWhat to do
Goal drift after many loopsKeep the goal and invariants written down where every compaction reloads them; restate only if the agent wanders.
Token burnWatch /usage hourly. If the coordinator and subagents cost too much, one agent running the same loop also works.
Fixes reaching prodShip hardening fixes behind runtime flags so the scenarios you rehearsed become a flag flip in prod.

Scale

Large codebases & migrations

Don’t make Claude invent a map of the whole monorepo every session. For day-to-day work, scope the workspace. For language or framework ports, invest in the process loop — rules, judges, and adversarial review — not one-off file rewrites.

Scope to a subdirectory

Open Claude Code where the work lives. Smaller trees mean fewer accidental file pulls and clearer defaults.

Per-directory CLAUDE.md

Local test/lint/build recipes and module conventions beat one giant root file for every package.

Codebase map markdown

Maintain a short map of domains, entrypoints, and “ask before editing” zones. Link it from CLAUDE.md.

LSP / symbol search first

Prefer go-to-definition and symbol search over dumping huge grep results into context.

Large code migrations

Dynamic workflows · high cost

Anthropic’s internal ports treat migration as fixing the loop that produces code: a rulebook agents follow, mechanical verification that grades both sides, and adversarial reviewers that catch drift. Pair with dynamic workflows when the work shards into hundreds of parallel units.

1 · Judge first

Build a portable referee (tests, parity harness, or scenario diffs) that can score old and new code the same way before you fan out translation.

2 · Rulebook + map

Write translation rules, a dependency map for batch order, and a gap inventory for idioms the new language will not forgive.

3 · Stress-test rules

Translate a tiny slice (or attack the redesign doc) only to harden rules. Throw the trial output away; do not ship the shakedown cruise.

4 · Fan-out with skeptics

Implement in parallel batches, keep reviewers adversarial in fresh contexts, and promote recurring mistakes into the rulebook instead of hand-patching files.

5 · Compile → smoke → match

Let compiler errors, crashes, and behavior diffs write the queue. Serialize expensive rebuilds; fix patterns upstream and regenerate touched batches.

6 · Route models by role

Use smaller models for high-volume implementer fan-out; reserve the strongest models for rule writing and review. Track tokens — big migrations are expensive by design.

Practical defaults: make “done” mean an artifact exists on disk so runs resume cleanly; front-load human time on the rulebook and stress test; ignore one-off failures and chase patterns.

Reference

Cheat sheet

Commands and gestures you’ll reach for when optimizing session value.

CommandWhat it does
/clearWipe conversation; start a distinct task with a clean context
/compactSummarize history to free window space (costs a rewrite)
/contextShow what is loaded (CLAUDE.md, skills, MCP, etc.)
/modelSelect model (default stays Opus 5.5; /model sonnet → Sonnet 5.5 from v2.1.284; /model fable → Fable 5.2 from v2.1.321) — set at session start to protect cache
/effortDial how much work before check-in (low→medium→high→xhigh); on Opus 5.5 / Fable 5.1 mid-session changes keep cache
/effort statusShow the session’s current effort level (re-check after model upgrades)
/effort ultracodeToggle Ultracode on/off (Tab in /effort) — auto dynamic workflows; no longer forces xhigh (v2.1.284+)
subagent effortAsk for a subagent at a set effort (e.g. “run a low-effort Haiku 5.5 agent to scan logs”), v2.1.292+; set CLAUDE_CODE_SUBAGENT_EFFORT for a default subagent level instead of inheriting the session (v2.1.316+)
autoCompactWindowSubagent frontmatter field: let a long worker compact earlier than the main session (v2.1.296+)
/usage · /costSession token and cost readout — compare Sonnet 5.5 vs Opus 5.5 and effort; flags max effort, workflows, always-on context, big tool results (v2.1.299+); press f to apply the suggested one-line fixes (v2.1.305+)
idleCompactionsettings.json switch (default on, v2.1.299+): auto-compact 200K+ idle chats before the 1h cache expires; threshold via CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS
/claude-api prompt-auditScan CLAUDE.md / skills for prompting anti-patterns after a model migration
ultrathink (keyword)Run one turn at xhigh effort without changing session effort; typed mid-turn it raises the rest of that turn (v2.1.311+ terminal, v2.1.316+ VS Code)
ultracode (keyword)Opt one prompt into a dynamic workflow without changing session effort
CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1Experimental Code Mode (v2.1.323+): Claude writes JavaScript that batches many tool calls in one step; Ctrl+O shows the code
/mcpManage MCP server connections and tools
/agentsConfigure custom agents under .claude/agents/ (not the same as agent view)
claude agentsOpen agent view — dashboard of background sessions waiting on you or still working
/bgBackground the current session into agent view without ending it
claude --bg …Launch a fresh session already detached into agent view
Projects (cloud)Coordinator + threads with shared memory/library — Claude scopes, delegates, and assembles a multi-part goal
/forkCopy the conversation into a new background session while you keep working
fork subagentsSubagents that inherit the current conversation; on by default everywhere since v2.1.302 (CLAUDE_CODE_FORK_SUBAGENT=0 turns them off)
/skill-doctorSee which loaded skills go unused and what they cost in context
/configEnable dynamic workflows on Pro; other Claude Code settings
/initBootstrap a CLAUDE.md for the project
AGENTS.mdShared agent instructions — used when no CLAUDE.md is on the path (v2.1.277+); or @-import from CLAUDE.md
/memoryOpen instruction files, toggle auto memory, browse Claude’s saved notes
/config · Project instructionsChoose CLAUDE.md only, AGENTS.md fallback, or both files together
/skill-creatorScaffold or refine an on-demand skill (instructions + scripts + assets)
/code-review · /security-reviewRun a local review pass on your diff before opening a PR — pair with a fresh-context subagent
REVIEW.mdShort repo-specific review rules: what “broken” means, paths to skip, evidence required
/auto-mode-setupGuided setup that teaches auto mode about your environment from the project and recent sessions (v2.1.304+)
/verifyRun or attach verification so work is not done until checks pass
.claude/skills/verifyA repo skill describing how to boot and drive your app end to end; Claude uses it to smoke-test before committing
hardening loopOne coordinator session + observability MCP repeatedly breaks staging and fixes it; state invariants up front and make it stop for hard-to-undo changes
/goalKeep working across turns until a completion check resolves (unattended loops)
/scheduleCreate a routine: scheduled, webhook, or GitHub-triggered Claude Code job
/renameName the session for later recall
/rewindTrim the end of history without full rewrite (cache-friendlier)
Shift+TabCycle permission modes (auto mode helps long workflow runs)
@fileAttach a file into context (prefer over typing bare paths)
Ctrl+BBackground a long-running command while you continue

Attribution

Sources

This guide synthesizes themes from Anthropic’s Claude Code blog posts. Read the originals for authoritative detail; copy here is original educational paraphrase.

  1. 1Maximizing the value of your Claude Code sessionshttps://claude.com/blog/maximizing-the-value-of-your-claude-code-sessions
  2. 2Claude models explained: choosing the best model for your use casehttps://claude.com/blog/claude-models-explained-choosing-the-best-model-for-your-use-case
  3. 3Claude model and effort level in Claude Codehttps://claude.com/blog/claude-model-and-effort-level-in-claude-code
  4. 4Introducing Claude Opus 5.5https://www.anthropic.com/claude-opus-5-5
  5. 5What a task costs on Opus 5.5https://claude.com/blog/what-a-task-costs-on-opus-5-5
  6. 6Claude Opus 5.5 built for coding sessions that use more contexthttps://claude.com/blog/claude-opus-5-5-built-for-coding-sessions-that-use-more-context
  7. 7Introducing Claude Sonnet 5.5https://www.anthropic.com/claude-sonnet-5-5
  8. 8Building with Claude Sonnet 5.5https://claude.dev/blog/building-with-claude-sonnet-5-5/
  9. 9Introducing Claude Haiku 5.5https://www.anthropic.com/claude-haiku-5-5
  10. 10Introducing Claude Fable 5.2 and Claude Mythos 5.2 (Anthropic)https://www.anthropic.com/claude-fable-and-mythos-5-2
  11. 11Claude Code changelog (2.1.292 Agent effort, 2.1.293 Haiku 5.5, 2.1.296 subagent compaction & Sonnet 5.5 cache price, 2.1.299 idle compaction & /usage warnings, 2.1.302 fork subagents default, 2.1.304 resume-cost warning & /auto-mode-setup, 2.1.305 /usage one-key fixes, 2.1.307 sibling fork awareness, 2.1.309 nested CLAUDE.md size cap, 2.1.311 ultrathink at xhigh, 2.1.316 default subagent effort, 2.1.321 Fable 5.2 default, 2.1.323 experimental Code Mode)https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md
  12. 12Run tool calls from code with Code Mode (Claude Code docs)https://code.claude.com/docs/en/code-mode
  13. 13Claude API pricing (prompt caching rates)https://platform.claude.com/docs/en/about-claude/pricing
  14. 14Building agents: When to fold subagents into your main agent loophttps://claude.com/resources/articles/building-agents-when-to-fold-subagents-into-your-main-agent-loop
  15. 15Subagents in Claude Codehttps://claude.com/blog/subagents-in-claude-code
  16. 16Using CLAUDE.md fileshttps://claude.com/blog/using-claude-md-files
  17. 17How Claude remembers your project (CLAUDE.md, AGENTS.md, auto memory)https://code.claude.com/docs/en/memory
  18. 18How Claude Code works in large codebaseshttps://claude.com/blog/how-claude-code-works-in-large-codebases-best-practices-and-where-to-start
  19. 19Introducing dynamic workflows in Claude Codehttps://claude.com/blog/introducing-dynamic-workflows-in-claude-code
  20. 20A harness for every task: dynamic workflows in Claude Codehttps://claude.com/blog/a-harness-for-every-task-dynamic-workflows-in-claude-code
  21. 21Auto mode is now the default in Claude Codehttps://claude.com/blog/auto-mode-default-in-claude-code
  22. 22Lessons from building Claude Code: How we use skillshttps://claude.com/blog/lessons-from-building-claude-code-how-we-use-skills
  23. 23Building verification loops in Claude Code with skillshttps://claude.com/blog/building-verification-loops-in-claude-code-with-skills
  24. 24How the Claude Code team does code reviewhttps://claude.dev/blog/solving-code-review-at-anthropic/
  25. 25How the Claude Code team thinks about verificationhttps://claude.dev/blog/how-the-claude-code-team-thinks-about-verification/
  26. 26Using a “chaos loop” to harden the Claude Docs launch (claude.dev, Nov 17 2026)https://claude.dev/blog/chaos-loop-claude-docs-launch
  27. 27Introducing routines in Claude Codehttps://claude.com/blog/introducing-routines-in-claude-code
  28. 28Claude Code now supports artifactshttps://claude.com/blog/artifacts-in-claude-code
  29. 29How Anthropic runs large-scale code migrations with Claude Codehttps://claude.com/blog/ai-code-migration
  30. 30Self-hosted environments for Claude Codehttps://claude.com/blog/run-claude-code-sessions-on-your-own-compute
  31. 31Agent view in Claude Codehttps://claude.com/blog/agent-view-in-claude-code
  32. 32Redesigning Claude Code on desktop for parallel agentshttps://claude.com/blog/claude-code-desktop-redesign
  33. 33Projects redesigned: from folder to conversationhttps://claude.com/blog/projects-redesigned

Content last reviewed

Educational site · not affiliated with Anthropic · charts marked illustrative · Back to top