Kimi --continue not work

Yesterday I used Kimi-cli on my Linux server. When I reconnect it today, I first went to the project dir and try to use kimi --continue to resume my chat. But there is an error:

kimi --continue
Usage: kimi [OPTIONS] COMMAND [ARGS]…
Try ‘kimi -h’ for help.
Error: Invalid value for --continue: No previous session found for the working directory。

Should I manually save the chat every time?

Check your session metadata file

As far as I know, Kimi CLI stores session mappings in $HOME/.kimi/kimi.json, which maps absolute working directory paths to session IDs. The actual conversation data is stored in $HOME/.kimi/sessions/<session_id>/.

Under normal circumstances, this JSON file gets updated when you exit the session properly using /exit or Ctrl+D. Since you’re using a remote Linux server, the issue might be:

  1. The session wasn’t properly closed – If your SSH connection dropped or the process was killed, the metadata might not have been written.
  2. Different working directories – Kimi matches sessions by absolute path. Double-check you’re in the exact same directory (e.g., /home/user/project vs /path/symlink/to/project can sometimes resolve differently).
  3. File permissions – Ensure your user owns $HOME/.kimi/ and has write access.

Quick troubleshooting steps:

$ kimi --yes
# List all available sessions interactively and select one to resume
✨  /sessions
        /sessions (resume)          List sessions and resume optionally
....


# Or if you want to check the raw data:
cat $HOME/.kimi/kimi.json  # maps working dir -> session ID
ls -la $HOME/.kimi/sessions/

To prevent this in the future:

While you don’t need to manually save every message, it’s good practice to exit gracefully using /exit before disconnecting SSH. Alternatively, consider using tmux or screen to keep the Kimi session alive even if your SSH connection drops—this way you can simply reattach to the tmux session without worrying about the Kimi session state.

Hope this helps!

2 Likes

Thanks for your detailed explanation. That’s worked for me.

1 Like