In the previous post, we looked at how compaction and infinite sessions work in CLI and SDK. This time, we stay in the IDE and focus on the same core idea: as conversations grow, Copilot summarizes earlier turns so you can keep moving without manually trimming context.
Availability: All GitHub Copilot plans including Free.
One concept, multiple surfaces
Compaction is not a CLI-only trick. The same principle applies across Copilot surfaces: preserve the key decisions, compress older detail, and keep enough working context for the next prompt. In IDE chat, this feels like continuity even as the context window keeps evolving.
How IDE compaction feels in day-to-day work
In practice, you usually do not notice compaction happening. You keep iterating on a feature, bug fix, or refactor thread, and Copilot continues to answer in context. When the thread gets large, older messages are summarized in the background so newer prompts still have room.
| Situation | What compaction helps with | What you should still do |
|---|---|---|
| Long debugging thread | Keeps root-cause decisions in scope while condensing old trial-and-error | Call out confirmed hypotheses clearly in your prompts |
| Feature work across many files | Preserves high-level intent while older code snippets are summarized | Pin critical files/symbols with context mentions when needed |
| Mixed topics in one chat | Reduces history pressure but cannot fully fix topic drift | Start a new chat for unrelated tasks |
Automatic vs manual compaction in IDE chat
Automatic compaction is the default and is enough for most workflows. Manual compaction is useful when you want to intentionally reduce noise and keep only the direction that matters.
- Automatic: happens in the background as context usage gets high.
- Manual: trigger
/compact, optionally with guidance such as/compact focus on API contract decisions.
A practical workflow for cleaner IDE sessions
- Start with a clear objective and constraints in your first prompt.
- Keep one chat thread per problem domain.
- Use context mentions for key files and symbols when details matter.
- If the thread gets noisy, run
/compactwith a short focus instruction. - For unrelated work, start a fresh chat instead of stretching one thread forever.
What compaction does not replace
Compaction keeps long sessions usable, but it is not a substitute for prompt quality. Clear requirements, precise file references, and explicit acceptance criteria still produce the best results. Think of compaction as context hygiene, not a magic fix for vague prompts.
Documentation
Asking GitHub Copilot questions in your IDE ↗ · Manage context for AI (including context compaction) ↗