2.1.59 untested · changelog-derived

Claude Code 2.1.59

**Auto-memory + /copy:** Claude Code now saves useful context automatically and provides interactive code block selection, enabling faster context reuse and precise code copying in multi-turn workflows.

3 new primitives 2 workflow recipes 5 fixes

New primitives

/memorycommand

Manage auto-saved context from sessions

Claude automatically saves useful context to auto-memory. Manage with /memory
/copycommand

Interactive picker for code blocks, select individual blocks or full response

Added `/copy` command to show an interactive picker when code blocks are present, allowing selection of individual code blocks or the full response.
per-subcommand "always allow"capability

Smarter prefix suggestions for compound bash commands that handle subcommands independently

Improved "always allow" prefix suggestions for compound bash commands (e.g. `cd /tmp && git fetch && git push`) to compute smarter per-subcommand prefixes instead of treating the whole command as one

Workflow recipes

Persistent Agent Context Chains
auto-memory (/memory) + per-subcommand "always allow"

Auto-memory captures intermediate learnings (schema, patterns, decision rules) from agents, while smarter permission handling reduces gate friction on compound bash pipelines. Together they enable multi-turn agent sequences to build context momentum without manual state resets or permission fatigue.

An agent solving a multi-file refactor can now /memory-persist the discovered pattern rules and AST invariants after each file, then in the next turn retrieve that context automatically. Compound bash pipelines (lint → reformat → test → commit) execute with granular per-subcommand trust, avoiding blanket allow-all gates. On the next agent turn or session, the auto-memory restores the mental model, reducing re-discovery waste.

Copy-Driven Code Review + Extraction
/copy + auto-memory (/memory)

Interactive code block selection (via /copy) paired with auto-memory creates a tighter loop for code review, refactoring, and artifact extraction. Instead of manual copy-paste friction or generic block exports, agents can select precise code regions and persist the selection context for replay or variation.

In a code review session, an agent uses /copy to interactively pick the sections needing refactor, saves the selection semantics to /memory, then in a follow-up turn reconstructs the same blocks and applies transformations. Useful for agents iterating over large files or building a mini-DSL for "extract-transform-reuse" workflows across multiple codebases.

Agentic relevance

Auto-memory enables agents to persist learned context across sessions without manual state transfer, reducing cold-start friction in multi-turn workflows. The /copy primitive streamlines code extraction from responses, and per-subcommand permission logic reduces false-positive permission gates on compound bash commands — both critical for agent autonomy in complex task chains.

Hardening & fixes (5)

  • Improved ordering of short task lists
  • Improved memory usage in multi-agent sessions by releasing completed subagent task state
  • Fixed MCP OAuth token refresh race condition when running multiple Claude Code instances simultaneously
  • Fixed shell commands not showing a clear error message when the working directory has been deleted
  • Fixed config file corruption that could wipe authentication when multiple Claude Code instances ran simultaneously

Raw changelog

## 2.1.59

- Claude automatically saves useful context to auto-memory. Manage with /memory
- Added `/copy` command to show an interactive picker when code blocks are present, allowing selection of individual code blocks or the full response.
- Improved "always allow" prefix suggestions for compound bash commands (e.g. `cd /tmp && git fetch && git push`) to compute smarter per-subcommand prefixes instead of treating the whole command as one
- Improved ordering of short task lists
- Improved memory usage in multi-agent sessions by releasing completed subagent task state
- Fixed MCP OAuth token refresh race condition when running multiple Claude Code instances simultaneously
- Fixed shell commands not showing a clear error message when the working directory has been deleted
- Fixed config file corruption that could wipe authentication when multiple Claude Code instances ran simultaneously