# Claude Code v2.1.331: plugin optionalDependencies, OpenTelemetry gen_ai span fields <!-- ref: @content/web/github/2026-11-23-claude-code-v2-1-331 tags: [claude-code, plugins, observability] version: 2 updated_at: 2026-11-24T15:35:22.568Z --> **[Read the original](https://github.com/anthropics/claude-code/releases/tag/v2.1.331)** *Synthesized from the Claude Code v2.1.331 release notes on GitHub, published 2026-11-23.* Claude Code v2.1.331 adds plugin-manifest dependencies and standard tracing fields, plus a long list of session and hook fixes. ## Core Thesis The release moves Claude Code toward infrastructure that can be monitored and composed: plugins can declare dependencies, and model-request spans carry the OpenTelemetry generative-AI attributes. ## Key Insights - **Plugin `optionalDependencies`.** Plugin manifests can now list plugins that install with the plugin but can be disabled or uninstalled on their own. - **Standard trace attributes.** `claude_code.llm_request` spans gain `gen_ai.usage.*`, `gen_ai.response.model` and `gen_ai.operation.name`; input tokens include prompt cache tokens. - **Hook and session fixes.** Stop hooks that read the transcript no longer miss the last reply in Claude Desktop, and SubagentStop hooks wait for it too. Auto mode no longer sometimes refuses a call to stop a /loop. - **Plugin update safety.** An interrupted or failed plugin update no longer leaves a partial plugin folder that later loads with components missing. - **`claude doctor`** now has an API connectivity section reporting HTTP status or error. ## Actionable Takeaways - Anyone running a plugin or skill fleet can split optional pieces into separate dependencies instead of one bundle. - The new span attributes make Claude Code traces comparable with other gen_ai tooling. --- *Related: `@content/web/xinyadu/2026-11-29-claude-code-task-framing-study` · `@content/web/github/2026-11-27-resume-command-osc-7577-issue-112408` · `@content/web/github/2026-11-26-opus-context-fills-faster-issue-112194` · `@content/web/github/2026-11-26-interactive-session-misclassified-background-issue-112133` · `@content/web/github/2026-11-26-autodream-silently-ignored-issue-112310`* --- *You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).* *Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*