Feature: Allow subagents to inherit parent conversation context
Problem
When spawning subagents via the Agent tool, each subagent starts with a completely blank context. The only way to give a subagent relevant context is to manually summarize/paste it into the prompt parameter.
Meanwhile, /fork (aka /branch) creates an interactive conversation branch that preserves the full parent history — but it's interactive only, not backgroundable.
There's no way to combine these: spawn a background subagent that inherits the parent conversation's context.
Use Case
When working on a complex investigation (e.g., analyzing what would break if moving a directory), the parent conversation accumulates significant context — file contents read, tool results, intermediate reasoning. If you want to spin off a parallel investigation that builds on that context, you currently have to either:
- Use
/forkand interact with it yourself (gets history, but blocks you) - Use the Agent tool and manually re-summarize everything into the prompt (backgroundable, but lossy and verbose)
Proposal
Allow the Agent tool to optionally inherit the parent conversation's transcript, similar to how /fork works but in a non-interactive, backgroundable way. Something like:
Agent(
prompt="Now investigate X based on everything we've discussed",
inherit_context=true, // or fork_from="parent"
run_in_background=true
)
This would effectively be a "background fork" — the subagent gets the full parent context as a starting point, then runs the new prompt autonomously.
Experiment Done
We verified the current limitations:
- Passing
/branchas a prompt string to Agent → treated as plain text, no history inherited - Passing a parent session ID via
resume→ fails with "No transcript found" (resume only works with subagent IDs) /forkworks for interactive branching but can't be dispatched as a background task
Alternatives Considered
- Summarize into prompt: Works but lossy, especially for large contexts with many tool results
- Resume a subagent: Only resumes the subagent's own prior transcript, not the parent's
🤖 Generated with Claude Code
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