MoonshotAI / MoonshotAI/kimi-code
Feature request: Session lifecycle hook / plugin API
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. Start by reviewing the existing MCP server and skills extension points, then compare the cited lifecycle-hook designs. Done means an agreed extension point can deliver session events, isolate hook failures, and be documented for plugin authors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100