You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: Session lifecycle hook / plugin API #447
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)
changed the title [-]Feature request: Plugin/Hook API for session lifecycle events[/-][+]Feature request: Session lifecycle hook / plugin API[/+]on Jun 4, 2026
Activity
[-]Feature request: Plugin/Hook API for session lifecycle events[/-][+]Feature request: Session lifecycle hook / plugin API[/+]