Skip to content

Claude Code v2.1.220: getContextUsage() API, PermissionRequest hook, deep subagent forwardingΒ #514

Description

@claude-yolo

WHY you should care

v2.1.220 meaningfully expands the Agent SDK surface area for anyone building production agents programmatically.

πŸš€ The big three

getContextUsage() SDK API β€” context window breakdown (token counts, categories, skills) is now reachable programmatically via Query.getContextUsage(). Previously interactive-only. Useful for adaptive context management in long-running agents.

PermissionRequest hook β€” hooks can now intercept permission prompts before they reach the user and auto-allow/deny them. Background subagents that can't prompt a user now auto-deny if no hook returns a decision. Critical for headless/CI workflows.

Deep subagent forwardSubagentText β€” messages from subagents at every nesting depth (not just depth-1) now propagate in the stream with parent_tool_use_id set. Fixes a real gap for multi-level agent trees.

Other notable additions

  • cancel_queued interrupt: cancel queued messages outright instead of letting them run after interrupt
  • fast_mode_disabled_reason: surface the specific reason fast mode is blocked, not just the state
  • setModel(undefined): now documented to reset to session default
  • supportedCommands() now reflects mid-session changes live
  • settings.local.json auto-added to global git excludes when saved
  • strictKnownMarketplaces admin setting for plugin marketplace lockdown
  • Error retry semantics explicitly documented (TLS cert failures, mid-stream failures)

Ref

PR: thevibeworks/claude-code-docs#1108

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions