Feature Request: Interactive Sub-Sessions with Context Isolation
Feature Request: Interactive Sub-Sessions with Context Isolation
Summary
Request: Allow forking to an interactive sub-session that isolates token burn from the parent session while preserving user interactivity.
Why it matters: High-token interactive workflows (brainstorming, multi-perspective analysis, creative exploration) currently force a trade-off: run inline and lose original context to token bloat, or run as a background agent and lose interactivity. This feature enables both rich exploration and clean context management.
Proposed Solution
An interactive sub-session that:
- Runs interactively - user can interact with the sub-session
- Is context-isolated - token burn stays in the fork, not the parent
- Returns a summary - only the distilled output comes back to the parent
- Resumes cleanly - parent session picks up where it left off
Example Flow
Main Session (30K tokens)
↓
User: "Let's brainstorm approaches to this problem"
↓
[Fork to Interactive Sub-Session]
↓
Sub-Session: User and agent brainstorm interactively (burns 80K tokens)
↓
User: "Okay, let's go with approach #3"
↓
[Sub-Session ends, summary returns to parent]
↓
Main Session (30K + 5K summary = 35K tokens)
- Has full context of what we were doing before
- Has the brainstorm conclusion
- No lost-in-the-middle problem
Context Inheritance Options
- Context-free fork: Sub-session starts fresh (good for pure brainstorming)
- Context-inherited fork: Sub-session receives parent context snapshot (good for analysis needing background)
Similar to git branches (fork, work, merge back), process forking with IPC, or Jupyter's "run in separate kernel" approach.
Problem Details
Interactive workflows generating 50-100K+ tokens cause lost-in-the-middle problems when run inline: the original context gets pushed deep into mid-context and is no longer reliably recalled.
Current options do not solve this:
- Background agents (Task tool): Context-isolated, but not interactive
- Inline execution: Interactive, but token burn pollutes the main session