161 words
1 minutes
How to Compress Conversation Context in GitHub Copilot CLI【/compact】

Overview#

Ever been deep in a conversation with GitHub Copilot CLI and noticed it starting to… forget things you just told it?

You’re not imagining it. As conversations grow longer, the context window fills up and older information gets pushed out.

That’s where /compact comes in.


What’s Going On?#

Copilot CLI has a limited context window — the amount of information it can reference at once. As conversations get longer:

  • It forgets earlier instructions
  • It asks the same questions again
  • Response quality degrades

The Fix: /compact#

Run this in Copilot CLI:

/copilot> /compact

Your conversation history gets summarized and compressed, freeing up context window space. You can also give it a hint about what to prioritize:

/copilot> /compact focus on the auth discussion

/compact vs. /clear#

CommandWhat it does
/compactSummarizes and compresses (keeps context)
/clearResets everything (all context is gone)

Use /compact when you want to keep working on the same task. Use /clear when you want a completely fresh start.


How to Compress Conversation Context in GitHub Copilot CLI【/compact】
https://naonao-na.com/en/posts/github-copilot-cli-compact/
Author
[object Object]
Published at
2026-03-28