auto-capture-claude-code

Captures Claude Code session transcripts to Open Brain via a Stop hook.

4.5k|872|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/NateBJones-Projects/OB1 --skill auto-capture-claude-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auto-capture-claude-code
Source: https://github.com/NateBJones-Projects/OB1/tree/main/skills/auto-capture-claude-code
Command: npx skills add https://github.com/NateBJones-Projects/OB1 --skill auto-capture-claude-code

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about auto-capture-claude-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically capture Claude Code sessions to Open Brain?

Register session-end-capture.mjs as a Stop hook in your Claude Code settings.json, then set SUPABASE_URL and MCP_ACCESS_KEY environment variables. The hook reads the transcript at session end and POSTs it to the Open Brain ingest endpoint.

What is the difference between the auto-capture skill and this Claude Code adapter?

The base auto-capture skill handles interactive captures when you explicitly say wrap up. This adapter handles ambient capture when sessions end without a verbal trigger, such as terminal close or Ctrl+C. They are complementary and both should be installed.

Does the session-end hook work without the base auto-capture skill?

The adapter is designed to extend the base auto-capture skill and lists it as a required dependency. The base skill covers interactive captures while the adapter covers ambient session-end capture, so install both for full coverage.

Why are some Claude Code sessions not captured?

Sessions are skipped when they have fewer than 3 user turns, are agent-only, contain restricted content, or end with clear or resume reasons. Check logs/ambient-capture.log for the disposition of each session.

What happens when the capture POST request fails?

Failed captures are saved to data/capture-retry-queue/ and retried on subsequent session ends, up to 5 attempts. An import_key deduplicates retries against belated successes, and permanent 4xx failures are moved to a dead directory.