Update claude deps

From SkillfulAgents/SuperAgent · View interactive version

Update claude deps is an AI agent skill from the GitHub repository SkillfulAgents/SuperAgent. Review and upgrade Claude Code CLI, Claude Agent SDK, and Anthropic SDK versions used in the project

How to use this skill

Skill file

Update Claude Dependencies

Review the current versions of Claude-related packages and create an upgrade plan.

Steps

  1. Find current versions by reading these files:
  1. Check latest versions by searching the web for:
  1. Analyze the diff between current and latest:
  1. Assess risk based on our actual SDK usage in the codebase:
  1. Present findings as a table showing:
  1. Ask the user if they want to proceed with the upgrade before making changes.

Key files to update when upgrading

```bash

npx esbuild node_modules/@anthropic-ai/sdk/index.mjs --bundle --minify --format=iife --global-name=__AnthropicSDK_ns --platform=browser --external:'node:*' > /tmp/sdk-bundle.js

echo 'window.AnthropicSDK = AnthropicSDK_ns.default || __AnthropicSDK_ns.Anthropic;' >> /tmp/sdk-bundle.js

```

The --external:'node:*' flag is required since SDK 0.116+: the credential-chain code lazily import()s node:fs/node:path behind runtime guards that never fire in a browser, and esbuild errors on them without the external marker.

Then replace the template literal in src/api/llm-sdk-bundle.ts with the contents of /tmp/sdk-bundle.js (escape backslashes first, then backticks and ${), and verify the escaped literal evaluates back to the exact raw bundle

Validation after upgrading

  1. Re-record the protocol fixtures, then run the container unit suite. Frame ORDER (idle vs result, background_tasks_changed vs the task_* bookends) changes between CLI releases without a changelog line — 2.1.296 moved a finishing task's snapshot removal from before its terminal signals to after them — and only a live CLI shows it. After npm ci in agent-container/:

```bash

ANTHROPIC_API_KEY=... node .claude/skills/update-claude-deps/capture-fixtures.mjs # ~1.5 min, a few cents on haiku

```

It records each scenario (--list: background Bash, background subagent, Stop with only a background subagent live, a subagent's own background Bash, SendMessage resume) into src/shared/lib/container/__fixtures__/sdk<patch>-<name>/ in the host capture wrapper ({t, message: {content: <frame>}}), with a private CLAUDE_CONFIG_DIR so nothing from your ~/.claude leaks in. Diff each new timeline against the previous sdk<patch>-* capture of the same scenario before anything else — that diff is the protocol change. Then add the new directories to FIXTURE_EXPECTATIONS in agent-container/src/session-settlement.test.ts (the discovery test fails until you do) and to the SDK<patch>_FIXTURES replay block in src/shared/lib/container/sdk206-fixtures-replay.test.ts, and run cd agent-container && npx vitest run plus the host replay files (npx vitest run src/shared/lib/container). Keep the older captures: they are the regression history for runtimes still on older CLIs.

  1. Gated session-GC E2E suites (MANDATORY on any @anthropic-ai/claude-agent-sdk / CLI bump — CI never runs these, and they guard CLI-behavior assumptions the idle-eviction reaper depends on):

```bash

cd agent-container

RUN_SESSION_GC_E2E=1 ANTHROPIC_API_KEY=... npx vitest run src/session-gc.e2e.test.ts

RUN_SESSION_GC_E2E=1 ANTHROPIC_API_KEY=... npx vitest run src/session-gc-durability.e2e.test.ts

RUN_SESSION_GC_E2E=1 ANTHROPIC_API_KEY=... npx vitest run src/session-gc-background-stop.e2e.test.ts

```

  1. Task-tools opt-in (MANDATORY re-verify on any CLI bump): claude-code.ts buildQueryOptions() lists TaskCreate/TaskGet/TaskList/TaskUpdate in allowedTools because CLI 2.1.233+ registers them by default only on older models (Claude 3.x, Opus 4.0–4.7, Sonnet 4.0–4.6, Haiku 4.5). Since 0.3.268 this is the documented path (SDK changelog: "elsewhere list them in tools/allowedTools"); the CLAUDE_CODE_ENABLE_TODO_TOOLS=1 env var is the documented CLI-side equivalent and works too (verified live on claude-opus-4-8 with 0.3.272: either path registers all four; TodoWrite is never registered alongside them). The in-chat task-list UI (derive-task-list.ts) and existing agent workflows depend on those tools, and the failure is silent (tools just stop appearing; nothing errors). To re-verify: run the claude-prompt-drift skill's capture after the bump and confirm the superagent-axis tools.md still lists all four Task tools. If they've vanished, try the env var as a fallback; if that is gone too, the CLI's only other re-enable path is a server-side feature flag that our CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 blocks — so escalate to a product decision (patch the gate, or retire the task-list UI's wire dependency) rather than shipping silently.
  1. If either E2E file fails, do not ship the bump — check the settlement tracker (agent-container/src/session-settlement.ts) and graceful-stop path (claude-code.ts stop({graceful:true})) against the new CLI's stream behavior.
  1. Vendored bundled skill/workflow drift (MANDATORY on any @anthropic-ai/claude-agent-sdk / CLI bump): claude-code.ts buildQueryOptions() sets disableBundledSkills: true, which strips every skill and workflow that ships inside the CLI, and the image-baked Gamut plugin (agent-container/plugin/, see its README) carries copies of the ones we keep — the deep-research workflow and the workflow-authoring skill (the Workflow tool's own prompt tells the model to load it; without it the model writes workflow scripts blind). Those copies no longer track upstream, so after npm ci in agent-container/ run

```bash

node .claude/skills/update-claude-deps/extract-bundled.mjs

```

While there, list what the new CLI bundles (for workflows, the first var x="<name>" of each chunk that ends in export{… as initBundledWorkflows} — one chunk per workflow since 2.1.330, one chunk for all before (grep -a -o 'var i="[a-z-]*",e=i,' <binary> there); the skills array in a headless run's system:init message for skills) and decide whether anything new is worth vendoring the same way — disableBundledSkills hides all of it, so a useful addition is invisible until someone looks. The reverse leak happens too: a built-in skill is not "bundled" and survives the flag (2.1.296's plugin-authoring), so check the superagent-axis messages.md skill list from the claude-prompt-drift capture for anything not ours (gamut:* or agent-created) and switch it off in claude-code.ts settings.skillOverrides.

Important notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.