Comparison 7 min read | November 20, 2026

Which AI agent task lists survive compaction? Claude Code, Codex and Cursor compared, plus a 2-minute test

After compaction, does your coding agent still know which tasks are done? What Claude Code, Codex and Cursor actually keep, according to their docs and open issues, a 2-minute test you can run, and a task list that compaction cannot touch.

A task list that lives outside the chat, so compaction cannot drop it

Leave your email and we'll send the setup tutorial for a local task store that Claude Code, Codex and Cursor can all read. You can tell us which agent you use before any price is shown.

Step 1 of 4

This needs to be a real email — we'll email you in a few minutes.

No spam. Unsubscribe anytime.

You gave your coding agent a ten-step job. It made a tidy checklist, ticked off four items, and then the context filled up and the chat compacted. Now it either asks what you would like to work on, or it starts step two again as if steps one to four never happened.

Whether that happens depends on where the agent keeps its task list. Some lists live outside the conversation and survive compaction. Others are just tool calls inside the conversation, and they survive only if the summary happens to keep them. This page compares Claude Code, OpenAI Codex and Cursor, based on their official docs and public GitHub issues, and gives you a test to check your own setup instead of trusting anyone's claim, including ours.

The short comparison

AgentBuilt-in task listSurvives compaction?Shared with a new session?
Claude CodeTask tools (TaskCreate, TaskList…), Ctrl+T to viewYes, per the docs, on models that have the task toolsOnly with CLAUDE_CODE_TASK_LIST_ID
CodexPlan via the update_plan toolOnly what the compaction summary keepsNo, unless you resume or fork that chat
CursorAgent to-dos in the chat; Plan Mode plans as markdown filesTo-dos: only what summarization keeps. Plan file: yesThe plan file, if you point the new chat at it
A file or MCP task storeWhatever you put thereYes, it is outside the chatYes, if the agent reads it at the start

Claude Code: survives, with two catches

Claude Code's task list is backed by built-in tools: TaskCreate, TaskGet, TaskList and TaskUpdate (the older TodoWrite is off by default in favor of them). The interactive mode docs say plainly: "Tasks persist across context compactions." Press Ctrl+T to see the list, or ask "show me all tasks".

The catches:

  • Model. The tools reference says the task tools are on by default only on Opus 4.7, Sonnet 4.6, Haiku 4.5 and earlier models. On newer models Claude keeps track of the work without a written checklist, so there is no list to survive anything. To get the list back, start with CLAUDE_CODE_ENABLE_TODO_TOOLS=1 claude.
  • Session. The list belongs to the session. To share one list across sessions, start Claude Code with CLAUDE_CODE_TASK_LIST_ID=my-project claude, which keeps it in a named directory under ~/.claude/tasks/.

