Skip to content

Lifecycle Hooks ​

TokenPilot implements host-specific lifecycle hooks through its adapters. The actual hooks available depend on the host:

HostHooks Used
OpenClawnative plugin slot: layered context engine, tool-call hooks, and tool-result persistence (no external hook registration)
Codex CLISessionStart, PreToolUse, PostToolUse (registered in hooks.json)
Claude CodeSessionStart (auto-starts gateway)
pibefore_agent_start (stable prefix), context (reduction), turn_end (opt-in eviction)
OpenCodeexperimental.chat.system.transform (stable prefix), experimental.chat.messages.transform (reduction and opt-in eviction)
DeepSeek HarnessCordis plugin lifecycle; status is reported through /tokenpilot-status

These are host-specific hook names used by TokenPilot adapters, not a universal lifecycle specification. No formal lifecycle hook specification exists for the platform.

The shared runtime logic lives in components/packages/foundation/runtime-core/, while the hook wiring lives in components/adapters/<host>/src/.

Released under the MIT License.