AI Learning
intermediate ⏱️ 14 min read · 🎬 ~32 min video

What's New in Claude Code: Routines, Agent View, Auto Mode, and More

A tour of the latest Claude Code features: routines for async automation, agent view for managing parallel sessions, auto mode for safer delegation, hooks for deterministic control, and the redesigned desktop app.

This lesson is original educational writing based on this video by Anthropic (published May 20, 2026). All credit for the original content goes to the creators.

#claude-code #productivity #agents #automation
Video thumbnail: What's New in Claude Code: Routines, Agent View, Auto Mode, and More
Original video — all credit to the creators. Watch the original on YouTube ↗

1. The big picture: from synchronous to async coding

When Claude Code first launched, the model for using it was simple and sequential: you typed a prompt, Claude worked, you watched, you reviewed. That model still works, and it is still useful. But the pace of new features in 2025–2026 reflects a different vision: one where you are an orchestrator, not a prompt-by-prompt driver.

The average developer on a Claude Max or Team plan is now spending more than 20 hours a week running Claude Code sessions. Many of those sessions are not ones the developer manually kicked off — they were started by routines reacting to events, by CI autofix responding to a failed build, or by a code-review agent triggered when a PR opened.

The features covered in this lesson sit on a spectrum from “less interruption during a session” (auto mode, context management) to “Claude works even when you’re not there” (routines, autofix). Understanding where each feature sits on that spectrum helps you decide when to reach for it.

FullysynchronousFullyasyncPermissionpromptsAuto mode(smart delegation)Agent view(parallel sessions)Routines(event-driven)
The spectrum of Claude Code delegation: from synchronous prompting to fully async routines that fire without you.

2. Auto mode: safer delegation without the approval fatigue

The original Claude Code permission model asked you to approve (or deny) every shell command and file write. When you approve 99% of requests automatically because they’re routine, your eyes glaze over — and you stop catching the 1% that actually matters. That human-factors problem was the motivation for auto mode.

Auto mode routes permission decisions to a separate classifier model rather than interrupting you. If a command looks routine, it proceeds. If something looks suspicious — an unexpected network call, a command that tries to reach outside the project — the classifier denies it automatically and surfaces only that result to you.

To switch to auto mode in a session, press Shift+Tab until the mode indicator shows “auto”. You can also set it as your default in .claude/settings.json:

{
  "mode": "auto"
}

The safety posture here is counter-intuitive: because you are no longer approving safe requests, the ones that do surface to you get full attention. In internal red-team exercises at Anthropic, the team built a corpus of thousands of agent trajectories and had the classifier label each permission prompt before deploying. They then had professional red teamers try to prompt-inject through auto mode and used those attacks to build evals. The result is that auto mode catches edge cases that prompt-fatigue causes humans to miss.

Check your understanding

2 questions · your answers are saved in this browser only

  1. 1. Why is auto mode considered safer than manually approving every permission prompt?

  2. 2. How do you activate auto mode during an interactive Claude Code session?

3. Routines: Claude Code that prompts itself

Routines are the biggest conceptual shift in recent Claude Code releases. A routine is a higher-order prompt: instead of you typing a prompt to Claude, you configure a routine that types the prompt for you — on a schedule, on a webhook, or on an API call.

One engineer at Anthropic described having a routine that watches for every GitHub issue filed about voice mode. The routine picks up new issues, implements a fix, and opens a PR — all before the engineer who owns that feature opens their laptop. A second routine watches for any unaddressed bug report older than five hours and does the same. The result: teammates regularly find their own bugs already fixed by someone else’s Claude routine.

Routines are configured in the Claude Code desktop app (or via the /schedule slash command) and consist of three parts:

  1. Trigger — when does this run? Options include cron schedules (e.g. 0 9 * * 1-5 for weekdays at 9 AM), incoming webhooks, and arbitrary API calls.
  2. Context — what should Claude know? You can pass a system prompt, point at a CLAUDE.md, and inject dynamic data from the event payload.
  3. Steering — what is the goal? A clear, verifiable task description. Routines work best when the agent has a concrete way to confirm success (tests pass, PR opens, Slack message sent).
# Schedule a routine via the CLI (equivalent of the desktop UI)
/schedule "Every weekday morning, check open PRs for failing CI and open fix PRs" \
  --cron "0 9 * * 1-5" \
  --context "$(cat .claude/routines/ci-fix.md)"

