Skip to content

[skills] Add auto-capture-codex adapter#389

Open
eazene wants to merge 1 commit into
NateBJones-Projects:mainfrom
eazene:contrib/ezanaazene/add-auto-capture-codex
Open

[skills] Add auto-capture-codex adapter#389
eazene wants to merge 1 commit into
NateBJones-Projects:mainfrom
eazene:contrib/ezanaazene/add-auto-capture-codex

Conversation

@eazene

@eazene eazene commented Jul 5, 2026

Copy link
Copy Markdown

Contribution Type

  • Skill (/skills)

What does this do?

Adds auto-capture-codex — the Codex CLI sibling of auto-capture-claude-code. It automatically captures Codex sessions to Open Brain at session end.

Why a separate adapter: Codex stores transcripts as "rollout" JSONL (event_msg records with payload.type == "user_message"/"agent_message") — a different schema from Claude Code. The Claude Code adapter parses zero turns from a Codex rollout and silently captures nothing, so Codex needs its own parser.

Design notes:

  • Codex has no SessionEnd event, so the hook runs on Stop and uses a debounced, per-session state-guarded capture to fire once (~120s after the last turn), approximating session end.
  • Resolves the rollout transcript by session_id (Codex embeds it in the rollout filename), with stdin-path and newest-rollout-for-cwd fallbacks.
  • Caps the payload at 24k chars to stay under the ingest embedding model's ~8191-token limit (oversized payloads otherwise fail HTTP 500).

Requirements

Codex CLI, Node.js 18+, a deployed Open Brain (open-brain-rest /ingest + MCP_ACCESS_KEY). Depends on the auto-capture skill (declared in metadata). No new dependencies.

Checklist

  • I've read CONTRIBUTING.md
  • README.md with prerequisites, step-by-step install, and expected outcome
  • metadata.json has all required fields
  • Depends on auto-capture; declared in metadata and linked in the README
  • Tested on my own Open Brain instance (real rollout parses to N turns; oversized session truncated to <24k and captured HTTP 200; debounced deferred path verified)
  • No credentials, API keys, or secrets are included

🤖 Generated with Claude Code

New Codex CLI adapter for the auto-capture skill — the Codex sibling of
auto-capture-claude-code. Captures Codex sessions to Open Brain automatically
at session end.

Codex stores transcripts as "rollout" JSONL (event_msg records with
payload.type user_message/agent_message), a different schema from Claude Code,
so it needs its own parser — the Claude Code adapter parses zero turns from a
Codex rollout and captures nothing.

Codex has no SessionEnd event, so the hook runs on Stop and uses a debounced,
per-session-state-guarded capture to fire once (~120s after the last turn),
approximating session end. Resolves the rollout by session_id (embedded in the
filename), with stdin-path and newest-rollout-for-cwd fallbacks. Caps the
payload at 24k chars to stay under the ingest embedding token limit.

Includes SKILL.md, README.md, metadata.json, and the hook script (Node 18+,
no dependencies).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MvLAf6xzHoGeGE9h3PWemh
@github-actions github-actions Bot added the skill Contribution: reusable AI client skill or prompt pack label Jul 5, 2026
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

OB1 PR Gate

Folder structure — All files are in allowed directories
Required files — README.md and metadata.json found in all contribution folders
Metadata valid — All metadata.json files passed JSON Schema validation
No credentials — No API keys, tokens, or secrets detected
SQL safety — No destructive SQL or core table modifications
Category artifacts — Required file types present for each category
PR format — Title follows [category] Description format
No binary blobs — No oversized or binary files
README completeness — All READMEs include Prerequisites, Steps, and Expected Outcome
Contribution dependencies — All declared skill and primitive dependencies exist and are linked in README
LLM clarity review — Covered by Claude PR Review workflow
Remote MCP pattern — No local MCP server patterns detected — uses remote MCP correctly
Tool audit link — Extensions/integrations link to the MCP Tool Audit guide
Scope check — All changes are within the contribution folder(s)
Internal links — All relative links in READMEs resolve to existing files

Result: All 15 checks passed! Ready for human review.


Post-Merge Tasks

These don't block merge — they're reminders for admins after this PR lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skill Contribution: reusable AI client skill or prompt pack

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant