kimi-code icon indicating copy to clipboard operation
kimi-code copied to clipboard

Feature request: Session lifecycle hook / plugin API

Open grandmaster451 opened this issue 5 months ago • 0 comments

Summary

Request for a session lifecycle hook or plugin API in Kimi Code CLI.

Motivation

Other agent CLIs (Claude Code, Codex CLI, OpenCode) provide lifecycle hooks that allow external tools to integrate seamlessly:

  • Session start/end events
  • Tool usage capture (Read, Edit, Bash, etc.)
  • Context compaction triggers

This enables use cases like:

  • Persistent memory across sessions
  • Automatic session summaries and notes
  • Usage analytics and cost tracking
  • Team knowledge sharing

Currently, Kimi CLI supports MCP servers and skills, but there is no mechanism for automatic capture of session events without manual MCP tool calls.

Request

A minimal hook or plugin mechanism that exposes session lifecycle events to external processes. The exact API design (env vars, JSON config, or plugin SDK) is left to the maintainers.

Prior art

  • Claude Code: hooks.json (SessionStart, PostToolUse, PreCompact, SessionEnd)
  • Codex CLI: Plugin SDK with typed event handlers
  • OpenCode: experimental hooks for session/message/tool events

Suggested acceptance criteria

  • [ ] External tool can receive session lifecycle events
  • [ ] Hook failures are non-blocking (do not break the main session)
  • [ ] Documented extension point for plugin authors

grandmaster451 avatar Jun 04 '26 23:06 grandmaster451