Native lifecycle capture
The observation lands before the session ends.
Captain Memo now speaks the lifecycle language of supported Codex, Gemini CLI and Kimi releases. Prompts retrieve context, useful tool results become observations, and turn-end events flush the queue—while automatic fallback protects every older session.
The AI session
The CLI emits its own prompt, tool-result and turn-end lifecycle events.
Captain Memo hooks
Recall before work. Capture evidence after tools. Flush safely at the end.
One local corpus
The same observation pipeline, search, provenance and privacy boundary as before.
Three lifecycle beats
Recall. Observe. Finish cleanly.
Each hook has one narrow job. The AI CLI stays in control of its session; Captain Memo only supplies memory and records reusable evidence.
Before the work
The prompt event retrieves relevant local memory, so a fresh session begins with decisions and lessons the other AIs already learned. Kimi is the exception for now: see the compatibility map.
After useful tools
File edits, patches and command outcomes enter the observation queue with their originating CLI and session attached.
At turn end
The stop event asks the worker to flush pending evidence. It does not block the AI or move the corpus into a vendor cloud.
The compatibility map
Use the richest reliable signal.
Not every product exposes the same event payload. Captain Memo chooses the capture layer that preserves useful evidence instead of forcing every runtime into one shape. On Windows this needs 0.43.4 or later and one captain-memo connect after upgrading: it rewrites the Codex and Gemini hooks in a form PowerShell runs, and the summarizers are found on PATH and fed over stdin, so the observations actually get written. Upgrading from an earlier release? Run captain-memo connect again to install the newer hooks.
Capability-probed prompt, PostToolUse and Stop hooks for capture, plus SessionStart (the session's working rules) and PreToolUse (the work-board guard). Codex asks the user to review the installed hooks once.
Capability-probed BeforeAgent, AfterTool and AfterAgent hooks for capture, plus SessionStart (the session's working rules) and BeforeTool (the work-board guard), including the required vendor settings when supported. Gemini CLI 0.61 writes its sessions as .jsonl files; Captain Memo reads them from 0.47.0, as well as the older .json files.
Native prompt, PostToolUse and Stop hooks from the vendor version that introduced the lifecycle contract. As of Kimi 1.52.0 a prompt hook's output does not reach the model, so memory is not yet injected into its prompts (capture is unaffected; Kimi reads memory through the MCP tools). If an older Captain Memo wrote your Kimi config, re-run captain-memo connect kimi after upgrading to 0.44.8 or later: Kimi 1.48 refused the provider block that earlier versions wrote.
The current native tool event omits the input and result, so the richer persisted conversation remains the better source.
Ollama supplies the model and tool calling. Captain Memo observes the host agent—such as Kimi or opencode—that owns the loop.
The safety rule
Configuration is not proof.
A hook file can exist while a CLI is too old, a feature is disabled, approval is pending or delivery has failed. Captain Memo therefore decides at session granularity.
Fallback remains active
The transcript, rollout or conversation reader keeps watching. Installing hooks never turns it off by itself. The Codex, Gemini and Kimi readers read a growing session from where the last read ended, not from the top (a rewritten file still gets a full read).
That session is native
Only after the worker accepts a native tool event does the matching fallback reader skip that exact session, preventing duplicates without creating gaps.
Proof in stats
Count delivery, not configuration.
The native counter records sessions that actually delivered an accepted tool event. A configured hook that never fires does not inflate it.
capture: { native: { codex: 1, gemini: 0, kimi: 0 } } # native.codex = 1 means a Codex tool event reached the worker
What stays true
A faster path into the same memory.
Native hooks are an input path, not a second memory product.
The corpus stays local
Observations still land in Captain Memo's local SQLite corpus and use the configured local or remote embedder exactly as before.
Foreign hooks stay intact
Connect merges Captain Memo's managed entries into supported CLI configuration without replacing unrelated user hooks.
Provenance stays visible
Every native observation carries its originating AI and session into the shared search and statistics surface.
Old versions keep working
Capability and version gates degrade to existing readers automatically. Native capture is an upgrade, never a migration cliff.