← AUTOMATER NEWSROOM

Kimi Code’s canary can move an ongoing session into a new Git worktree

Kimi Code CLI users can plan in one checkout and carry the same conversation into a new worktree. Uncommitted edits stay in the original checkout.

A Kimi Code session moves from the original checkout to a new Git worktree with its conversation. Uncommitted edits stay in the original checkout.A Kimi Code session moves from the original checkout to a new Git worktree with its conversation. Uncommitted edits stay in the original checkout.
The Move current option carries the conversation into the new worktree. Uncommitted edits stay in the original checkout. Illustration based on Moonshot AI’s Kimi Code pull request #5646.

Moonshot AI’s November 27 Kimi Code CLI canary lets developers move an ongoing local session into a newly created Git worktree in the same repository. A developer can investigate a bug or plan a refactor in their usual checkout, then give the implementation its own checkout once the scope is clear. Kimi keeps the conversation visible and changes the directory where the agent works. Moonshot lists the feature in its 2.9.0-canary.20261127130549-5304618 prerelease. Moonshot AI’s release notes

GitHub release page for Moonshot AI’s Kimi Code CLI 2.9.0 canary
Moonshot AI’s Kimi Code CLI canary release page on GitHub. · Original source

When to move the session

Suppose you ask Kimi to trace how your application loads configuration. After a few turns, you’ve agreed on which code to change and which tests should catch regressions. The next step is to write the patch, but your usual checkout already contains changes for another task. A separate worktree gives the patch its own checkout, and moving the session carries over the decisions you just made. The pull request shows this pattern in a terminal demo and explicitly says that uncommitted changes stay in the original directory. A file the agent read during planning may therefore look different in the new worktree if the earlier copy had local edits. Kimi Code pull request #5646

That distinction also helps you choose between the two options in the form. Move current fits a task whose plan still applies to the chosen Git base. Start new gives a separate task a fresh conversation. If the plan depended on an uncommitted change, identify that dependency before continuing. For example, if the agent inspected a locally modified configuration loader, have it reopen that file in the destination and explain any difference that affects the plan before it edits. If your project uses a database branch per checkout, verify that separately as well. Verify each Git worktree’s database branch with Neon CLI Checkout

How to make and verify the move

  1. In the Kimi Code terminal UI, let the current turn finish. Run /worktree and use Ctrl+N to bring up the worktree creation form. For a local session with conversation history, the form shows a Session row with Move current selected by default.
  2. Check the worktree name and the Base field before submitting. The base determines the code the agent will see in the new checkout. The implementation checks that the session is idle and blocks the move before creating a worktree if scheduled cron tasks are active.
  3. After the move, check that the existing chat is still visible and the status bar names the new worktree. Make the first request a read-only check. Ask the agent to report its working directory and branch, and to reopen any file central to the agreed change. Compare the answers with the destination you intended before asking for edits.

The pull request documents the form, its default, and the checks before relocation. The November 29 YZ Radar edition also covers the canary workflow and flags scheduled tasks as a potential blocker. Kimi Code pull request #5646 · YZ Radar’s November 29 edition

How Kimi tells the model where it moved

The implementation rebinds the existing session to the destination directory. It keeps the original system prompt and tool schemas intact so the existing prompt prefix can still be reused. On the next turn, Kimi tells the model that the working directory changed and supplies updated project-level AGENTS.md instructions when their contents differ. The pull request describes prefix-preservation tests with a fake model, so the documented result concerns the prompt Kimi constructs. Actual cache hits, latency, and cost depend on the model provider and request conditions. Kimi Code pull request #5646

Sources

  1. Release Kimi Code CLI 2.9.0-canary.20261127130549-5304618 · MoonshotAI/kimi-code · GitHub
  2. feat(worktree): move active session when creating a new worktree by Grapedge · Pull Request #5646 · MoonshotAI/kimi-code · GitHub
  3. Daily edition: 29 November 2026 | YZ Radar