[FEATURE] Add fork_context option to Task tool for full conversation inheritance

Resolved 💬 4 comments Opened Jan 3, 2026 by papersson Closed Jan 7, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

When spawning subagents via the Task tool, Claude generates prompts that include relevant context. This works well for delegation. However, there are cases where you need the subagent to have full conversation history rather than Claude's interpretation of what's relevant:

  • Research/exploration: Investigating a side question while retaining full awareness of constraints, decisions, and nuances established earlier
  • Decision validation: Having a subagent independently assess a plan or approach with complete context of why certain options were ruled out
  • Continuation of thought: Branching the conversation to explore an alternative without polluting the main thread

Currently, subagents start with zero context. Claude summarizes what it thinks is relevant, but this is lossy, the subagent may miss important context that would inform its work.

Proposed Solution

Add a fork_context parameter to the Task tool:

Task({
  prompt: "Investigate whether a distributed lock would work better than our mutex approach",
  subagent_type: "Explore",
  fork_context: true
})

Behavior:

  • fork_context: false (default): Current behavior—Claude generates a context-aware prompt
  • fork_context: true: Subagent receives full parent conversation history with the prompt appended

Results return using current Task behavior (no changes there).

If the parent context is large, let the subagent handle it naturally (e.g. compact if needed).

Alternative Solutions

  • Manual context passing: Include relevant context in the Task prompt manually. Works but lossy and verbose.
  • Conversation forking (Esc+Esc): Creates interactive session fork. Works but not programmatic, and doesn't return a result to parent.

Priority

Medium - Would be very helpful

Feature Category

API and model interactions

Use Case Example

Scenario: Mid-session exploration

I'm 40 messages into debugging an authentication system. We've established that sessions use Redis, discussed several approaches, and ruled out JWT for specific reasons. Now I want to explore a tangential question: "Could we cache the address lookup tables?"

Without fork_context:

Task(prompt: "We're debugging auth, using Redis for sessions, ruled out JWT because X, Y, Z.
              Now investigate: could we cache address lookup tables?")

I have to manually summarize context. If I miss something (like why we ruled out a caching approach earlier), the subagent might retread that ground.

With fork_context:

Task(prompt: "Investigate whether caching address lookup tables would help", fork_context: true)

Subagent has full context, can reference prior decisions, won't re-suggest things we already ruled out.

Scenario: Decision validation

Before committing to an approach, I want a "second opinion" that considers all the context:

Task(prompt: "Review our planned approach and identify potential issues we haven't considered",
     subagent_type: "Explore", fork_context: true)

The subagent can assess the plan with full awareness of constraints and tradeoffs discussed.

Additional Context

Why opt-in (not default): Clean slate is sometimes better. For example, a code review agent probably benefits from fresh perspective without anchoring bias from the conversation. Fork context should be explicitly requested when full history matters.

Relation to custom agents: This would be particularly valuable for custom agents built on Claude Code primitives. Research agents, validation agents, and most exploration-focused agents would benefit from fork capability. The current clean-slate approach makes sense for task-specific agents like code reviewers that benefit from objectivity.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