Routines can run locally on your machine (requiring it to be on) or on remote cloud compute so they continue even when your laptop is closed. Remote execution is available on Pro, Max, Team, and Enterprise plans.

4. Agent view and the redesigned desktop app

Once you have more than two or three Claude Code sessions running at once, keeping track of them in separate terminal tabs breaks down. Agent view is a new surface — available both inside the Claude Code desktop app and as a panel in the CLI — that shows you all active sessions at a glance:

  • Which sessions are running (actively working)
  • Which are blocked (waiting for your input)
  • Which are done (PR opened, task complete, or stopped)

From agent view you can reply inline to unblock a session, jump into a specific session for closer inspection, or dismiss a completed one — all without losing your place in any other session.

The desktop app was redesigned around the same idea. It is no longer just a nicer terminal; it is a control plane for parallel agentic work:

  • A sidebar lists all running and recent sessions across repos
  • A drag-and-drop layout lets you arrange the terminal, file editor, diff viewer, and preview pane wherever you want
  • A built-in browser preview lets Claude start a dev server and see the running app, catch visual regressions, and click UI elements — all without switching applications
  • Visual indicators on each session card show status so you can scan the sidebar instead of switching tabs

The IDE extension for VS Code and JetBrains uses the same underlying Claude Agent SDK, so the experience is consistent whether you are in the desktop app, the terminal, or your editor.

5. Hooks: deterministic control at lifecycle events

Claude Code is good at following instructions in a CLAUDE.md file — most of the time. If you need something to happen every single time without exception, that is what hooks are for.

Hooks are shell commands that Claude Code runs at specific lifecycle events, independently of what Claude decides to do. They are configured in .claude/settings.json and can be checked in so every team member gets them automatically.

The four most useful lifecycle events:

EventWhen it firesTypical use
postToolUseAfter any tool call completesAuto-format edited files
preToolUseBefore a tool call runsBlock dangerous operations
stopWhen Claude finishes respondingSend a desktop notification
userPromptSubmitWhen you submit a promptLog prompts for compliance

A preToolUse hook receives the tool name and its arguments as JSON on stdin. If the hook exits with code 2, the tool call is blocked and the stderr message is fed back to Claude as the reason. Exit code 0 means proceed.

{
  "hooks": {
    "postToolUse": [
      {
        "matcher": "Edit|MultiEdit",
        "command": "bash .claude/hooks/format.sh"
      }
    ],
    "preToolUse": [
      {
        "matcher": "Bash",
        "command": "bash .claude/hooks/block-dangerous.sh"
      }
    ]
  }
}
# .claude/hooks/block-dangerous.sh
input=$(cat)
if echo "$input" | grep -qE 'rm -rf|DROP TABLE|force push'; then
  echo "Blocked: destructive command pattern detected" >&2
  exit 2
fi
exit 0

Check your understanding

2 questions · your answers are saved in this browser only

  1. 1. What exit code should a preToolUse hook return to block a tool call?

  2. 2. Why use a hook instead of putting an instruction in CLAUDE.md?

6. Context management: /compact, /clear, and sub-agents

The context window is Claude’s working memory. Every file read, every command result, every round of back-and-forth conversation occupies space. When that space fills up, the quality of responses degrades — Claude loses track of earlier decisions and constraints.

Three techniques keep context healthy across a long session:

/compact — Summarizes everything up to this point and inserts the summary as a seed for the next stretch of conversation. Good for: you are mid-feature and need to keep going but the window is filling up. You retain continuity but the old tool-call results are discarded.

/clear — Wipes everything. Claude.md is reloaded, but no conversation history carries over. Good for: you have finished one feature and are starting a completely different one. Previous context would introduce bias.

/context — Shows you what is consuming the window right now: a breakdown by category and a graphic of fill level. Use this before deciding whether to compact or clear.

Sub-agents — When you need an answer but not the journey, spin up a sub-agent. Sub-agents run with their own independent context window, do the research or transformation, and return only the result to the main agent. Example: “Where is the authentication endpoint?” is a perfect sub-agent task — you want the file path, not the file-reading transcript.

MCP server hygiene — Every MCP server you have connected loads all its tool definitions into context by default. Disconnect MCP servers that are irrelevant to the current task to reclaim that space.

Check your understanding

2 questions · your answers are saved in this browser only

  1. 1. You just finished implementing a large feature and want to start on something completely unrelated. Which context command should you use?

  2. 2. What is the main advantage of using a sub-agent instead of letting the main agent do research inline?

