Skip to main content

Runtime overview

Asymptote supports Kimi Code, Moonshot AI’s coding agent, through Kimi Code’s native lifecycle hooks sent to beacon-hooks.
--harness kimi-code and --harness kimi-code-cli are aliases for the same integration. The CLI, desktop app, VS Code extension, and ACP server all use the same agent core and normalize to the kimi_code harness.
Kimi Code has no OpenTelemetry export. KIMI_DISABLE_TELEMETRY controls Moonshot’s own product telemetry, not Asymptote collection. Native hooks are the entire integration surface.

Prerequisites

  • Install kimi. It does not need to have been run before hook installation; Asymptote creates config.toml if it is missing.
  • Run beacon endpoint install so endpoint configuration and runtime log paths exist.
  • Start a new Kimi Code session, or run /reload, after installing or removing hooks. Kimi Code reads config.toml at startup.

Collection path

Asymptote appends managed entries to the [[hooks]] array in $KIMI_CODE_HOME/config.toml. KIMI_CODE_HOME defaults to ~/.kimi-code.
config.toml can contain provider API keys in plain text. Asymptote appends its hook entries without re-serializing the rest of the file, then parses and compares the result before replacing the original. Existing settings, secrets, comments, and non-Asymptote hooks are preserved byte for byte.
Asymptote refuses to modify:
  • a config.toml that does not parse;
  • a config that declares hooks as an inline array (hooks = [{ ... }]), because TOML does not permit appending [[hooks]] entries after it.
beacon endpoint discover reports the inline-array case as misconfigured. Status and uninstall find Asymptote’s entries by the hook command, not by the comment above them, because Kimi Code’s legacy kimi-cli migration re-serializes config.toml and drops every comment. Each entry has an integer timeout in seconds (10 to 45; Kimi Code refuses the whole file outside 1–600) and no matcher, which is Kimi Code’s match-all form.
Kimi Code has no project-scoped hook configuration. --level project is refused instead of silently changing the user-wide config. To isolate telemetry for one project, set KIMI_CODE_HOME to a project-specific data root first.

Registered events

Asymptote subscribes to these Kimi Code hooks: Beacon deliberately does not register SessionHeartbeat, UserPromptQueued, TurnStarted, TaskStarted, Notification, StopFailure, or Interrupt. Those events would duplicate another event, create a heartbeat process merely by subscribing, or assert a lifecycle state the endpoint schema cannot express accurately.

Discovery and status

Show Kimi Code hook status
Kimi Code reports as kimi_code with capability hooks, and emitted events use harness.collection_method=hook. Inventory reports config.toml as native configuration and marks it beacon_managed only when an Asymptote hook command is present.

Install or configuration support

Reinstall replaces Asymptote’s entries rather than adding duplicates. Uninstall removes only Asymptote entries and leaves the rest of the file unchanged, including on a config Kimi Code has since re-serialized.

Telemetry coverage

Kimi’s Read, ReadMediaFile, Glob, and Grep tools map to file reads. Write and Edit map to file modifications, while Bash maps to command execution. A Write with mode = "append" is recorded as a modification, not a create, so its diff does not claim the fragment is the whole file. Failed writes remain tool.failed and do not generate a file diff for a change that never landed. A failed call’s output arrives in error.message rather than tool_output, and Asymptote records it. Bash reports a non-zero exit only by appending Command failed with exit code: N. to its output; Asymptote reads the last such line as command.exit_code. A missing marker is not read as exit 0, because it also describes a background command whose result is only a task id.

Approvals and enforcement

Kimi Code exposes real operator decisions. approved maps to approval.allowed; rejected, cancelled, and error map to approval.denied, with approval.decision preserving the exact outcome. Arguments from the decided call are retained, so command and file approval rules can evaluate the actual operation. These events are observed, not inferred. The approval scope (session when every future call like this one was approved) and the feedback typed when refusing are kept under raw.kimi. PreToolUse is not also recorded as an approval, because it fires before Kimi Code’s permission check. Optional enforcement remains behind BEACON_POLICY_PROVIDER and fails open on provider errors. A provider deny is exit code 2 with the reason on stderr. Kimi only honors blocking responses for PreToolUse, Stop, and UserPromptSubmit; a response to PermissionRequest is observation-only, so the seam returns no denial in that phase and writes no denial telemetry for a call that was not denied.

Data handling

Prompts, tool arguments, commands, command output, paths, and diffs are retained with local redaction and size limits, as for other runtimes. The verbatim payload is kept under raw.kimi, which is where non-MCP tool arguments, session_title, client_type, and similar fields survive; raw is the first thing dropped at the 64 KiB event limit.
Asymptote writes nothing to a Kimi Code hook’s stdout. On UserPromptSubmit, Kimi Code appends a hook’s stdout to the model’s context, so even an empty {} would be shown to the model once per prompt.

Known gaps

  • No token usage or cost. Kimi’s compaction token count is not per-call usage, so Kimi Code activity does not appear in beacon token-usage reports or the dashboard token view.
  • No assistant response text in hook payloads.
  • No interruption event in the endpoint schema.
  • No project-level hook configuration.
  • Hooks are fail-open if a command times out, crashes, or exits unexpectedly.

Troubleshooting

If events are missing, check KIMI_CODE_HOME, confirm the hook commands contain --platform kimi, run beacon endpoint discover (it reports misconfigured for invalid TOML or an inline hooks array), start a new session or run /reload, and inspect $KIMI_CODE_HOME/logs/ for hook startup errors.

Supported agent harnesses

Return to the runtime support overview.

Agent harness integration model

See how Asymptote discovers and configures each runtime.