AI agents

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 CodeCodexKimi 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 promptVia /compact instructions and PreCompact hooks (matcher manual/auto)compact_prompt / experimental_compact_prompt_file config keysVia /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-O toggles 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; /cost shows token usage and cost.
  • Codex: /status shows session config and token usage, including context left.
  • Kimi Code: /usage shows token usage, context consumption, and quota; Ctrl-O expands/collapses tool output and compaction summaries.

Session resume and fork

TaskClaude CodeCodexKimi Code
Resume most recent (cwd)claude -ccodex resume --lastkimi -c
Resume by ID/name or pickerclaude -r <id-or-name>; /resume in-sessioncodex resume [SESSION_ID] (picker by default); /resume in TUIkimi -S [id] (selector without ID); /sessions in TUI
Resume non-interactive sessionclaude -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 conversationcodex fork [SESSION_ID]; /fork in TUI/fork copies the session with full history (you stay in the current one)
Manage saved sessionsTranscripts under ~/.claude/projects/codex archive / unarchive / delete; /archive, /delete in TUIkimi session list; sessions under $KIMI_CODE_HOME/sessions/<workDirKey>/

Behavior notes:

  • Codex scopes resume to the cwd unless --all is passed; if the cwd differs from the session’s saved directory it asks which directory to use (config: tui.resume_cwd; explicit --cd wins). codex fork preserves the original transcript.
  • Kimi Code restores the bound agent and the saved permission/plan mode on resume. The docs conflict on whether --yolo/--plan can override the saved mode when resuming (kimi-command.html says yes, overrides.html says no) — treat this as unresolved. A saved /goal is not copied by /fork; the CLI prints a ready-to-run kimi --resume command 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 — /rewind rolls 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:

AI coding tools evolve quickly. If you find outdated information, please open an issue or pull request.