Claude Code 2.1.108
**Prompt caching control and session recap** unlock fine-grained performance tuning and context continuity. Fine TTL control (5m/1h) enables agents to trade cache freshness for latency on data-update-sensitive tasks; recap surfaces automatic context recovery for interrupted sessions.
New primitives
ENABLE_PROMPT_CACHING_1Henv-varOpt into 1-hour prompt cache TTL on API key, Bedrock, Vertex, and Foundry
FORCE_PROMPT_CACHING_5Menv-varForce 5-minute TTL for prompt caching
/recapcommandManually invoke session recap; provides context when returning
CLAUDE_CODE_ENABLE_AWAY_SUMMARYenv-varForce recap feature when telemetry is disabled
Model slash-command discoverycapabilityThe model can now discover and invoke built-in slash commands via the Skill tool
/undocommandAlias for `/rewind`
Workflow recipes
Agents can now trade cache freshness for latency by selecting cache TTL per task phase. 5-minute TTL suits rapid-feedback loops (deployment polls, test retries); 1-hour TTL suits stable-state tasks (report generation, batch processing).
An agent orchestrating a multi-phase workflow (e.g., deploy → monitor → report) can set FORCE_PROMPT_CACHING_5M for the monitoring loop (immediate feedback on state changes), then ENABLE_PROMPT_CACHING_1H for batch reporting (amortize cache hits across long-running compilations). On resumed sessions, /recap restores context without re-reading full transcripts, enabling interrupt-tolerant agent loops that skip redundant setup.
Agents spawn with built-in slash commands automatically available for discovery (no teach-in required), and session recovery is seamless by default (local-project focus, recap context). This reduces setup friction when agents fork, resume, or run across repo boundaries.
A multi-phase agent (e.g., foundation3-execution-delegate) can call /init to scaffold, then /security-review for gate-keeping, without explicit Skill tool invocation for each command—the model discovers them. Resumed delegated agents pull context via /recap and default to the project's session pool, avoiding cross-project context pollution.
Agents can now distinguish transient limits (rate limiting, recoverable with backoff and tighter cache) from terminal limits (plan exhaustion). Startup warnings surface cache misconfiguration early, preventing silent cache bypass.
An agent polling an external service can catch a 429/rate-limit error, activate FORCE_PROMPT_CACHING_5M to reduce token pressure, and retry. If the error is plan-limit, it logs immediately instead of failing silently. On startup, agents running under cost constraints check for disabled caching and warn, enabling proactive tuning before task execution.
Agentic relevance
Cache TTL control enables agents to balance speed vs. freshness on task-specific schedules; `/recap` and improved session defaults reduce context-reestablishment overhead. Model-native slash-command discovery lifts agent autonomy by making built-in tools self-discoverable, reducing explicit teach-in cycles.
Hardening & fixes (20)
- `/model` now warns before switching models mid-conversation, preventing cache misses from uncached re-reads
- `/resume` picker improved to default to sessions from current directory; `Ctrl+A` expands to all projects
- Error messages refined: server rate limits vs. plan usage limits distinguished; 5xx/529 errors link to status.claude.com; unknown slash commands suggest closest match
- Memory footprint reduced for file reads, edits, and syntax highlighting via on-demand grammar loading
- Verbose indicator added when viewing detailed transcript (`Ctrl+O`)
- Startup warning added for disabled prompt caching
- Fixed paste regression in `/login` code prompt (2.1.105)
- Fixed subscribers with `DISABLE_TELEMETRY` falling back to 5-minute cache instead of 1 hour
- Fixed Agent tool over-prompting for permission when safety classifier exceeded context window
- Fixed Bash tool silent failures when `CLAUDE_ENV_FILE` ends with `#` comment
- Fixed `--resume` losing custom session names and colors
- Fixed session titles showing placeholder text on short greetings
- Fixed terminal escape codes corrupting prompt input after `--teleport`
- Fixed `/feedback` retry behavior
- Fixed `--teleport` and `--resume` precondition errors exiting silently
- Fixed Remote Control session titles being overwritten
- Fixed `--resume` truncating self-referencing transcripts
- Fixed silent transcript write failures (disk full, etc.)
- Fixed diacritical marks dropped from responses with configured `language` setting
- Fixed policy-managed plugins failing to auto-update across projects
Raw changelog
## 2.1.108 - Added `ENABLE_PROMPT_CACHING_1H` env var to opt into 1-hour prompt cache TTL on API key, Bedrock, Vertex, and Foundry (`ENABLE_PROMPT_CACHING_1H_BEDROCK` is deprecated but still honored), and `FORCE_PROMPT_CACHING_5M` to force 5-minute TTL - Added recap feature to provide context when returning to a session, configurable in `/config` and manually invocable with `/recap`; force with `CLAUDE_CODE_ENABLE_AWAY_SUMMARY` if telemetry disabled. - The model can now discover and invoke built-in slash commands like `/init`, `/review`, and `/security-review` via the Skill tool - `/undo` is now an alias for `/rewind` - Improved `/model` to warn before switching models mid-conversation, since the next response re-reads the full history uncached - Improved `/resume` picker to default to sessions from the current directory; press `Ctrl+A` to show all projects - Improved error messages: server rate limits are now distinguished from plan usage limits; 5xx/529 errors show a link to status.claude.com; unknown slash commands suggest the closest match - Reduced memory footprint for file reads, edits, and syntax highlighting by loading language grammars on demand - Added "verbose" indicator when viewing the detailed transcript (`Ctrl+O`) - Added a warning at startup when prompt caching is disabled via `DISABLE_PROMPT_CACHING*` environment variables - Fixed paste not working in the `/login` code prompt (regression in 2.1.105) - Fixed subscribers who set `DISABLE_TELEMETRY` falling back to 5-minute prompt cache TTL instead of 1 hour - Fixed Agent tool prompting for permission in auto mode when the safety classifier's transcript exceeded its context window - Fixed Bash tool producing no output when `CLAUDE_ENV_FILE` (e.g. `~/.zprofile`) ends with a `#` comment line - Fixed `claude --resume <session-id>` losing the session's custom name and color set via `/rename` - Fixed session titles showing placeholder example text when the first message is a short greeting - Fixed terminal escape codes appearing as garbage text in the prompt input after `--teleport` - Fixed `/feedback` retry: pressing Enter to resubmit after a failure now works without first editing the description - Fixed `--teleport` and `--resume <id>` precondition errors (e.g. dirty git tree, session not found) exiting silently instead of showing the error message - Fixed Remote Control session titles set in the web UI being overwritten by auto-generated titles after the third message - Fixed `--resume` truncating sessions when the transcript contained a self-referencing message - Fixed transcript write failures (e.g., disk full) being silently dropped instead of being logged - Fixed diacritical marks (accents, umlauts, cedillas) being dropped from responses when the `language` setting is configured - Fixed policy-managed plugins never auto-updating when running from a different project than where they were first installed