Track E.1 — Claude Code session ingestion watcher #27
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of mathias/infra Track E umbrella. Captures the missing data source the volume gate exposed.
Goal
Scan
~/.claude/projects/*/<uuid>.jsonlon each host, parse turns, scrub secrets, classify, ingest into brain. Per-host instance: koala, flamingo, iguana.Scope
New package
ingestion/internal/claudewatcher/:claudewatcher.Watch(ctx, cfg)polls Claude Code projects dir on configurable interval (default 60s). New or modified.jsonlfiles trigger parse.claude_session_cursors).BEGIN PRIVATE KEY). Fail-closed: if any rule matches, drop the turn + log a warning (don't try to redact + ingest).brain_classifytool. Filter: ingest only entries wheretype∈ {decision,lesson,correction,surprise}. Skip routinecode/note/unknownto keep brain signal high.brain_ingest_rawwith structured pages:{title, content, frontmatter: {wing: 'claude-sessions', hall: hall-by-type, session_id, project_root, host}}.cmd/server/main.gostarts the watcher whenCLAUDE_SESSIONS_DIRenv var is set. Defaults to$HOME/.claude/projects.CLAUDE_INGEST_INTERVALcontrols poll (default 60s).Per-host deployment
/root/.claude/projects(or wherever the act_runner / Claude Code session writes) as read-only into pod, setCLAUDE_SESSIONS_DIRto that mount.claudewatcheras a launchd job that POSTs to brain HTTP API.Flamingo + iguana wiring is out of scope for this issue — land koala first as proof-of-life, file follow-ups for the other two hosts.
Acceptance
brain/wiki/claude-sessions/<hall>/*.mdwithin 60s of a Claude session producing them on koalawc -l brain/sessions/*.jsonl+ classified-entries count) is ≥500/week within one monthtask checkgreen; trunk-based commit chain to mainBranch policy
If Track E.2 is being worked on simultaneously, use branch
agent/track-e1-claudewatcherper CLAUDE.md TBD parallel-agent rule. Merge to main when complete + task check green.Related