Build it yourself

Follow these exact steps to reproduce it yourself · estimated time: ~25 min

Prerequisites

  • Claude Code installed and authenticated (npm install -g @anthropic-ai/claude-code)
  • A Claude Pro, Max, Team, or Enterprise plan for full feature access
  • A git repository to experiment in

Step 1 — Switch to auto mode and feel the difference

Open an interactive Claude Code session in a repository you work on regularly:

claude

Press Shift+Tab once or twice until the status bar shows auto. Then give Claude a meaningful task — something that would normally trigger 5–10 permission prompts:

Add a utility function that reads all .log files in the project root and returns
the ten most recent lines from each. Write a unit test for it. Run the test.

Notice: no permission prompts for file reads, writes, or test runs. If the test runner unexpectedly tries to reach an external URL, that surfaces to you. Let this run to completion.

To make auto mode your default, create or edit .claude/settings.json:

{
  "mode": "auto"
}

Step 2 — Set up a hook for auto-formatting

In the same repository, create a hooks directory and a simple formatting hook:

mkdir -p .claude/hooks

Create .claude/hooks/format.sh:

#!/usr/bin/env bash
# Read the tool input JSON from stdin
input=$(cat)
# Extract the file path that was just edited
file=$(echo "$input" | python3 -c "import json,sys; d=json.load(sys.stdin); print(d.get('path',''))" 2>/dev/null)

case "$file" in
  *.ts|*.tsx|*.js|*.jsx)  npx prettier --write "$file" 2>/dev/null ;;
  *.py)                   python3 -m ruff format "$file" 2>/dev/null ;;
  *.go)                   gofmt -w "$file" 2>/dev/null ;;
esac
exit 0
chmod +x .claude/hooks/format.sh

Wire it into .claude/settings.json:

{
  "mode": "auto",
  "hooks": {
    "postToolUse": [
      {
        "matcher": "Edit|MultiEdit",
        "command": "bash $CLAUDE_PROJECT_DIR/.claude/hooks/format.sh"
      }
    ]
  }
}

Ask Claude to make an edit and watch the formatter run automatically after every file change.

Step 3 — Create your first routine

In the Claude Code desktop app (or CLI via /schedule), create a simple routine:

Goal: Every weekday morning, look for any open GitHub issues labelled bug that have no linked PR, pick the simplest one, implement a fix, and open a draft PR.

Via the desktop app: Open the Routines panel → New Routine → fill in the trigger (cron 0 9 * * 1-5), paste the goal above as the task description, and set the context to your project’s CLAUDE.md.

Via the CLI:

/schedule "Check for open bug issues with no linked PR, pick the simplest one,
implement a fix, and open a draft PR tagging me for review" --cron "0 9 * * 1-5"

Run it manually once to verify the routine works before leaving it on the schedule:

/run <routine-name>

Step 4 — Practice context management

Start a fresh session and work on a multi-file feature until you see the context warning in the bottom right corner. Then:

  1. Run /context to see what is taking up the most space.
  2. If you need to keep going on the same feature, run /compact. Ask Claude to continue — verify it remembers the key decisions.
  3. Start a completely new feature. This time run /clear first. Notice how Claude has no knowledge of the previous session (but CLAUDE.md is still loaded).

Expected result: You can now deliberately control context window health instead of waiting for it to fill up and degrade. This is one of the highest-leverage habits for long multi-hour Claude Code sessions.

Where to go next

Related lessons

intermediate 🎬 Anthropic · ~19 min

AI with Claude on AWS: From Code to Orchestration

Stand up Claude Code on Amazon Bedrock, teach it your team's conventions with CLAUDE.md and Agent Skills, then graduate to full multi-step orchestration with Lambda and Step Functions.

#agents #claude-code #productivity
intermediate 🎬 Anthropic · ~37 min

Stop Babysitting Your Agents: From Approval Mode to Orchestration

The workflows Claude Code engineers use to stop hand-holding their AI and start orchestrating it — permission architecture, verification-first design, parallel fanout, and headless automation.

#claude-code #agentic-coding #agents #productivity #multiagent
advanced 🎬 Anthropic · ~9 min

Agent Battle: Build the Best Diamond-Mining Agent

An Anthropic workshop where participants build diamond-mining agents in 45 minutes and compete on a live leaderboard. Learn agent configuration, eval-driven improvement, and what separates winning architectures.

#agents #evaluation #claude-code