What problem does it solve?
Claude Code sessions often end without an explicit wrap-up — the user closes the terminal, hits Ctrl+C, or times out — and the decisions and context from those sessions are lost. This adapter automatically captures those sessions to Open Brain so no meaningful work disappears.
Core Features & Use Cases
- Automatic Session-End Capture: Registers as a Claude Code Stop hook that reads the session transcript and POSTs it to the Open Brain ingest endpoint without any manual trigger.
- Smart Skip Heuristics: Skips sessions with fewer than 3 user turns, agent-only sessions, restricted content, and non-terminal end reasons like clear or resume.
- Retry Queue with Idempotency: Failed captures are saved locally and retried on subsequent session ends, with an import_key to prevent duplicate thoughts.
- Use Case: A developer finishes a debugging session and closes the terminal without summarizing. The hook fires, formats the transcript, and ingests it into Open Brain as a thought with source_type claude_code_ambient, preserving the decisions made.
Quick Start
Install the base auto-capture skill, copy session-end-capture.mjs to your scripts directory, register it as a Stop hook in your Claude Code settings, and set SUPABASE_URL and MCP_ACCESS_KEY environment variables.