Skip to content

Feature request: Session lifecycle hook / plugin API #447

Open

Description

@grandmaster451

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

Activity

  1. changed the title [-]Feature request: Plugin/Hook API for session lifecycle events[/-] [+]Feature request: Session lifecycle hook / plugin API[/+] on Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions