Kimi Code cleanup

Uninstall Kimi Code Safely

Remove Kimi Code from npm, pnpm, yarn, native installs, IDE extensions, and local login state without deleting the wrong data.

Developer cleanup checklist for Kimi Code
Cleanuppage shape
Kimi K3topic
6further reading links
2026-07-29updated

Keep what matters before you remove anything

First identify how Kimi Code was installed. Removing a global npm package is different from removing a native app, VS Code extension, plugin, or the local data directory that stores sessions and credentials.

If you only want to stop the CLI, uninstall the package or app. If you want a clean account state, sign out and remove the documented credential or data folders after exporting anything you still need.

Copyable commands

Use the same install channel that originally added Kimi Code. Move data aside before deleting anything permanently.

Find the active Kimi command

This tells you which package manager or installer probably owns the executable.

command -v kimi
kimi --version
npm list -g --depth=0 | grep -i kimi
pnpm list -g --depth=0 | grep -i kimi
yarn global list | grep -i kimi

Export the latest session first

Keep a session archive before touching credentials, plugins, or the data root.

mkdir -p "$HOME/kimi-code-backup"
kimi export -y -o "$HOME/kimi-code-backup/latest-session.zip"

Uninstall with the matching package manager

Run only the line that matches how Kimi Code was installed.

npm uninstall -g <package-name>
pnpm remove -g <package-name>
yarn global remove <package-name>

Move the data root aside for a clean reset

This preserves a rollback copy instead of deleting local state immediately.

KIMI_CODE_HOME="${KIMI_CODE_HOME:-$HOME/.kimi-code}"
mkdir -p "$HOME/kimi-code-backup"
test -d "$KIMI_CODE_HOME" && mv "$KIMI_CODE_HOME" "$HOME/kimi-code-backup/kimi-code-home-$(date +%Y%m%d-%H%M%S)"

AI handoff prompt and permissions

Copy this prompt into Kimi Code, K3Nova, or another AI agent. Keep approval manual for file writes, shell commands, account actions, and secrets.

Copyable AI prompt

Use this to give the agent the task and safety boundary in one message.

You are my AI agent for this task: uninstall Kimi Code safely while preserving sessions, config, credentials, and plugin data until I approve removal.
Start by restating the goal and the permissions you need.
Use official docs or the files I provide before making claims.
Give me a direct answer first, then a short table or checklist.
If commands are needed, show exact copyable commands without a shell prompt.
Ask before writing files, running shell commands, deleting or moving data, logging in, spending money, changing account settings, or handling API keys.
Stop and ask me when a step requires secrets, payment, account access, destructive cleanup, or a permission broader than the task.

Recommended AI permissions

PermissionGive AIWhy
InspectionAllow Read, Grep, Glob, and package-list commands.The agent needs to find how Kimi Code was installed.
BackupsAsk before creating or moving backups.Backup location and size should be visible.
Uninstall or moveAsk before npm, pnpm, yarn, mv, rm, rmdir, or credential cleanup.Removal can be hard to undo.
CredentialsDeny reading or printing OAuth files, API keys, and MCP credentials.The agent can describe paths without exposing secrets.

Uninstall decision table

GoalActionAvoid
Remove the commandUninstall with the original package manager or app installerDeleting sessions when the executable is the only problem
Reset configurationRemove config.toml or set a fresh KIMI_CODE_HOMEOverwriting a working config without a backup
Clear login stateUse logout or remove the matching credential fileDeleting unrelated MCP or provider credentials
Remove all local Kimi Code dataDelete the data root only after exportAssuming this can be undone

Safe cleanup order

Check the install method

Run which kimi, kimi --version, and your package manager list command. In VS Code, check installed extensions separately.

Remove the executable

Use the same package manager that installed it, such as npm uninstall -g, pnpm remove -g, yarn global remove, or the native uninstaller.

Sign out before deleting data

Use the Kimi Code logout path when available, then remove only the credential files you intend to clear.

Preserve sessions first

If the sessions contain work you may need later, export or copy the relevant session before clearing the data directory.

What can remain after uninstall

Do not start by deleting everything

A full data-root delete removes config, sessions, credentials, plugin records, logs, and local history. That is fine for a clean reset, but heavy-handed for a normal uninstall.

Plugins are separate state

A plugin removal can leave managed copies or original source files behind. If a plugin caused the problem, remove or disable it before uninstalling the whole CLI.

Credentials need care

Provider OAuth and MCP OAuth files live under the data root. Delete only what you intend to clear, especially on a shared development machine.

FAQ

Will uninstalling Kimi Code delete my sessions?

Not always. Package removal and data removal are separate. Sessions live under the Kimi Code data root.

How do I do a clean reinstall?

Uninstall the executable, move or remove the data root, install again, then sign in and configure providers from scratch.

Can I keep old sessions after uninstalling?

Yes. Export or keep the sessions directory before clearing local data.

Further reading