Who it is forA developer on a multi-hour refactor who loses track of which files and tasks were in progress after the agent compacts the conversation.
The problemWhen the conversation compacts, the agent forgets which files it was editing, what tasks are open, and what the user last asked for.
The outcomeAfter compaction the agent retrieves the relevant events through BM25 search and continues the same task.
What you need first
- Claude Code v1.0.33+ for the plugin install, or Node.js >= 22.5 (or Bun) for the Gemini CLI setup
- An existing AI coding agent session in a project you want to work on
Steps
- Install Context Mode with the Claude Code plugin steps from the README.
- Work on the task so that file edits, git operations, and decisions are recorded.
- When the session compacts, let the agent continue in the same session.
- If you need the earlier data in a later session, start that session with
--continue, because without it previous session data is deleted immediately.
Prompt for your agent
After a context compaction in the <project-name> repo, use context-mode to search the session events for the last edited files and open tasks. List them and ask me to confirm before continuing the work.
Caveat. The README says previous session data is deleted unless you use --continue, so plan which sessions you want to keep before starting a new one.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for mksglu/context-mode and "Pick up a coding task after the chat compacts"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer