2.1.157 untested · changelog-derived

Claude Code 2.1.157

**Local plugin auto-load from `.claude/skills`** — decentralizes plugin distribution, enables repo-local skill scaffolding, and pairs with new `EnterWorktree` worktree-switching and `agent` field routing to unlock mid-session context+tool pivots without marketplace dependency.

8 new primitives 3 workflow recipes 25 fixes

New primitives

Plugins in .claude/skills directories auto-loadcapability

Plugins placed in `.claude/skills/` are now automatically discovered and loaded at startup without marketplace registration

Plugins in `.claude/skills` directories are now automatically loaded, no marketplace required
claude plugin init <name>command

Scaffold a new plugin skeleton in `.claude/skills/` with standard boilerplate

Added `claude plugin init <name>` to scaffold a new plugin in `.claude/skills`
Plugin /plugin autocompletetool

Tab-complete `/plugin` subcommands, installed plugin names, and plugins from known marketplaces

Added autocomplete for `/plugin` arguments: subcommands, installed plugin names, and plugins from known marketplaces
agent field in settings.json honored for dispatched sessionssetting

The `agent` field in project `settings.json` is now respected when dispatching background sessions; override with `--agent <name>`

`claude agents`: the `agent` field in `settings.json` is now honored for dispatched sessions, with `--agent <name>` to override it
EnterWorktree mid-session switchingtool

`EnterWorktree` can now switch between Claude-managed worktrees without ending the session

`EnterWorktree` can now switch between Claude-managed worktrees mid-session
tool_parameters in telemetry with OTEL_LOG_TOOL_DETAILS=1env-var

When `OTEL_LOG_TOOL_DETAILS=1` is set, `tool_decision` telemetry events include the actual tool parameters (bash commands, MCP/skill names) for observability

`tool_decision` telemetry events now include `tool_parameters` (bash commands, MCP/skill names) when `OTEL_LOG_TOOL_DETAILS=1`
Worktrees left unlocked after agent finishcapability

Claude-managed worktrees are now left in an unlocked state after the agent finishes, allowing `git worktree remove` and `prune` to clean them up without manual unlock

Worktrees managed by Claude are now left unlocked when the agent finishes, so `git worktree remove`/`prune` can clean them up
"Workflow keyword trigger" setting in /configsetting

New `/config` setting to disable or control the auto-trigger behavior when the word "workflow" appears in a prompt

Added a "Workflow keyword trigger" setting in /config to stop the word "workflow" in a prompt from triggering a dynamic workflow

Workflow recipes

Repo-Local Skill Dispatch with Context Routing
Local plugin auto-load from .claude/skills + agent field honored in settings.json + EnterWorktree mid-session switching

Decoupling skill distribution from the marketplace and binding agent identity to the repo allows polyrepo monoliths and multi-team foundations to inject role-specific toolchains at checkout time, then pivot between specialized agents mid-session without losing conversation state or requiring CLI reauthorization.

A foundation3 or agentic-u polyrepo defines role-specific skill sets in nested .claude/skills/ directories (e.g., apps/singulariki/.claude/skills/ for frontend, .agents/skills/ for orchestration). The repo-root settings.json specifies "agent": "orchestrator" by default. When a user or parent orchestrator dispatch a claude agents session with --agent frontend, the new settings field routes to the frontend agent in-process. That agent can then invoke EnterWorktree to pivot to an apps/singulariki/ worktree, loading frontend-specific skills (testing, linting, build) without leaving the session. Telemetry (OTEL_LOG_TOOL_DETAILS=1) logs which tools were invoked by which agent, enabling later audit and replay.

Deterministic Multi-Agent Choreography with Filtered Keyword Triggers
"Workflow keyword trigger" setting + agent field routing + telemetry tool_parameters logging

Agents orchestrating other agents can disable accidental workflow prompts (removing the "workflow" keyword auto-trigger) while logging deterministic tool invocations, enabling parent orchestrators to reason about and replay agent work without interference from user-typed keywords.

