01 — Helicopter View · Claude Code Routines

Claude Code Routines

Reusable agentic workflows, parallel sessions, and 1-hour prompt caching in the new desktop

1hPrompt Cache TTL
3xParallel Sessions
80%LSP Token Savings
The Problem
One Session, One Task, Manual Prompting
You prompt each step by hand. Context dies on every break (5-min cache TTL). Multi-step workflows mean either babysitting a single session or trusting a bash script with no reasoning. The agent forgets what comes next.
What Are Routines
Saved Agentic Workflows With Branching Reasoning

A Routine is a defined sequence of agentic steps Claude Code executes without per-step prompting. Each step is a prompt-plus-tool-call pattern with conditional branching.

Unlike a bash script, the agent still reasons at each step. Unlike a one-shot prompt, the structure is reusable and pauseable.

Three components: trigger (slash command, file change, manual), steps (prompt + allowed tools + on_fail branch), completion condition.

TRIGGER /blog-check STEP 1 · LINT tools: read, edit, bash STEP 2 · VERIFY on_fail: add defaults STEP 3 · BUILD on_fail: fix & retry retry APPROVAL GATE COMMIT
Mental Model
Agent as Workflow Executor
Old Claude Code: conversation partner you nudge step-by-step. New Claude Code: workflow executor you hand a shape to. The reasoning stays. The pushing-forward disappears.
Routine Shape
YAML Definition
name: blog-post-check trigger: manual steps: - prompt: "Lint MDX" tools: [read, edit] - prompt: "Run build" tools: [bash] on_fail: "Fix & retry" - prompt: "Stage & commit" requires_approval: true
~90s vs 6-8 min manual.
Multi-Session
Parallel Contexts in One App
Two-to-three sessions at once. One focused. One background Routine. One quick lookup that does not pollute the main thread. Shared filesystem means serialise file edits, not attention.
Session A|| Session B|| Session C
1-Hour Prompt Cache
Cache Survives Your Coffee Break
v2.1.108 adds ENABLE_PROMPT_CACHING_1H=true. Default 5-min TTL went cold on every meeting; 1h TTL survives standups and reviews. Hit rate jumped from ~60% to ~85% in my use.
~/.zshrc export ENABLE_PROMPT_CACHING_1H=true
LSP-over-Grep Hooks
Query the Language Server, Not the Filesystem
Instead of grepping, Claude Code queries your project's LSP for definitions, references, and types. Claimed 80% token savings (your mileage varies by LSP quality). Answers about code structure are more accurate, fewer "let me search for that" steps.
Before vs After Routines
What Actually Changed
DimensionOld Claude CodeWith Routines + Multi-Session
WorkflowManual prompt per stepAgent executes defined shape
SessionsOne at a time2-3 parallel contexts
Cache TTL5 minutes60 minutes (opt-in flag)
Code queriesGrep + file readsLSP (definitions, types, refs)
Failure handlingStops, waits for youon_fail branch, retries once
Destructive opsAlways asksrequires_approval gate per step
Key Decisions
How to Adopt Without Over-Investing
  • Start with the built-in Routines: review-and-commit, test-then-fix, refactor-with-verify
  • Encode workflows you run daily, not one-off tasks
  • Put requires_approval on any destructive step (commits, pushes, deletions)
  • Use multi-session for long-running tasks, not to multitask yourself
  • Enable 1h caching globally in your shell profile
  • Skip v2.1.107 — go straight from 106 to 108
Invoke
Slash command File change Manual trigger
Status
Research Preview Desktop v2.1.108
Still Rough
Known Limitations
What Else Shipped
The Desktop Redesign at a Glance
  • Integrated terminal inside the app (common flows, not all tmux tricks)
  • Inline file editing without leaving the session
  • HTML and PDF preview panels
  • Multi-session switcher with shared filesystem guardrails
  • LSP-over-Grep hooks for symbol-aware code queries
  • 1-hour prompt caching flag behind an env var
The signal
Claude Code is shifting from agent-as-conversation-partner to agent-as-workflow-executor. Routines are the infrastructure; multi-session and caching are what make them practical for a full working day.
Components
Routines Multi-Session 1h Cache TTL LSP Hooks Inline Editor HTML/PDF Preview
01 — Helicopter · Claude Code Routines · Companion to sangampandey.info/blog/claude-code-routines-desktop-redesign Claude Code Routines