Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/linxule/kimi-plugin-cc/agents-mdgit clone --depth 1 https://github.com/linxule/kimi-plugin-ccWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.11086 | $0.11086 |
| Opus 5 | $0.05543 | $0.05543 |
| Sonnet 5 | $0.02217 | $0.02217 |
| Haiku 4.5 | $0.01109 | $0.01109 |
Grade A, and why
kimi-plugin-cc AGENTS.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
- Rescue defines the direct-workspace write allowlist used by both rescue and pursue. Workspace allowlist (shell-quote parser, mutating-flag detector, symlink reject, path-realpath check) lives in `runtime/rescue-approva How it starts
The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
Project context for coding agents working in this repository.
Quick reference
- Version: 1.9.12 (kimi-code, subprocess transport). Hook-pin durability contract — the current headline, do not regress: the canonical hook command must never embed a version-stamped Node token.
preferStableNodePathprefersprocess.argv0overprocess.execPathONLY when it is absolute ANDrealpath-identical, so it can pick a more stable NAME for the running interpreter, never a DIFFERENT binary; any doubt falls back toexecPath.verifyHookInstalledadditionally runsaccess(nodeBin, X_OK), fail-closed on any errno.nodeBinis derived by parsing the built command back (parseHookShellCommand), NEVER by re-callingresolveNodeBinary— that is non-pure (preferStableNodePathdoes realpath I/O) and could probe a stale realpath while the command pins the symlink. Scope, adversarially established — do not widen it in docs: it proves the exec bit only, not a working Node, and it does NOT catch a dangling interpreter symlink (that resolves to a different node, changes the recomputed command, and byte-exact equality already refuses it as RECOVERABLE drift). The bypass is NARROWED, NOT CLOSED: it covers only "config and expected command still byte-equal, yet the embedded node token fails X_OK at verification time" — a deadKIMI_PLUGIN_CC_NODE_BINoverride, or post-launchchmod -x/removal on the default path. That refusal carriesrefusal_kind:"node-bin-not-executable"+node_bin; it is the one refusal whose remedy is NOT /kimi:setup, and it can never co-occur withdrift(drift requires equality to FAIL, this requires it to PASS). Re-pin-recoverable refusals carrydrift/hookRefusalDetails: agents re-pin through${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh setupand retry ONCE only whenretryable_after_setupAND setup exits 0. That protocol also rides every refusal message (hookRefusalRetryProtocol, single source inhooks/install.ts), so slash-command callers self-heal too — keep the surface files thin, never duplicate it there. Startup-failure wraps threadavailability/cause_code/tail-truncatedcause_messageintodetails, andauth.login_requiredclassifies to*_KIMI_AUTH_UNAVAILABLEwith akimi loginremedy (/kimi:setupdoes not repair auth). In-verifier auto-repin is REJECTED — do not re-propose (lock self-deadlock; the "target cannot be steered" premise is false; no version-monotonicity bound; write→spawn TOCTOU). Analysis:.claude/hook-pin-durability-spec-2026-07-25.md. Background-worker test discipline: detached-worker hook-enforcement tests MUST run the companion CLI as a real node subprocess through a symlink with NOKIMI_PLUGIN_CC_NODE_BINoverride and NOKIMI_PLUGIN_CC_SKIP_HOOK_CHECK(tests/runtime/background-hook-enforcement.test.ts) — an override makes spawner and verifier agree by construction and hides node-bin drift, which is how aspawn(process.execPath)regression once reached pre-release review instead of CI. Smoke-home representativeness: a real-binary smoke case MUST assert its own precondition when the behaviour under test depends on host state. Every isolatedKIMI_CODE_HOMEstarts EMPTY, and kimi-code's cross-session indexer short-circuits on zero sessions — so the first exact-0.30.0 smoke passed GREEN while never executing the path it was believed to cover. A green test whose precondition never held is worse than a red one: it reads as evidence. The exact-0.30.0 release evidence therefore used a populated-home case that failed loudly when nowire.jsonlexisted and recorded the KIMI-home-only side effect; v1.9.4 now refuses experimental-v2 before spawn, so its smoke asserts the refusal instead of launching the unsafe engine. Migration from pre-1.9.0: the canonical command changed, so every install drifts ONCE and needs one /kimi:setup per host (enforcement is not lost meanwhile). Full per-version release + compat history → CHANGELOG.md and ROADMAP-TO-GA.md § Post-GA audit log (the version-by-version compat reasoning also lives inruntime/kimi-version-probe.tscomments). - Upstream compat: verified against
@moonshot-ai/kimi-codefrom 0.2.0 (GA reference) through 0.39.1. Native agent-core-v2 is fail-closed disabled: truthyKIMI_CODE_EXPERIMENTAL_FLAGvalues (1|true|yes|on, trimmed and case-insensitive) still refuse before spawn withCLI_V2_HOOK_ORDER_UNSAFE, and every accepted child spawn overwritesKIMI_CODE_LEGACY_FLAG=1. That explicit per-spawn pin became load-bearing when 0.33.0 inverted unflaggedkimi -pto native v2; older releases ignore the unknown flag. Source audit corrected the older claim that v2 external PreToolUse always precedes plan approval:AgentPlanServiceregisters first and final-allows exact plan-file writes, reachable on a fresh session throughdefault_plan_mode=trueor through restored plan state. Those writes are confined to<KIMI_CODE_HOME>/sessions/.../plans/, not the user worktree, but skipping the managed hook violates the load-bearing every-tool contract. Fresh and resumed plugin runs remain on v1. 0.30.0–0.39.1 also contain the now-unreachable experimental-v2 KAP eager-index caveat; upstream fixes remain MoonshotAI/kimi-code#2376 for indexing and an external-hook-before-final-allow ordering guarantee for re-enabling v2 — and the 0.39.0 audit found that guarantee is not merely missing but explicitly undecided upstream:packages/agent-core-v2/docs/Permission.mdreservesevent.allow()for the plan-file guard "which must bypass the entire permission chain" and lists listener ordering as an open design question, so treat the v2 refusal as gated on a released ordering contract, not on a pending bugfix. 0.39.0's experimental tower mode (KIMI_CODE_EXPERIMENTAL_TOWER, TUI/tower) and subagent fork (KIMI_CODE_EXPERIMENTAL_SUBAGENT_FORK/[experimental] subagent_fork) are both agent-core-v2-only and unreachable on the pinned path (zero v1 flag-registry presence; the v1AgentSwarmschema is.strict()so aforkarg is rejected; both are subsumed by the already-refusedKIMI_CODE_EXPERIMENTAL_FLAG); 0.39.0's experimental Remote Control can patchhooksthrough a tunneled config API, which the per-spawn byte-exact hook verification catches fail-closed (an altered entry refuses as drift, a removed one as not-installed — same /kimi:setup remedy). The authoritative tested set isKIMI_TESTED_MINORSinruntime/kimi-version-probe.ts, whose per-entry comments hold the version-by-version audit detail; the per-release narrative is in ROADMAP-TO-GA.md § Post-GA audit log + CHANGELOG.md, and the audit routine is docs/upstream-compat-audit.md. The current load-bearing contract — what the safety model rests on, re-verified each audit:- Engine provenance (pre-enable slice): docs/native-v2-certification-provenance.md is the approved gate. Every new model job persists its real operation, explicit intended/observed engine, exact command tuple, probed version, certification source, and resume lineage. Historical rows remain unknown unless saved-log evidence proves an engine. Native v2's production capability matrix is empty; a
system.versionmarker under a forced-v1 plan tears down the process tree withCLI_ENGINE_PROVENANCE_MISMATCH. Rescue/pursue/swarm-write receive their trusted root from plugin-ownedKIMI_PLUGIN_CC_WORKSPACE_ROOT, never upstream payloadcwd. - Policy queue order (
packages/agent-core/src/agent/permission/policies/index.ts):PreToolCallHookPermissionPolicyis index 0,AgentSwarmExclusiveDenyPermissionPolicyindex 1,AutoModeApprovePermissionPolicyindex 5 (the first approve). Invariant: every policy between the index-0 hook and the first approve is a DENY, so nothing auto-approves before our hook can deny. (Thegoal-start-review-askaskat index ~10 sits after auto-approve and is dead on the-pauto path — not a gap.) - Hook engine lives in
packages/agent-core/src/session/hooks/(the live v1 path; the oldagent/hooks/tree was removed by a relocation commit, so audit scripts retain both paths only for cross-version coverage). Contract: stdin JSON shape ({tool_name, tool_input, session_id, cwd, …}), exit-2-as-deny, empty matcher = all tools, fail-open on internal error.tool_inputfield names matter — the rescue allowlist reads them:Bashusescommand;Write/Editusepath(tools/builtin/file/{write,edit}.ts,z.object({ path })), NOTfile_path— readingfile_pathhere denied every real Write/Edit until v1.4.1. Re-verify these keys on each audit — a rename silently fails the path allowlist closed. We are not the sole occupant of the PreToolUse channel:rpc/core-impl.ts(create + resume) merges hooks from enabled kimi-code plugins into the-psession hook list ([...config.hooks, ...plugins.enabledHooks()]). Compat-benign because engine aggregation is any-block-wins (session/hooks/engine.ts::blockDecision= firstaction:'block'wins; an allow never pre-empts a block) — a plugin hook can only add denials, never override our managed deny. Our config.toml managed block is unaffected: the configHookDefSchemais.strict(), so the per-hookcwd/envfields are programmatic/plugin-only (no config-injection vector). Load-bearing invariant to re-verify each audit:blockDecisionstays find-first-block. -pmode: through 0.32.x upstream defaulted to the v1 driver; 0.33.0+ defaults to native v2 unlessKIMI_CODE_LEGACY_FLAGis truthy. The plugin therefore owns engine selection:cli-client.ts::buildEnvoverwrites that child-only flag to1for every accepted fresh/resumed spawn, while upstream-truthyKIMI_CODE_EXPERIMENTAL_FLAGvalues still refuse before spawn. Do not silently strip the experimental flag: the explicit refusal tells the operator which unsafe selector was rejected. The pinned v1 driver hard-codespermission: 'auto'+installHeadlessHandlers; stdout is stream-json viaPromptJsonWriter, carrying assistant/tool records, therole:"meta", type:"session.resume_hint"session id, and the role-lessgoal.summary. V2 external hooks are awaited on ordinary calls and preserve the hook payload/exit-2 contract, but production listener order is permission gate → plan → swarm → external hooks; plan-fileevent.allow()is final and skips later hooks. Re-enable v2 only after an exact released tag guarantees external-hook veto before any final allow and both freshdefault_plan_mode=trueplus restored-plan smoke cases pass. The parser still models v2's extrarole:"meta", type:"system.version"line for historical logs/future compatibility; exact 0.39.1 release smoke asserts it is absent. argv we consume (options.ts/commands.ts):-p/-r/--output-format/-m/--skills-dir;--auto/--yolo/--planare rejected with-p. Otherkimisubcommands (vis,server/web,doctor, …) are off the-ppath — the plugin passes the prompt as the VALUE of-p, never a bare positional.- Plugin slash commands are RPC/host-initiated, not model tools, and absent from the
kimi -pCLI path; activation only macro-expands prompt text, whose later tool calls still pass through the index-0 hook. Re-verify each audit that this stays host/UI-only and never becomes a model-reachable permission bypass. - 0.31 custom-agent trust boundary: default-v1 print mode now discovers user/project/plugin agent profiles and plugin system-prompt contributions. Project roots include
<git-root>/.kimi-code/agentsand<git-root>/.agents/agents;override: truecan replace builtinagentorcoderinstructions/tool availability, and the bound profile is snapshotted with the session. These inputs can redirect intended work, so inspect them before rescue/pursue/swarm-write in an untrusted repository. Agent-profile fields and system-prompt text cannot themselves set hooks, permission mode, or cwd, widen the plugin allowlist, or escape swarm-write's trusted worktree root. Enabled plugins may separately contribute hooks; any-block-wins aggregation means those hooks can add denials but cannot override this plugin's managed block. - Daily upstream monitor reports: a Codex automation checks upstream daily and saves a dated signal under
.claude/kimi-code-research/daily-monitor/(gitignored by the repo-wide.claude/rule). Before starting an upstream audit or release catch-up, readdaily-monitor/LATEST.mdplus the most recent dated reports. Carry forward unresolved blockers/follow-ups, and explicitly correct any prior judgement that today's evidence contradicts. These monitor reports are for continuity only; they do not certify a version or justify extendingKIMI_TESTED_MINORSwithout the normal source audit + real-binary smoke gate. - Goal mode (
kimi -p "/goal …") triggers on the/^\/goal(\s|$)/prompt prefix ALONE (the oldgoal-commandexperimental-flag gate is gone). Read-only commands hard-prefix an English instruction line so their trimmed prompt never starts with/goal, and the index-0 hook denies writes regardless./kimi:pursueopts into goal mode per-job and is hook-gated on every continuation turn. - AgentSwarm subagents (
SessionSubagentHost.spawn()viaSubagentBatch) use the STANDARD permission stack — hook at index 0, NOdeny-all(thedeny-allunshift isstartBtw()-only, the side-question path, NOT the swarm path). So under theswarmlabel every subagent's write/edit/shell fires our hook at index 0 and is denied — read-only swarm opens zero write surface. - Background auto-upgrade is default-on and drifts the operator's binary out-of-band; it does not swap the binary for the plugin's own
-pspawns. Setup warns on an out-of-range version, and every model command separately probes the exact command tuple and refuses an untested minor before spawn. Recovery is a plugin release that certifies the minor or an explicitly selected certified binary;KIMI_PLUGIN_CC_SKIP_VERSION_PROBEis tests/smoke only, never a production repair path. - Print-mode background defaults: upstream steers completed background work by default and allows task waits without a timeout ceiling. The plugin does not rely on those upstream limits: pursue/swarm keep mandatory finite AbortController budgets, swarm keeps hard concurrency caps, and cancellation remains an identity-safe settlement barrier before the caller or worktree cleanup resumes.
- Engine provenance (pre-enable slice): docs/native-v2-certification-provenance.md is the approved gate. Every new model job persists its real operation, explicit intended/observed engine, exact command tuple, probed version, certification source, and resume lineage. Historical rows remain unknown unless saved-log evidence proves an engine. Native v2's production capability matrix is empty; a
- Toolchain: Node >= 22.5, TypeScript, bun (not npm/yarn)
- Workflow: edit
runtime/**/*.ts→bun run check(build + typecheck + test + drift gate) - Installed-state verification: For questions about what a host is actually running, resolve that host's active version-stamped install cache and run its bundled
scripts/companion.sh setup --check. The checkout, package metadata, and another host's cache are not proof of active runtime state. - Credential-bearing config: Treat
~/.kimi-code/config.tomlas credential-bearing (it can hold a BYO-providerapiKey) and~/.kimi-code/credentials/(e.g.kimi-code.json, mode 0600) as the real OAuth-token store — the managed login token has lived undercredentials/since the earliest kimi-code (source-verified), never in config.toml, so it is NOT a per-version migration. For routine status checks, do not read, print, copy, or retain the raw config or anything undercredentials/; use the sanitized setup check. If an explicitly authorized diagnosis requires direct inspection of config.toml, restrict it to the plugin-managed hook block and redact all credential material from output; thecredentials/store is never read or copied.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 118 lines · 11,086 tokens per session scan A 37bc5ae2d123
kimi-plugin-cc AGENTS.md is an instructions file published in the GitHub repository linxule/kimi-plugin-cc (37 stars, last pushed 4d ago), licensed Apache-2.0. It adds 11,086 tokens to every session, about $0.0554 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
happier AGENTS.md
AGENTS.md instructions for happier-dev/happier, covering agent constitution, what happier is, tier 0 — the ten invariants, instruction routing and scope, autonomy, and completion.
codex-router CLAUDE.md
Claude Code instructions for duolahypercho/codex-router: Open and read AGENTS.md in full before installing, configuring, or extending this repository. It is the canonical instruction file for both Codex and Claude-based agents, including the procedures for adding local curated models, shipping repository-wide model…
happier CLAUDE.md
Claude Code instructions for happier-dev/happier, covering claude code and typescript commands.
pi-dispatch CLAUDE.md
Instructions for edgehero/pi-dispatch, covering working on pi-dispatch, what this project is, the shape, read these before changing behaviour and rules that bite.
AIUsageTracker AGENTS.md
Instructions for rygel/AIUsageTracker, covering ai usage tracker - monitor guidelines, critical rules, never wipe user settings (critical), never cause data loss in migrations (critical) and never create releases without explicit permission.
AIUsageTracker CLAUDE.md
Instructions for rygel/AIUsageTracker, covering claude.md, build & test, analyzer rules — do not weaken, architecture and data flow: monitor → main window.