Comparisons
Context Management
Compaction, context inspection, session resume/fork, and undo differ subtly across the three tools. Everything below is from the verified research notes.
Related per-tool pages: Claude Code — Workflows · Codex CLI workflows · Workflows
Compaction
| Claude Code | Codex | Kimi Code | |
|---|---|---|---|
| Manual compaction | /compact [instructions] — optional focus instructions guide the summary | /compact — summarizes the visible chat | /compact [instruction] — optional instruction hints what to preserve |
| Automatic compaction | ✅ At ~95% of the context window; override with CLAUDE_AUTOCOMPACT_PCT_OVERRIDE; applies to the main conversation and subagents | ✅ Triggers at model_auto_compact_token_limit | ✅ Triggers when context nears the limit; threshold is [loop_control] reserved_context_size |
| Custom summary prompt | Via /compact instructions and PreCompact hooks (matcher manual/auto) | compact_prompt / experimental_compact_prompt_file config keys | Via /compact instruction |
Notes:
- In Claude Code, subagent transcripts are unaffected by main-conversation compaction.
- In Kimi Code, prompts sent before the last compaction cannot be undone, and
Ctrl-Otoggles the compaction summary in the UI. Since 0.41.0 the model is reminded of its context budget before auto-compaction runs.
Context inspection
- Claude Code:
/context [all]visualizes context window usage;/costshows token usage and cost. - Codex:
/statusshows session config and token usage, including context left. - Kimi Code:
/usageshows token usage, context consumption, and quota;Ctrl-Oexpands/collapses tool output and compaction summaries.
Session resume and fork
| Task | Claude Code | Codex | Kimi Code |
|---|---|---|---|
| Resume most recent (cwd) | claude -c | codex resume --last | kimi -c |
| Resume by ID/name or picker | claude -r <id-or-name>; /resume in-session | codex resume [SESSION_ID] (picker by default); /resume in TUI | kimi -S [id] (selector without ID); /sessions in TUI |
| Resume non-interactive session | claude -c -p "query" | codex exec resume [SESSION_ID] [--last] | Resume flags apply to interactive sessions; kimi -p is single-prompt |
| Fork a session | --fork-session on resume; /branch [name] forks an earlier conversation | codex fork [SESSION_ID]; /fork in TUI | /fork copies the session with full history (you stay in the current one) |
| Manage saved sessions | Transcripts under ~/.claude/projects/ | codex archive / unarchive / delete; /archive, /delete in TUI | kimi session list; sessions under $KIMI_CODE_HOME/sessions/<workDirKey>/ |
Behavior notes:
- Codex scopes resume to the cwd unless
--allis passed; if the cwd differs from the session’s saved directory it asks which directory to use (config:tui.resume_cwd; explicit--cdwins).codex forkpreserves the original transcript. - Kimi Code restores the bound agent and the saved permission/plan mode on resume. The docs conflict on whether
--yolo/--plancan override the saved mode when resuming (kimi-command.htmlsays yes,overrides.htmlsays no) — treat this as unresolved. A saved/goalis not copied by/fork; the CLI prints a ready-to-runkimi --resumecommand after forking. - Claude Code additionally supports
--from-pr(resume sessions linked to a GitHub PR) and/teleport(pull a web session into the terminal).
Undo / rewind
This is where the tools diverge most — “undo” means different things:
- Claude Code —
/rewindrolls both code and conversation back to a checkpoint (checkpointing; Esc Esc also rewinds). It can resume from before a/clear. - Kimi Code —
/undo [count]rolls back prompts, the todo list, and plan-mode state — not code changes. Without an argument it opens a selector (also reachable via Esc Esc while idle). Prompts before the last compaction cannot be undone. - Codex has no undo command documented. Esc Esc with an empty composer lets you edit a previous message, which forks the chat — the original transcript is preserved and you branch from the edited point.
In short: Claude’s rewind reverts file changes; Kimi’s undo reverts conversational state only; Codex’s edit-and-fork changes neither past code nor past history — it creates a new branch of the conversation.
Last verified: 2026-09-07
Official sources:
- https://code.claude.com/docs/en/cli-reference.md
- https://code.claude.com/docs/en/commands.md
- https://developers.openai.com/codex/cli/slash-commands
- https://developers.openai.com/codex/config-reference
- https://www.kimi.com/code/docs/en/kimi-code-cli/guides/sessions.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/reference/slash-commands.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/reference/kimi-command.html
AI coding tools evolve quickly. If you find outdated information, please open an issue or pull request.