claude-code - 💡(How to fix) Fix [DOCS] Headless and Agent SDK docs omit session auto-title background request behavior [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#48867Fetched 2026-04-16 06:48:46
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3
RAW_BUFFERClick to expand / collapse

Documentation Type

Missing documentation (feature not documented)

Documentation Location

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

Section/Topic

Programmatic sessions / Agent SDK session metadata and title generation

Current Documentation

The programmatic-session docs describe headless and SDK usage, but they do not explain that headless/SDK sessions can auto-generate a session title/summary with a background model request:

The Agent SDK gives you the same tools, agent loop, and context management that power Claude Code. It's available as a CLI for scripts and CI/CD, or as Python and TypeScript packages for full programmatic control.

This page covers using the Agent SDK via the CLI (claude -p).

The SDK references expose a generated session summary field but do not explain when or how it is produced:

summary | string | Display title: custom title, auto-generated summary, or first prompt

summary | str | Display title: custom title, auto-generated summary, or first prompt

The environment variable reference documents the disable flags separately, but not their interaction with headless/SDK session auto-titling:

CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC | Equivalent of setting DISABLE_AUTOUPDATER, DISABLE_FEEDBACK_COMMAND, DISABLE_ERROR_REPORTING, and DISABLE_TELEMETRY

CLAUDE_CODE_DISABLE_TERMINAL_TITLE | Set to 1 to disable automatic terminal title updates based on conversation context

What's Wrong or Missing?

Changelog v2.1.110 says:

Fixed headless/SDK session auto-title firing an extra Haiku request when CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC or CLAUDE_CODE_DISABLE_TERMINAL_TITLE is set

That exposes user-visible behavior that the docs do not currently explain:

A. Headless and SDK docs never say that programmatic sessions may auto-generate a session title/summary

The current pages mention summary as an "auto-generated summary," but they do not explain that this may require a separate background Haiku request in headless/SDK usage.

B. The disable flags are not documented as controls for this background request

Users who set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 specifically to avoid extra non-essential requests, or CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1 to suppress title generation, are not told that these settings affect session auto-title generation in headless/SDK runs.

C. Cost and traffic expectations are unclear for automation users

For scripts, CI, and SDK apps, an extra model request matters for cost predictability, traffic minimization, and debugging. The docs should state when this request happens and what summary/title behavior users should expect when it is disabled.

Suggested Improvement

Add a short note to the programmatic-session docs and SDK session docs explaining that:

  1. Headless / Agent SDK sessions may generate a session title/summary automatically for session metadata such as SDKSessionInfo.summary
  2. This auto-title behavior can trigger a separate background Haiku-class request
  3. CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 and CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1 suppress that non-essential title-generation request
  4. When auto-title generation is disabled or unavailable, session listings fall back to the existing documented alternatives (customTitle / custom_title or the first prompt)

Suggested placement:

  • Run Claude Code programmatically near session metadata / JSON output
  • Work with sessions near listSessions() / list_sessions() guidance
  • Environment variables entries for both disable flags, with cross-links back to headless/SDK session docs

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

PageContext
https://code.claude.com/docs/en/headlessPrimary page for claude -p / programmatic runs
https://code.claude.com/docs/en/agent-sdk/sessionsSession lifecycle, resume, and session metadata guidance
https://code.claude.com/docs/en/agent-sdk/typescriptSDKSessionInfo.summary and customTitle reference
https://code.claude.com/docs/en/agent-sdk/pythonSDKSessionInfo.summary and custom_title reference
https://code.claude.com/docs/en/env-varsDocuments CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC and CLAUDE_CODE_DISABLE_TERMINAL_TITLE

Total scope: 5 pages affected

Source: Changelog v2.1.110

Exact changelog entry:

Fixed headless/SDK session auto-title firing an extra Haiku request when CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC or CLAUDE_CODE_DISABLE_TERMINAL_TITLE is set

extent analysis

TL;DR

Add documentation to explain how headless and SDK sessions may auto-generate a session title/summary, including the conditions under which this happens and how environment variables control this behavior.

Guidance

  • Update the programmatic-session docs to mention that headless/SDK sessions can auto-generate a session title/summary, potentially triggering a background Haiku request.
  • Clarify the effect of CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC and CLAUDE_CODE_DISABLE_TERMINAL_TITLE on session auto-title generation in the environment variable documentation.
  • Add notes to the SDK session docs explaining the auto-title behavior and its interaction with the mentioned environment variables.
  • Ensure that session listing behavior is documented when auto-title generation is disabled or unavailable.

Example

No code snippet is necessary for this documentation-focused issue.

Notes

The suggested improvements aim to enhance user understanding of headless and SDK session behavior, particularly regarding auto-generated session titles/summaries and the impact of specific environment variables.

Recommendation

Apply the suggested documentation improvements to enhance clarity and predictability for users of headless and SDK sessions, as this directly addresses the identified gaps in documentation.

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

claude-code - 💡(How to fix) Fix [DOCS] Headless and Agent SDK docs omit session auto-title background request behavior [1 participants]