Older versions behaved differently: a Claude Code issue from April 2026 (#47533) reported TaskList returning "No tasks found" after compaction. If you are on an old build, update, then run the test below. Also note that the task list holds task titles and status, not the reasoning behind them. Decisions and the plan itself can still be summarized away; our guide to keeping Claude Code's plan after compaction covers that part.

Codex: the plan lives in the conversation

Codex tracks multi-step work with a tool called update_plan. In the open-source tool definition, each plan item is a step with a status of pending, in_progress or completed, and at most one step can be in progress. The plan is a tool call in the chat history. There is no separate plan file that Codex reloads.

So after compaction, the plan is only as good as the summary. Two public reports show what can go wrong:

  • openai/codex #38931 (open): the summary kept the wording of an earlier plan but not which steps were done, so Codex re-ran an investigation it had already finished.
  • openai/codex #31822: with the experimental token_budget feature on, compaction starts a fresh context window with no summary, and the task disappears entirely. codex features disable token_budget restores normal compaction.

codex resume reopens a saved chat, but as saved: if it compacted, you get the compacted version. The full recovery steps are in Codex CLI compaction lost your context?

Cursor: to-dos in the chat, plans in a file

Cursor's agent makes structured to-do lists for longer tasks and updates them as it works (introduced in Cursor 1.2). Those to-dos are part of the chat. When a long chat fills up, older turns are summarized, and Cursor staff on the Cursor forum describe that summarization as lossy. Their advice: start a new chat for each separate task, and keep durable instructions in rules files.

Plan Mode is the exception. According to the Plan Mode docs, plans are saved as files, in your home directory by default, or in the workspace if you click "Save to workspace". That file survives summarization and new chats. Save it to the workspace, keep its checkboxes current, and start the next chat with "read the plan file and continue from the first open item". More on this in Cursor agent forgot earlier requests?

The 2-minute test

Docs change and versions differ, so check your own setup. In a throwaway repo:

  1. Ask: "Make a three-step task list for adding a README, a LICENSE and a .gitignore. Do step one only, then mark it done."
  2. Compact: run /compact in Claude Code or Codex. In Cursor, keep working in the same chat until it summarizes.
  3. Ask: "List every task with its status. Do not do any work."

Pass: step one is done and steps two and three are open. Fail: the list is empty, step one is open again, or the agent starts step one over. Run it once on the model you actually use; in Claude Code the model decides whether the task tools exist at all.

A task list compaction cannot touch (free)

Compaction rewrites the chat, never your files. So the most reliable list is a file in the repo. Create TASKS.md:

# Tasks
Goal: add project docs

- [x] 1. README.md
- [ ] 2. LICENSE (MIT)
- [ ] 3. .gitignore for Node

Decisions: MIT chosen by owner. Do not add CI yet.
Next: 2

Then add a rule to AGENTS.md (Codex and Cursor read it; for Claude Code, put the same lines in CLAUDE.md or import @AGENTS.md from it):

## Tasks
- Read TASKS.md before starting work and after any compaction.
- After each finished step, tick it in TASKS.md and update "Next".
- Never redo a ticked item.

To put the list back automatically after a compact, both Claude Code and Codex support a SessionStart hook with a compact matcher that prints a file into context. Tested examples are in the Claude Code guide and the Codex guide.

Where the file runs out: nothing forces the agent to update it, a checkbox has no "in progress" or "blocked by", and two agents editing the same file at once can overwrite each other's ticks.

Where Todo-MCP fits, honestly

Todo-MCP is a local MCP server that runs over stdio on your machine. Tasks, their status and dependencies, and named context notes are stored in a SQLite file, outside any chat, so compaction cannot drop them. Claude Code, Codex and Cursor on the same machine can all be connected to it and read the same list. After a compaction or in a new session, the agent calls context_resume and gets the current task, saved context and a suggested next step. It is a paid download, and the data stays on your machine. To see the options, leave your email in the form on this page first: it sends the setup tutorial and then shows plans.

What it will not do:

  • It does not change how any agent compacts. It keeps the list somewhere compaction does not reach.
  • It does not load itself. Add a line such as "after compaction or at the start of a session, call context_resume" to AGENTS.md or CLAUDE.md; the agent still has to make the call.
  • In ChatGPT it runs from the desktop app (Work or Codex, Settings → MCP servers), not from the ChatGPT website, which connects only to remote MCP servers.

Setup guides: Claude Code, Codex CLI, Cursor. For the bigger picture of rules files, memories and handoff notes across all three tools, see How to add memory to Claude Code, Cursor and Codex.

Whatever you choose, run the 2-minute test. If the list does not come back with step one ticked, it is not a list you can leave a long job to.

A task list that lives outside the chat, so compaction cannot drop it

Leave your email and we'll send the setup tutorial for a local task store that Claude Code, Codex and Cursor can all read. You can tell us which agent you use before any price is shown.

Step 1 of 4

This needs to be a real email — we'll email you in a few minutes.

No spam. Unsubscribe anytime.

Frequently asked questions

Does the Claude Code task list survive compaction?
According to the Claude Code interactive mode docs, yes: tasks persist across context compactions. Two catches. The task tools are on by default only on Opus 4.7, Sonnet 4.6, Haiku 4.5 and earlier models; on other models the list stays empty unless you start Claude Code with CLAUDE_CODE_ENABLE_TODO_TOOLS=1. And the list belongs to the session unless you set CLAUDE_CODE_TASK_LIST_ID, which stores it in a named directory under ~/.claude/tasks/ so other sessions can share it.
Does the Codex plan survive compaction?
The Codex plan is written with the update_plan tool, as steps with a status of pending, in_progress or completed, inside the conversation. There is no separate plan file. Compaction replaces the history with a summary, so what survives is whatever the summary kept. An open GitHub issue (openai/codex #38931) reports the plan wording surviving while completed steps come back as pending, and with the experimental token_budget feature on, compaction can start a fresh window with no summary at all (#31822).
Do Cursor agent to-dos survive context summarization?
Cursor to-dos are part of the agent chat. Cursor staff describe chat summarization as lossy on the Cursor forum, and recommend starting new chats for separate tasks and keeping durable instructions in rules files. A Plan Mode plan is different: it is saved as a markdown file (in your home directory by default, or in the workspace if you click Save to workspace), so it survives the chat. Keep the plan file current and point new chats at it.
How do I test whether my agent's task list survives compaction?
Ask the agent to make a three-step task list for a small job, let it finish step one and mark it done, then run /compact (Claude Code or Codex) or keep going until Cursor summarizes. Then ask: list every task with its status. If step one comes back as done and steps two and three as open, the list survived. If the list is empty, or step one is open again, it did not.
What is the simplest task list that always survives compaction?
A file. Keep TASKS.md in the repo with one checkbox per task, and tell the agent in AGENTS.md (or CLAUDE.md) to read it at the start, update it after every step, and re-read it after compaction. Compaction only rewrites the chat, so a file on disk is untouched. Its weak points are that nothing forces the update and parallel agents can overwrite each other.

Continue Reading

Back to all articles