MoonshotAI / MoonshotAI/kimi-cli
Windows: old kimi-code sessions not migrated to .kimi after upgrade; kimi migrate command missing
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 11.4k
- Forks
- 1.3k
- Avg merge
- 9h 47m
- Merged PRs (30d)
- 2
Description
Windows: old kimi-code sessions not migrated to .kimi after upgrade; kimi migrate command missing
Summary
After installing/upgrading from the old kimi-code client to the new kimi 1.49.0 on Windows, old session data stored in %USERPROFILE%\.kimi-code was not migrated to the new data directory %USERPROFILE%\.kimi. The new client creates an empty session with the same session ID, which makes it appear as if all conversation history, todo lists, and background task state were lost.
Additionally, the kimi migrate subcommand documented in the official cheat sheet is not available in the installed 1.49.0 build.
Environment
- OS: Windows 10/11 (Git Bash available)
- New client:
kimi1.49.0, installed atC:\Users\happy\.local\bin\kimi.exe - Old client:
kimi-code, installed viauvatC:\Users\happy\AppData\Roaming\uv\tools\kimi-cli\ - New client info:
kimi-cli version: 1.49.0agent spec versions: 1wire protocol: 1.10python version: 3.13.14
Steps to reproduce
- Use old client
kimi-code; data is written toC:\Users\happy\.kimi-code\. - Install/upgrade to new client
kimi1.49.0 atC:\Users\happy\.local\bin\kimi.exe. - Launch the new client.
- Observe log lines:
Session session_9cb81023-1ddb-4954-8461-94db0428dc3d not found, creating new session Resuming session: session_9cb81023-1ddb-4954-8461-94db0428dc3d - The session with the same ID exists in the new data dir, but is an empty shell:
state.jsoncontains{"todos": []}context.jsonlcontains only the_system_prompt- No user/assistant messages, no todo list, no background task records.
Actual behavior
- Old session data is present in
.kimi-code\sessions\...but is ignored by the new client. - New session list shows an empty session with a confusingly identical session ID.
- Todo list and background task state appear lost.
kimi migrate --helpfails:PS> kimi migrate --help Usage: kimi [OPTIONS] [COMMAND] [ARGS]... Try 'kimi -h' for help. Error No such command 'migrate'.
Expected behavior
Any of the following would be acceptable:
- On first launch, the new client detects
%USERPROFILE%\.kimi-codeand migrates sessions to%USERPROFILE%\.kimi. - At minimum, provide a working
kimi migratesubcommand. - If migration is intentionally not performed, show a clear warning: "Old client data detected at
.kimi-codebut was not migrated. Usekimi migrateor manually archive the old directory."
Evidence that old data still exists
Old data is intact at:
C:\Users\happy\.kimi-code\sessions\wd_happy_f13ace9fd951\session_9cb81023-1ddb-4954-8461-94db0428dc3d\
Contents include:
agents/main/wire.jsonl: 2341 lines totalllm.request: 315usage.record: 311context.append_message: 71turn.prompt: 34
agents/main/tasks/bash-*/output.log: 15 background tasksstate.json: old title0719·产Kimi·重建, last prompt我输3次密码了没看到测试
Token usage from the old session:
inputOther: 371,037output: 98,624inputCacheRead: 32,539,750- Total: ~33,009,411 tokens
Impact
- Productivity: The user must manually inspect old
wire.jsonlto reconstruct task state. - Quota cost: Recovering context requires extra LLM calls. Even though most of the old tokens were cache reads, the recovery process itself consumes fresh quota.
- Trust: After an upgrade, it looks like history was wiped. This is especially confusing because the session ID is reused but the data is empty.
Suggested fixes
- Implement or restore
kimi migrateon Windows. - On first run, detect
~/.kimi-codeand either auto-migrate or print an explicit migration prompt. - After migration, print a summary: how many sessions were migrated, how many were skipped as empty, which config keys were dropped/renamed, and which credentials need re-login.
- Provide a safe archive command (
kimi archive-old-state) to avoid two long-lived state trees. - Consider surfacing per-session quota usage (
kimi usage --by-session) so users can understand which sessions consumed quota during migration issues.
Compensation request
Because of this migration gap, I had to spend additional quota manually recovering session context from the old wire.jsonl and re-establishing the task state. I would appreciate a quota credit for the extra consumption caused by the missing migration tooling and misleading "empty session" UX.
If compensation is possible, please apply it to the Kimi Code account associated with this report.
Related issues
- #2437 — Migration Feedback: unclear state migration, quota attribution confusion, and possible agent quality regression
Official docs referenced
- Cheat sheet mentioning
kimi migrate: https://www.kimi.com/id-id/resources/kimi-code-cheat-sheet - Sessions and context guide: https://moonshotai.github.io/kimi-cli/en/guides/sessions.md
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the upgrade with data in %USERPROFILE%\.kimi-code and the empty session created in %USERPROFILE%\.kimi; inspect the CLI entry point for command registration and the session-data handling around kimi migrate. Done means old sessions are migrated or a clear actionable warning is shown, with migration results and skipped data reported; verify the command on Windows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100