Skip to content

Claude Code Plugins

Kimi Plugin for Claude Code: A Second Reviewer Inside Your Editor

Kimi adds an independent review lane to Claude Code work without taking over the primary session.

A second model is the lightest-weight reflexivity check you can add.

Info

Created by: Xule Lin

GitHub: linxule/kimi-plugin-cc

Current source version: 1.6.1

Runtime: TypeScript / Node 22.5+ (uses built-in node:sqlite — zero native deps)

Companion philosophy: Independent model, independent perspective. Kimi reasons differently from Claude. A second opinion from a different model catches what self-review misses.


Why a second reviewer matters for research

Solo AI workflows quietly converge on a single voice. Whether you're writing analysis code, drafting a methods section, or building a literature pipeline, Claude eventually starts agreeing with Claude — repeating its own framings, missing its own blind spots. Adding a structurally different model is the lightest-weight reflexivity intervention available.

Kimi Plugin gives you several distinct moves:

  • /kimi:review — Kimi reads your working-tree diff and returns plain Markdown findings with severity, confidence, and file:line references. Use when you've just made a change and want a sanity check before committing.
  • /kimi:challenge — Adversarial pass. Kimi argues against your approach instead of polishing it. Useful for analysis scripts where the failure mode is "looks right, was wrong."
  • /kimi:ask — Free-form Q&A delegated to Kimi. "Explain this regression," "trace this data flow," "what's the literature on X?" Useful when you want a fresh framing from a model trained on different data.
  • /kimi:rescue — Full delegation: Kimi opens files, writes code, runs tests, reports back. Bounded by a plugin-side approval allowlist (no .git/ writes, no opaque package-manager scripts, symlink-aware path containment).
  • /kimi:pursue — Experimental autonomous goal mode. Kimi works across continuation turns under a mandatory wall-clock budget, with the same write allowlist as rescue.
  • /kimi:swarm — Parallel review fan-out. Read-only by default; --write uses a throwaway worktree and returns a reviewable patch rather than touching the user's real tree.

The plugin also installs seven subagents — kimi-rescue, kimi-review, kimi-challenge, kimi-ask, kimi-swarm, kimi-pursue, and kimi-swarm-write — that the main Claude thread can dispatch via the Agent tool when a task matches. The higher-blast-radius surfaces require explicit budgets and keep the same hook-level safety boundaries as the slash commands.


Host support

HostStatusNotes
Claude Code (CLI)FullThe plugin's native target. Install via marketplace or --plugin-dir.
Claude Code (Desktop "Code" tab)FullSame engine as the CLI. Commands and subagents work identically.
Codex CLI / Codex DesktopCompanion pluginInstall from the Codex repo marketplace (codex plugin marketplace add linxule/kimi-plugin-cc && codex plugin add kimi@kimi-marketplace). The Codex skills mirror the Claude commands and call the same local companion runtime; Claude Code remains the native slash-command/subagent host.
Cursor / other MCP clientsOut of scopeSlash commands and subagents are a Claude Code surface. Use kimi-code directly outside Claude Code.

The honest version: Claude Code is still the native surface for slash commands and subagents. Codex support is packaged as a self-contained plugin under plugins/kimi-codex/, with skills that call the same shell companion runtime. As a pattern — "delegate to a structurally different model, allowlist its writes" — it is portable; the How It Works section sketches the subprocess + hook architecture for anyone wanting to recreate it elsewhere.


Stop-time review gate

Beyond explicit commands, the plugin ships one opt-in hook: a Stop-time gate that runs whenever Claude is about to stop and decides whether to invite a Kimi review first.

This addresses a specific failure mode in long sessions — Claude declares "done" while a subtle issue remains. The gate gives a different model the last word on whether the work actually holds up before the session closes. Disable it for fast iteration; enable it for anything you'd be embarrassed to merge.


Commands

CommandWhat it doesKimi can write?Session persists?
/kimi:setupVerify local kimi CLI is reachable and authenticated
/kimi:askFree-form Q&A; --background / --wait supportedNoFresh by default, -r to resume
/kimi:reviewMarkdown code review of your diffNoFresh each time
/kimi:challengeAdversarial review with custom focusNoFresh each time
/kimi:rescueDelegate real work — bug hunts, refactors, fixesYes (allowlisted)Persists, --resume to continue
/kimi:pursueExperimental autonomous goal mode bounded by --budgetYes (allowlisted)Foreground-only
/kimi:swarmParallel review fan-out; --write returns a patch from a throwaway worktreeNo by default; patch-only with --writeForeground-only
/kimi:statusInspect current and recent jobs
/kimi:resultFetch the full result for a job ID
/kimi:replayReplay a job's event log
/kimi:cancelCancel a running job

Every job gets a SQLite record, a stream-json diagnostic log, and the kimi-code session id captured from the session.resume_hint stream record. Swarm and pursue modes add hard budget ceilings so model-launched fan-out cannot run indefinitely.


How it works

The plugin is a thin shell. The work happens in a local Node runtime.

  /kimi:review "check the auth flow"

       └─ companion.sh → node dist/companion.js

               ├─ spawns: kimi -p --output-format stream-json
               ├─ tags the run mode in KIMI_PLUGIN_CC_CMD
               ├─ captures stream-json records and session.resume_hint
               ├─ PreToolUse hook enforces read-only or allowlisted writes
               ├─ persists job + event log to SQLite (node:sqlite)
               └─ returns plain Markdown result to Claude

Subprocess-first transport. v1.x drives kimi-code as one kimi -p subprocess per job and consumes the stream-json output. v1.6.1 is certified against kimi-code 0.20.0 from a source audit; the real-binary smoke was quota-blocked, so the compatibility claim rests on the upstream surface audit rather than an end-to-end smoke for that exact binary. The v0.4 Wire transport for the older Python Kimi CLI remains available at the v0.4 tag, but the current plugin line is a hard cut to kimi-code.

Hook-level safety. kimi-code -p mode auto-approves tool calls, so the plugin's safety boundary is the managed PreToolUse hook installed by /kimi:setup. Setup probes the hook both directly and through /bin/sh -c so GUI-launched PATH issues are caught before a write-capable job runs. Read-only commands deny writes at the hook. Rescue, pursue, and write-swarm apply a workspace allowlist and deny git mutation.

Patch-only write swarm. /kimi:swarm --write runs coordinator and coder subagents inside an ephemeral git worktree based on HEAD, serializes writes by default, and returns a .patch for the human or main agent to review. The plugin does not apply or commit the patch.

Zero native dependencies. Uses Node 22.5's built-in node:sqlite — no better-sqlite3, no node-gyp, no compilation step. dist/ is precompiled and committed; installed plugins work immediately with just node on PATH.

Codex packaging. The Codex plugin lives in a self-contained subfolder with its own manifest, skills, scripts, and mirrored runtime bytes. That separation prevents Claude Code from auto-discovering Codex-only skills at the repo root while still letting Codex install the plugin from the same repository marketplace.


Installation

The native install path.

# Inside a Claude Code session
/plugin marketplace add linxule/kimi-plugin-cc
/plugin install kimi@kimi-marketplace
/kimi:setup

/kimi:setup installs the managed PreToolUse hook, then verifies that the local kimi-code kimi binary is reachable and authenticated. If you don't have kimi-code yet, follow the kimi-code docs first.

From a local clone (for development or unreleased changes):

git clone https://github.com/linxule/kimi-plugin-cc ~/kimi-plugin-cc
claude --plugin-dir ~/kimi-plugin-cc

Prerequisites

  • kimi-code on PATH — the plugin spawns kimi -p; set KIMI_PLUGIN_CC_KIMI_BIN to override the binary location.
  • Node ≥ 22.5 — for built-in node:sqlite. Set KIMI_PLUGIN_CC_NODE_BIN to override.
  • bun is used only for contributor tooling. Not required at runtime.

Research workflow example

A literature-pipeline scenario. You're iterating on a Python script that extracts and deduplicates DOIs from a corpus of PDFs. After a long Claude session you've got working code, but the test coverage feels thin.

/kimi:review "review my last commit, focus on edge cases the tests miss"

Kimi reads the diff and returns Markdown findings with file:line precision — say, three issues, one high-severity (DOI regex misses ArXiv-style IDs). JSON is reserved for the opt-in stop-time review gate, not the ordinary /kimi:review command.

/kimi:rescue "fix the top finding from the last review"

Kimi opens the file, writes the fix, runs the relevant tests (allowlisted invocations only), and reports back. The job persists — if you restart Claude Code, /kimi:rescue --resume picks up where it left off.

If you want adversarial pressure on the approach rather than the code:

/kimi:challenge "is deduplicating by DOI the right primary key here, or am I missing edge cases that argue for a fuzzy match?"

Kimi argues against your design instead of polishing it.

For a broad, read-only audit across many independent files:

/kimi:swarm --budget 20m --max-concurrency 4 "fan out a review across the import pipeline modules"

For a multi-file edit fan-out, add --write; the plugin confines edits to a throwaway worktree and returns a patch for review.


Part of Research Memex

The plugin sits alongside:

  • Vox MCP — multi-model gateway when you want a one-shot consult rather than a full job lifecycle. Use Vox for quick questions, Kimi Plugin for review/delegation.
  • Memex Plugin — captures the context of multi-model collaboration so future sessions know which model said what and why.
  • Interpretive Orchestration — when qualitative analysis needs structured multi-model triangulation, the orchestration plugin uses Vox MCP for diverse perspectives in a single command. Kimi Plugin is the lighter-weight, code-and-text version of the same instinct.