Claude Code 2.1.76
MCP elicitation support — MCP servers can now interrupt mid-task to request structured input from the user via interactive dialogs (form fields or browser URL). Paired with the `Elicitation` and `ElicitationResult` hooks, this closes the last major gap in MCP's ability to drive complex multi-step agent interactions that require human confirmation or credential input at runtime.
New primitives
MCP elicitationcapabilityMCP servers can request structured input mid-task via interactive dialog (form fields or browser URL)
Elicitation hookhookFires when an MCP server issues an elicitation request; allows agent/host to intercept and override
ElicitationResult hookhookFires after an elicitation response is resolved; allows agent/host to intercept and override before sending back to MCP server
-n / --name <name>flagSets a display name for the session at startup
worktree.sparsePathssettingFor `claude --worktree` in large monorepos: check out only the listed directories via git sparse-checkout
PostCompact hookhookFires after compaction completes
/effortcommandSets model effort level interactively
feedbackSurveyRatesettingEnterprise admins can configure the session quality survey sample rate
Workflow recipes
MCP servers that need one-time secrets (API keys, OAuth tokens, approval codes) previously had to embed that collection in the tool description or rely on the agent to prompt the user. The elicitation capability lets the MCP server own that dialog, and ElicitationResult lets a hook layer validate or transform the response before it reaches the server — enabling a clean separation between "user enters credential" and "server receives sanitized/validated credential."
An agentic pipeline that spins up a deployment workflow via MCP. At the point where production credentials are needed, the MCP server fires an elicitation request (browser URL for SSO or form fields for an API key). An ElicitationResult hook validates the token format and strips any accidental whitespace before passing it back. The agent never sees the raw credential in its context — the hook layer owns the sanitization contract.
Parallel monorepo agents running in sparse worktrees accumulate long contexts that eventually compact. Before 2.1.76, there was no reliable signal to trigger an external state refresh after compaction — summary files, vector stores, or cross-agent coordination objects could drift silently. PostCompact provides the signal; worktree.sparsePaths reduces the per-agent footprint so more agents can run concurrently before hitting resource limits.
A conductor agent spawns N worker agents via --worktree, each with a worktree.sparsePaths config that limits checkout to the subdirectory they own. Each worker's PostCompact hook fires a lightweight script that (a) re-reads the shared coordination file from the conductor's branch, (b) appends a summary of work completed before compaction, and (c) writes an updated breadcrumb back. The conductor polls the breadcrumb file to detect which workers have compacted and re-injects missing context. This prevents the "lost history after compaction" failure mode in long parallel runs without requiring the workers to hold full repo checkouts.
When an orchestrator launches many parallel subagents, session names in logs and Remote Control dashboards default to opaque identifiers. The --name flag lets the orchestrator stamp each subagent with a semantic name (e.g., the task ID or target file path) at launch. When a subagent compacts, the PostCompact hook can emit a structured log line that includes the session name — giving the orchestrator a named, timestamped compaction event it can use for progress tracking without polling the subprocess.
Orchestration script launches workers as claude --name "worker:payments-service" --worktree .... Each worker's PostCompact hook appends {"session": "$CLAUDE_SESSION_NAME", "event": "compact", "ts": "..."} to a shared JSONL log. The conductor tails that log to know which named workers have compacted and may need context re-injection, producing a real-time named-worker progress trace without any polling overhead.
Agentic relevance
MCP elicitation + the `Elicitation`/`ElicitationResult` hook pair is the highest-signal primitive here: it lets an MCP server pause a running agent pipeline and collect structured human input (credentials, choices, confirmations) without the agent having to encode that interaction itself. The `PostCompact` hook closes a previously blind spot — agents that maintain external state or summaries across long sessions can now reliably sync after compaction. The `worktree.sparsePaths` setting directly benefits monorepo-scale parallel agent runs by reducing checkout cost on each spawned worktree.
Hardening & fixes (28)
- Fixed deferred tools (`ToolSearch`-loaded) losing input schemas after compaction — array and number parameters were rejected with type errors
- Fixed slash commands showing "Unknown skill"
- Fixed plan mode asking for re-approval after the plan was already accepted
- Fixed voice mode swallowing keypresses while a permission dialog or plan editor was open
- Fixed `/voice` not working on Windows when installed via npm
- Fixed spurious "Context limit reached" when invoking a skill with `model:` frontmatter on a 1M-context session
- Fixed "adaptive thinking is not supported on this model" error when using non-standard model strings
- Fixed `Bash(cmd:*)` permission rules not matching when a quoted argument contains `#`
- Fixed "don't ask again" in the Bash permission dialog showing the full raw command for pipes and compound commands
- Fixed auto-compaction retrying indefinitely after consecutive failures — circuit breaker now stops after 3 attempts
- Fixed MCP reconnect spinner persisting after successful reconnection
- Fixed LSP plugins not registering servers when LSP Manager initialized before marketplaces were reconciled
- Fixed clipboard copying in tmux over SSH
- Fixed `/export` showing only filename instead of full file path in the success message
- Fixed transcript not auto-scrolling to new messages after selecting text
- Fixed Escape key not working to exit the login method selection screen
- Fixed Remote Control: sessions silently dying when server reaps idle environment; rapid messages queued one-at-a-time instead of batched; stale work items causing redelivery after JWT refresh
- Fixed bridge sessions failing to recover after extended WebSocket disconnects
- Fixed slash commands not found when typing the exact name of a soft-hidden command
- Improved `--worktree` startup performance — reads git refs directly, skips redundant `git fetch`
- Improved background agent behavior — killing a background agent now preserves its partial results in conversation context
- Improved model fallback notifications — always visible, human-friendly model names
- Improved blockquote readability on dark terminal themes
- Improved stale worktree cleanup — worktrees left behind after interrupted parallel runs are automatically cleaned up
- Improved Remote Control session titles — derived from first prompt instead of "Interactive session"
- Improved `/voice` — shows dictation language on enable, warns when `language` setting unsupported for voice input
- Updated `--plugin-dir` to accept one path only; use repeated flag for multiple directories
- [VSCode] Fixed gitignore patterns with commas silently excluding entire filetypes from @-mention file picker
Raw changelog
## 2.1.76 - Added MCP elicitation support — MCP servers can now request structured input mid-task via an interactive dialog (form fields or browser URL) - Added new `Elicitation` and `ElicitationResult` hooks to intercept and override responses before they're sent back - Added `-n` / `--name <name>` CLI flag to set a display name for the session at startup - Added `worktree.sparsePaths` setting for `claude --worktree` in large monorepos to check out only the directories you need via git sparse-checkout - Added `PostCompact` hook that fires after compaction completes - Added `/effort` slash command to set model effort level - Added session quality survey — enterprise admins can configure the sample rate via the `feedbackSurveyRate` setting - Fixed deferred tools (loaded via `ToolSearch`) losing their input schemas after conversation compaction, causing array and number parameters to be rejected with type errors - Fixed slash commands showing "Unknown skill" - Fixed plan mode asking for re-approval after the plan was already accepted - Fixed voice mode swallowing keypresses while a permission dialog or plan editor was open - Fixed `/voice` not working on Windows when installed via npm - Fixed spurious "Context limit reached" when invoking a skill with `model:` frontmatter on a 1M-context session - Fixed "adaptive thinking is not supported on this model" error when using non-standard model strings - Fixed `Bash(cmd:*)` permission rules not matching when a quoted argument contains `#` - Fixed "don't ask again" in the Bash permission dialog showing the full raw command for pipes and compound commands - Fixed auto-compaction retrying indefinitely after consecutive failures — a circuit breaker now stops after 3 attempts - Fixed MCP reconnect spinner persisting after successful reconnection - Fixed LSP plugins not registering servers when the LSP Manager initialized before marketplaces were reconciled - Fixed clipboard copying in tmux over SSH — now attempts both direct terminal write and tmux clipboard integration - Fixed `/export` showing only the filename instead of the full file path in the success message - Fixed transcript not auto-scrolling to new messages after selecting text - Fixed Escape key not working to exit the login method selection screen - Fixed several Remote Control issues: sessions silently dying when the server reaps an idle environment, rapid messages being queued one-at-a-time instead of batched, and stale work items causing redelivery after JWT refresh - Fixed bridge sessions failing to recover after extended WebSocket disconnects - Fixed slash commands not found when typing the exact name of a soft-hidden command - Improved `--worktree` startup performance by reading git refs directly and skipping redundant `git fetch` when the remote branch is already available locally - Improved background agent behavior — killing a background agent now preserves its partial results in the conversation context - Improved model fallback notifications — now always visible instead of hidden behind verbose mode, with human-friendly model names - Improved blockquote readability on dark terminal themes — text is now italic with a left bar instead of dim - Improved stale worktree cleanup — worktrees left behind after an interrupted parallel run are now automatically cleaned up - Improved Remote Control session titles — now derived from your first prompt instead of showing "Interactive session" - Improved `/voice` to show your dictation language on enable and warn when your `language` setting isn't supported for voice input - Updated `--plugin-dir` to only accept one path to support subcommands — use repeated `--plugin-dir` for multiple directories - [VSCode] Fixed gitignore patterns containing commas silently excluding entire filetypes from the @-mention file picker