Kanbus

Git-backed project management for people and AI agents.

Lifecycle Hooks

Lifecycle hooks are a first-class Kanbus integration surface for running project-defined logic on command lifecycle boundaries.

Not coding-agent compaction hooks. Kanbus CLI lifecycle hooks fire on kbs command boundaries. Coding-agent compaction reinjection (Claude Code SessionStart compact, Cursor preCompact, and so on) is documented separately in Agent Compaction and Right-Now Elicitation.

The hook engine is implemented with behavior parity in Python and Rust CLIs.

Core model

Event catalog (v1)

Mutating operations:

Read operations:

Runtime semantics

Global disable controls:

Configuration (.kanbus.yml)

hooks:
  enabled: true
  run_in_beads_mode: true
  default_timeout_ms: 5000
  before:
    issue.update:
      - id: validate-update
        command: ["./hooks/validate-update.sh"]
        timeout_ms: 1200
  after:
    issue.create:
      - id: notify-created
        command: ["./hooks/notify-created.sh"]
        env:
          WEBHOOK_URL: "https://example.invalid/hooks"

Hook entry fields:

Validation checks:

Invocation payload contract

All hooks receive a stable envelope:

{
  "schema_version": "kanbus.hooks.v1",
  "phase": "after",
  "event": "issue.create",
  "timestamp": "2026-03-08T16:31:44.021Z",
  "actor": "dev@example.com",
  "mode": {
    "beads_mode": false,
    "project_root": "/repo",
    "working_directory": "/repo",
    "runtime": "python|rust"
  },
  "operation": {}
}

operation includes event-specific context (identifiers, filters, before/after issue snapshots when available).

Policy guidance alignment

Policy guidance now runs through the lifecycle hook engine as a built-in provider.

CLI operations

# inspect lifecycle hooks
kbs hooks list

# validate configuration and executable paths
kbs hooks validate

# disable all hooks for one command
kbs --no-hooks list

# disable all hooks for a shell session
KANBUS_NO_HOOKS=1 kbs list