[DOCS] Forked sub-agents: availability and cache reporting in headless mode (claude -p)

Open Beginner friendly
#112,495 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
67/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
documentation

Research direction

Start with the sub-agents documentation at https://code.claude.com/docs/en/sub-agents and trace how it explains forked agents and headless mode. Check the documented selection methods and JSON usage and cache reporting for accuracy before editing. Done means the page clearly covers whether forks work with claude -p, how to select them, and how their usage and cache reads appear in reports.

Written by the indexing model from the issue text.

Description

area:agents area:cli area:docs documentation question
Documentation Type

Unclear/confusing documentation

Documentation Location

https://code.claude.com/docs/en/sub-agents

Section/Topic

Forked sub-agents: availability in headless mode (claude -p), selection and cache behaviour

Current Documentation

No response

What's Wrong or Missing?

The page explains that a sub-agent starts fresh unless it is a fork, which starts with a copy of the conversation. It does not say whether a forked sub-agent can be used from claude -p, how to select one (tool parameter, --agents, a flag), or whether its cache reads and cost are reported separately.

Suggested Improvement

Add a short note on headless availability and selection, and on how a fork's usage and cache reads appear in the JSON report.

Impact

Low - Minor confusion or inconvenience

Additional Context

I am looking at the cost of long headless passes that delegate. A fork would start from the parent's context and could read its prompt cache, but I could not tell from the documentation whether that applies in headless mode. I have no measurement showing that sub-agents help on real tasks; this is a documentation question, not a performance claim.

Dominant language
TypeScript
Stars
157k
Forks
25.1k
Avg merge
20h 25m
Merged PRs (30d)
4

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anthropics/claude-code

All issues in anthropics/claude-code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.