Context
Understanding context windows and how decopilot keeps your workspace focused and efficient
This page documents the planned architecture for decopilot context. The implementation is in development.
Every AI model works within a fixed context window—think of it as the model’s “working memory” for your conversation. Managing this space well is essential for smooth, productive workflows with decopilot.
Decopilot automatically balances what goes into your context window: instructions from your current scope, available tools, conversation history, and more. Larger context windows mean you can accomplish more complex work in a single session before needing to refresh.
Understanding Context Slots
Decopilot organizes your context window into distinct slots, each serving a specific purpose:
- System prompt - Core decopilot behavior and capabilities
- Scope instructions - Guidelines from your current scope (organization, project, or agent-specific)
- Built-in tools - Essential decopilot operations always available
- Enabled tools - Additional tools you’ve activated during your session
- Conversation history - Your recent messages and decopilot’s responses
- Compactification buffer - Summarized older conversation context
This slot system ensures the most important context stays available while managing space efficiently.
Context Health: The 40/80 Rule
Your context window performs best when it’s not too full. Here’s what to watch for:
- Below 40%: Optimal performance—plenty of room for complex reasoning and long conversations
- 40-80%: Context starts to degrade—still functional but approaching limits
- Above 80%: Time to refresh—decopilot automatically compactifies your conversation history
When your context reaches 80% capacity, decopilot automatically clears the conversation history slot and compactifies it into the buffer. This process summarizes your conversation while preserving important context, giving you room to continue working.
You can manually trigger compactification anytime using the /compact command—useful when you want to free up space before starting a new phase of work.
Keeping Context Lean
The best way to work efficiently is to avoid filling your context unnecessarily. Here are two key techniques:
Compactification
Compactification summarizes older conversation history while preserving key information. Think of it as consolidating your notes—you keep the important decisions and outcomes, but remove the back-and-forth exploration that led there.
When to compact:
- Automatically triggers at 80% context capacity
- Manually via
/compactcommand before starting complex work - After completing a major task but before moving to the next one
Subtasks
Using subtasks for specific work keeps your main context clean. Subtasks run in their own isolated context space, then return only a summary of results to your main conversation. You can optionally spawn agents—specialists in specific fields—into subtasks to bring domain expertise to the isolated work.
Example with subtask only:
You: "Spawn subtask to analyze stock ruptures"
│
▼
Decopilot creates subtask
│
▼
Subtask analyzes inventory (isolated context)
│
▼
Returns: "3 critical SKUs need reorder, 5 can wait..."
│
▼
Main context: Only sees summary
Example with specialist agent:
You: "Use inventory specialist to analyze stock ruptures"
│
▼
Decopilot searches for agents
│
▼
Finds: "Inventory Optimizer" & "Supply Chain Analyst"
│
▼
Decopilot: "Which agent would you prefer?"
│
▼
You: "Inventory Optimizer"
│
▼
Spawns Inventory Optimizer as subtask
│
▼
Specialist forecasts demand, optimizes reorders (isolated context)
│
▼
Returns: "Reorder 500 units SKU-123 from supplier B..."
│
▼
Main context: Only sees summary
This pattern is especially powerful for:
- Research and exploration tasks
- Running tests and analyzing results
- Code reviews and security scans
- Any work that generates lots of output you don’t need to see in full detail
See Agents for more on how agents provide fresh, focused context for specific tasks.
How Scopes Affect Context
Each scope has access only to its own tools and resources. When you switch scopes, the tools available through tool_search change to match that scope’s virtual MCP, and the instructions that load into the scope instructions slot change—organization, project, or agent-specific. See Scopes for details.
Practical Tips
Here are actionable ways to keep your context healthy and productive:
Watch your context health - Pay attention to how full your context is. When it hits 40%, consider wrapping up the current phase of work or compacting.
Use /compact strategically - Manually compact before starting complex new work, after completing major tasks, or when switching between different focus areas.
Spawn agents for heavy lifting - Research, testing, code reviews, and any work that generates verbose output should happen in spawned agents. Keep summaries, not details, in your main context.
Enable tools selectively - Don’t enable every available tool “just in case.” Enable tools from your current scope as you need them for specific tasks.
Work in the right scope - Use organization scope for cross-project work, project scope for focused development, and let agents handle task-specific work with fresh context.
Think modular - Break complex work into phases. Complete one phase, compact or spawn for the next. This keeps each phase focused and your context manageable.
Why Context Matters
Good context management isn’t just about staying under limits—it’s about maintaining quality. When context is clean and focused:
- Decopilot reasons more clearly about your specific problem
- Conversations stay on track without getting lost in accumulated details
- Complex multi-step workflows remain manageable
- You spend more time making progress, less time resetting context
By understanding how context works and using the tools available—compactification, agent spawning, selective tool enabling—you can work more effectively with decopilot across projects of any complexity.
Next steps: Learn about Scopes to understand how context changes at different levels, or explore Agents to see how fresh context isolation works in practice.
Found an error or want to improve this page?
Edit this page