claude-code - 💡(How to fix) Fix [DOCS] Headless stream-json init event missing `plugin_errors` documentation [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49308Fetched 2026-04-17 08:44:56
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Root Cause

  1. In https://code.claude.com/docs/en/headless, add a short init-event example for --output-format stream-json and mention that plugin_errors is included when plugins are demoted for unsatisfied dependencies.
  2. In the TypeScript and Python Agent SDK message references, add plugin_errors to the documented init-message payload and describe when it appears.
  3. In the plugin/SDK plugin docs, add a troubleshooting note telling users to inspect init output for demoted plugins caused by missing or unsatisfied dependencies.
RAW_BUFFERClick to expand / collapse

Documentation Type

Incorrect/outdated documentation

Documentation Location

https://code.claude.com/docs/en/headless

Section/Topic

"Stream responses" (--output-format stream-json) and the init event payload used to report plugin startup state

Current Documentation

The headless docs currently say:

Use --output-format stream-json with --verbose and --include-partial-messages to receive tokens as they're generated. Each line is a JSON object representing an event:

The same page only gives a text-delta filtering example:

claude -p "Write a poem" --output-format stream-json --verbose --include-partial-messages | jq -rj 'select(.type == "stream_event" and .event.delta.type? == "text_delta") | .event.delta.text'

The SDK TypeScript reference currently defines the init system message as:

type SDKSystemMessage = { type: "system"; subtype: "init"; ... mcp_servers: { name: string; status: string; }[]; ... slash_commands: string[]; output_style: string; skills: string[]; plugins: { name: string; path: string }[]; };

And the plugin SDK guide tells readers to inspect the init message only for loaded plugins and commands:

When plugins load successfully, they appear in the system initialization message. You can verify that your plugins are available:

What's Wrong or Missing?

Changelog v2.1.111 adds a new startup behavior: headless --output-format stream-json now includes plugin_errors on the init event when plugins are demoted for unsatisfied dependencies.

The current docs do not describe that init-event field or the demotion behavior:

A. Headless stream-json docs omit the init payload details

The headless page explains that stream-json emits events, but it does not document the startup/init event shape or mention that plugin dependency failures surface through plugin_errors.

B. SDK init-message references are now incomplete

The TypeScript init-message field list omits plugin_errors, and the Python reference only describes SystemMessage generically. Readers who inspect init messages to verify plugin state are not told how dependency-related plugin demotions are reported.

C. Plugin troubleshooting guidance does not connect dependency demotion to init output

The plugin docs discuss successful plugin loading and general loading errors, but they do not explain that unsatisfied dependencies can demote a plugin and that headless/SDK consumers should check plugin_errors on the init event.

Suggested Improvement

Update the headless and Agent SDK docs to document the init event as part of the --output-format stream-json contract.

Recommended minimum changes:

  1. In https://code.claude.com/docs/en/headless, add a short init-event example for --output-format stream-json and mention that plugin_errors is included when plugins are demoted for unsatisfied dependencies.
  2. In the TypeScript and Python Agent SDK message references, add plugin_errors to the documented init-message payload and describe when it appears.
  3. In the plugin/SDK plugin docs, add a troubleshooting note telling users to inspect init output for demoted plugins caused by missing or unsatisfied dependencies.

It would also help to document the shape of each plugin_errors entry and clarify whether a demoted plugin is omitted from plugins, marked separately, or otherwise represented in startup metadata.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

PageContext
https://code.claude.com/docs/en/headlessDocuments --output-format stream-json, but not the init event schema or plugin_errors
https://code.claude.com/docs/en/cli-referenceDocuments the CLI flags that enable stream-json output
https://code.claude.com/docs/en/agent-sdk/typescriptSDKSystemMessage lists init fields such as mcp_servers, slash_commands, skills, and plugins, but not plugin_errors
https://code.claude.com/docs/en/agent-sdk/pythonSystemMessage is described only generically, with no documented init payload fields for plugin demotion/errors
https://code.claude.com/docs/en/agent-sdk/pluginsTells users to inspect the init message for loaded plugins, but not for dependency-driven demotion via plugin_errors

Total scope: 5 pages affected

Source: Changelog v2.1.111

Changelog entry: Headless --output-format stream-json now includes plugin_errors on the init event when plugins are demoted for unsatisfied dependencies

extent analysis

TL;DR

Update the documentation for --output-format stream-json to include the plugin_errors field in the init event payload and describe its usage for reporting plugin demotions due to unsatisfied dependencies.

Guidance

  • Review the current documentation for --output-format stream-json and identify areas where the plugin_errors field and plugin demotion behavior are not mentioned.
  • Update the TypeScript and Python Agent SDK message references to include plugin_errors in the documented init-message payload.
  • Add a troubleshooting note to the plugin/SDK plugin docs to instruct users to inspect init output for demoted plugins caused by missing or unsatisfied dependencies.
  • Consider documenting the shape of each plugin_errors entry and clarifying how demoted plugins are represented in startup metadata.

Example

No code snippet is provided as the issue is related to documentation updates.

Notes

The updates should be applied to the affected pages listed in the issue, including the headless documentation, Agent SDK references, and plugin documentation. The changes should reflect the new behavior introduced in Changelog v2.1.111.

Recommendation

Apply the suggested improvements to update the documentation and ensure that users are aware of the plugin_errors field and its usage for reporting plugin demotions. This will improve the understanding and usability of the feature.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING