Repository navigation
v0.12.4
Kimi Code desktop sessions can now bind their work to the session.
Kimi Code's desktop app runs every session inside one main process, so a session's hook process and the MCP server share that main pid as their only common ancestor: pid lineage matched every candidate at the same rank and id inheritance refused. Hook contexts now carry cwd_digest — a truncated SHA-256 of the session's cwd, never the raw path (project_label stays the basename) — and the MCP server matches on its own working directory, which IS its session's project directory.
- The desktop app also hands hooks its OWN working directory, so the payload
cwdis/for every session (measured: 64 of 64 PreToolUse payloads across five concurrent sessions); the hook now reads the session's real project directory from Kimi Code's own~/.kimi-code/session_index.jsonl(sessionId->workDir) and keeps the payload cwd only as the fallback when that index has no row. - The don't-guess rules hold: the digest decides only when every fresh candidate carries one and exactly one matches, a digest-less candidate turns the rule off (lineage or refusal decides instead), and two sessions opened on the same directory refuse id inheritance outright rather than falling back to newest-or-lineage.
- Claude Code and Codex contexts carry the digest too, since their hook payloads carry
cwdas well.
Live hook firing has been observed on the maintainer machine (2026-09-24: 64 PreToolUse payloads across five sessions), but no live MCP report has yet inherited a session id — the running server predates this fix — so mechanical_capture stays experimental until that smoke exists.