Skip to content

Kilo Code Integration

Séance integrates with Kilo Code through a TypeScript plugin that auto-installs to ~/.config/kilo/plugins/. Kilo is a fork of OpenCode, so the integration is nearly identical.

How It Works

  1. Plugin auto-installs on Séance startup (if ~/.config/kilo exists)
  2. Plugin hooks into Kilo's event system, forwarding lifecycle events to Séance
  3. Wrapper script intercepts kilo launches, tracks PID, and fires session-end on exit

Events Handled

Kilo EventSéance HookWhat It Shows
session.createdsession-startRunning
session.status (busy)prompt-submitRunning
tool.execute.beforepre-tool-useRunning
tool.execute.afterpost-tool-useRunning
permission.askednotificationNeeds input
session.idlestopIdle
session.errorsession-end(cleared)
session.updatedsession-startRunning

Features

  • Per-surface status — each terminal pane tracks its own agent status independently
  • Permission detection — shows "Waiting for permission" when Kilo asks to run a command
  • Desktop notifications — notifies on completion and permission requests
  • Session directory tracking — Kilo exposes session directory via SEANCE_KILO_SESSION_DIR environment variable

Configuration

Toggle integration on or off in config.toml:

toml
kilo-hooks = true

Limitations

  • No subagent tracking — Kilo doesn't emit subagent lifecycle events (unlike MiMo Code)
  • Session directory — Kilo exposes a session directory via environment variable, which is unused by Séance

For Contributors

Integration Approach

Kilo Code uses a TypeScript plugin (plugins/seance-kilo/index.ts) auto-installed to ~/.config/kilo/plugins/. Kilo is a fork of OpenCode, so the integration is virtually identical — the plugin is a copy of the OpenCode plugin with command substitutions (kilo-hook instead of opencode-hook).

A wrapper script (resources/bin/kilo) intercepts launches for PID tracking and session-end on exit.

Version: @seance-version 13 (same as OpenCode)

Event Mapping

Identical to OpenCode:

Kilo EventSeance HookUI Status
session.createdsession-startRunning
session.status (busy)prompt-submitRunning
session.idlestopIdle
session.errorsession-end(cleared)
session.updatedsession-startRunning
tool.execute.beforepre-tool-useRunning
tool.execute.afterpost-tool-useRunning
permission.askednotificationNeeds input
permission.replied(no-op)

Key Implementation Details

  • Status mode: Per-surface. Status key prefix kilo, mode surface.
  • clear_status_on_end is true.
  • has_notification_hook is true.
  • Auto-install target: ~/.config/kilo/plugins/seance-kilo.ts
  • Disabled check: SEANCE_KILO_HOOKS_DISABLED=1.
  • Subagent detection: Same heuristic as OpenCode — detects children via sessionID mismatch on session events. Uses completedSessions to avoid re-tracking. Has trackChildSession() / untrackChildSession() helper functions.

Upstream Framework Events

Source: kilo.ai/docs/automate/extending/plugins

Kilo Code shares OpenCode's event system (Kilo is a fork of OpenCode), plus adds TUI-specific events:

EventDescriptionSéance Handles?
session.createdNew session createdYes
session.updatedSession state changedYes
session.idleSession became idleYes
session.errorSession error occurredYes
session.statusSession status changed (busy/idle)Yes
session.deletedSession was deletedNo
session.compactedSession context was compactedNo
session.diffSession diff availableNo
message.updatedMessage content updatedNo
message.removedMessage removedNo
message.part.updatedMessage part updatedNo
message.part.removedMessage part removedNo
tool.execute.beforeBefore tool executionYes
tool.execute.afterAfter tool executionYes
permission.askedPermission requestYes
permission.repliedPermission responseYes
file.editedFile was editedNo
file.watcher.updatedFile changed on diskNo
lsp.updatedLSP connection state changedNo
lsp.client.diagnosticsLSP diagnostics receivedNo
command.executedSlash command executedNo
shell.envShell environment injectionNo
todo.updatedTodo list changedNo
server.connectedServer connection establishedNo
installation.updatedInstallation state changedNo
tui.prompt.appendAppend to promptNo
tui.command.executeTUI command executedNo
tui.toast.showShow toast notificationNo

Missing Event Coverage

Events that Kilo Code can emit but Séance does not currently handle:

EventPotential Use for Séance
session.deletedClear status when session is explicitly deleted
session.compactedShow compaction indicator in status
message.updatedTrack conversation progress
file.editedShow file modification activity
lsp.client.diagnosticsShow error/warning counts in status
todo.updatedTrack task completion progress

Impact: Séance currently only tracks session lifecycle and tool execution. It misses file changes, LSP diagnostics, and task progress that could provide richer status information.

MIT Licensed