An orchestration agent (e.g., foundation3-execution-delegate) dispatches a series of claude agents background sessions, each with a specific agent name and a local .claude/skills/ toolkit. The orchestrator sets "Workflow keyword trigger": "disabled" in its settings.json to prevent accidental /workflow invocation from user prompts leaking into dispatch logic. When each background agent runs, it sets OTEL_LOG_TOOL_DETAILS=1 to emit full tool_decision events with parameter snapshots, allowing the parent to audit the exact bash commands, MCP calls, and skill invocations that happened in each agent's context. If a replay or hand-off is needed, the parent can reconstruct the session deterministically from the telemetry log.

Workstation State Cleanup and Orphan Recovery
Worktrees left unlocked after agent finish + fixed background worktree orphaning in 30-day sweep + --resume background subagent reporting

Claude now leaves worktrees in a cleanable state and correctly reports which background agents were running before a crash or reconnect, enabling cleanup scripts and session recovery flows to operate deterministically without stale locks.

After a long-running polyrepo agent completes work across multiple worktrees (via EnterWorktree switches), the worktrees are left unlocked. A post-session cleanup cron job runs git worktree prune across the repo, removing stale .claude/worktrees/ entries without manual intervention. If the Claude Code process crashes or the user's machine sleeps mid-session, the next claude --resume call correctly reports which background subagents were running, allowing a recovery agent to re-attach or signal completion to pending orchestrators. The fix to orphaned worktrees in the 30-day retention sweep means long-lived project roots no longer accumulate stale worktree artifacts.

Agentic relevance

The headline primitive (local plugin auto-load + mid-session worktree switching + `agent` field routing) enables repos to bundle skills and dispatch context-specific agents without CLI intervention. Combined with the `OTEL_LOG_TOOL_DETAILS=1` telemetry signal and new worktree cleanup semantics, agents can now log their tool invocations, spawn parallel worktree contexts, and leave a clean state for orchestration systems. The new "Workflow keyword trigger" setting controls prompt-based workflow triggers, useful for deterministic agentic flows.

Hardening & fixes (25)

  • Fixed unprocessable images (zero-byte, corrupt) crashing requests instead of becoming text placeholders
  • Fixed sandbox network permission prompts in auto/bypass-permissions modes (desktop, IDE extensions, SDK)
  • Fixed `claude agents` completed sessions not retiring when idle subagents were parked or leaked backgrounded shells
  • Fixed Esc key not cancelling slow "opening…" state in `claude agents` list, leaving it unresponsive
  • Fixed background worktrees under `.claude/worktrees/` being orphaned by 30-day retention sweep
  • Fixed background sessions re-attached after sleep/wake not reporting correct date to model
  • Fixed copy-on-select in `claude agents` not reaching system clipboard in tmux (regression in 2.1.153)
  • Fixed `--resume` not reporting background subagents that were running when previous process exited
  • Fixed `--resume` session picker leaving terminal contents after fullscreen exit
  • Fixed `--worktree` and `--worktree --tmux` returning to canonical repo root instead of current linked worktree
  • Fixed `/model` picker showing incorrect "Newer version available" hint and improved pinned-model row display
  • Fixed literal markdown markers appearing in in-progress message text in fullscreen mode
  • Fixed terminal freeze after approving managed-settings security dialog at startup
  • Fixed rare duplicate line in scrollback after UI redraws
  • Fixed right-click paste duplicating clipboard in VS Code, Cursor, and Windsurf integrated terminals
  • WSL: fixed image paste (`alt+v` keybinding), screenshot paste on Windows 11, and added Windows Explorer drag-drop support
  • Improved performance of long/resumed conversations by eliminating redundant message-rendering recomputations
  • `/terminal-setup` now disables GPU acceleration in VS Code/Cursor/Windsurf to prevent garbled-text rendering
  • Feature of the Week credit status now shows as notification instead of prompt-line text
  • `claude agents` slash-command autocomplete now matches substrings
  • Removed "bash commands will be sandboxed" startup banner (status still visible in `/status`)
  • Removed "/ide for …" startup hint toast
  • Fixed IDE Stop button not actually stopping background subagents
  • Fixed VSCode fast-mode indicator not appearing on Opus 4.8
  • Backspace after workflow trigger keyword now dismisses workflow request instead of deleting character

Raw changelog

## 2.1.157

- Plugins in `.claude/skills` directories are now automatically loaded, no marketplace required
- Added `claude plugin init <name>` to scaffold a new plugin in `.claude/skills`
- Added autocomplete for `/plugin` arguments: subcommands, installed plugin names, and plugins from known marketplaces
- `claude agents`: the `agent` field in `settings.json` is now honored for dispatched sessions, with `--agent <name>` to override it
- `EnterWorktree` can now switch between Claude-managed worktrees mid-session
- `tool_decision` telemetry events now include `tool_parameters` (bash commands, MCP/skill names) when `OTEL_LOG_TOOL_DETAILS=1`
- Worktrees managed by Claude are now left unlocked when the agent finishes, so `git worktree remove`/`prune` can clean them up
- Fixed unprocessable images (zero-byte, corrupt) attached via paste, MCP, or dialog crashing the request instead of becoming a text placeholder
- Fixed sandbox network permission prompts appearing in auto and bypass-permissions mode when using the desktop app, IDE extensions, or SDK
- Fixed `claude agents` completed sessions not retiring when an idle subagent was still parked or had leaked a backgrounded shell
- Fixed `claude agents` pressing Esc not cancelling a slow "opening…", leaving the list unresponsive
- Fixed background agent worktrees under `.claude/worktrees/` being orphaned after the 30-day job retention sweep
- Fixed background sessions re-attached after a sleep/wake not telling the model the correct date
- Fixed copy-on-select in `claude agents` not reaching the system clipboard inside tmux with `set-clipboard on` (regression in 2.1.153)
- Fixed `--resume` not reporting background subagents that were running when the previous Claude Code process exited
- Fixed the `--resume` session picker leaving its contents on the terminal after exiting in fullscreen mode
- Fixed `--worktree` and `--worktree --tmux` returning to the canonical repo root instead of the current linked worktree
- Fixed the `/model` picker showing an incorrect "Newer version available" hint when the selected model is already the newest in its family; the pinned-model row now shows the model's description instead of its raw ID
- Fixed literal markdown markers (backticks, asterisks) appearing in the in-progress message text in fullscreen mode
- Fixed the terminal freezing after approving the managed-settings security dialog at startup
- Fixed a rare duplicate line appearing in scrollback after the terminal UI redraws
- Fixed right-click paste duplicating the clipboard in the VS Code, Cursor, and Windsurf integrated terminals
- WSL: fixed image paste (`alt+v` keybinding), screenshot paste on Windows 11, and added support for dragging images from Windows Explorer
- Improved performance of long and resumed conversations by eliminating redundant message-rendering recomputations
- `/terminal-setup` now disables GPU acceleration in VS Code/Cursor/Windsurf integrated terminals to prevent garbled-text rendering
- The Feature of the Week credit-claim status now appears as a notification in the status area instead of a line above the prompt
- `claude agents`: slash-command autocomplete in the dispatch input now matches substrings
- Removed the "bash commands will be sandboxed" startup banner — sandbox status still shows in `/status` and when a command is blocked
- Removed the "/ide for …" startup hint toast
- [IDE] Fixed clicking Stop while a background subagent is running not actually stopping it
- [VSCode] Fixed the fast mode indicator not appearing on Opus 4.8
- Pressing backspace right after a workflow trigger keyword now dismisses the workflow request (same as alt+w) instead of deleting a character
- Added a "Workflow keyword trigger" setting in /config to stop the word "workflow" in a prompt from triggering a dynamic workflow