[FEATURE] Add context_isolation parameter to Task tool

Resolved 💬 3 comments Opened Oct 10, 2025 by widoriezebos Closed Oct 14, 2025

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

Summary

Add a context_isolation parameter to the Task tool that allows launching subagents without inheriting the full
conversation history from the parent session.

Motivation

Currently, when launching subagents with the Task tool, they inherit the entire conversation context from the main
session. This can be inefficient when:

  • The subagent only needs a specific prompt to complete its task
  • The conversation history is large but irrelevant to the subagent's work
  • Running multiple parallel agents that could operate independently
  • Managing token budgets more efficiently across long sessions

Proposed Solution

Proposed API

Task(
subagent_type="image-markdown-critic",
context_isolation=True, # Launch agent without conversation history
prompt="Process critique queue"
)

When context_isolation=True:

  • The subagent starts with a clean context
  • Only the provided prompt is sent to the subagent
  • The subagent's response is still returned to the parent session
  • Token usage is reduced for self-contained tasks

When context_isolation=False (default):

  • Current behavior: subagent inherits full conversation history

Use Cases

  1. Parallel batch processing - Launch multiple isolated agents to process independent tasks
  2. Long-running sessions - Prevent context bloat when spawning agents late in a conversation
  3. Focused analysis - Run specialized agents (linters, formatters, critics) without irrelevant context
  4. Cost optimization - Reduce token usage for agents that don't need full history

Alternative Solutions

No alternative solution. I need to manually do a /clear and this blocks any pipeline the agent(s) are working on

Priority

High - Significant impact on productivity

Feature Category

Interactive mode (TUI)

Use Case Example

Multi-agent document processing pipeline - Building a system that ingests files from various formats (PDF, DOCX,
images, etc.) and converts them to markdown with described images. The pipeline uses multiple specialized agents
(parsers, converters, image describers) followed by a critique agent that verifies output quality. The critique
agent's performance degrades when it inherits context from previous agents' processing details, as this context
pollution interferes with objective quality assessment. With context_isolation=True, the critique agent could
evaluate outputs with a clean context, significantly improving its accuracy and consistency.

Additional Context

_No response_

View original on GitHub ↗

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