| name | sync-claude-sessions |
| description | B.U.I.L.D. Inflow pipeline |
sync-claude-sessions
Turns your own terminal history — the richest training data you own — into
knowledge the self-improving loop can act on. One redacted digest per session.
What it does
Walks ~/.claude/projects/**/*.jsonl (808+ files, ~442 MB) and for each session
extracts: the opening intent, follow-up user corrections/decisions, the
tools used (histogram), the conclusions (last assistant output), and any
shipped PRs (pr-link events). Every text field is redacted before it
touches disk. Output is an OKF-formatted session-digest per session in
~/2nd Brain/2nd Brain/process/sessions/.
This is the content pass. It does NOT duplicate the FABLE distiller
(~/Fabel Prompt Engineer/scripts/fable-distill.mjs), which mines the same lake
for working-rhythm metrics. Run both; they are orthogonal.
How to run
cd ~/Pi-Dev-Ops
python3 scripts/sync_claude_sessions.py --dry-run --limit 5
python3 scripts/sync_claude_sessions.py --since-last
python3 scripts/sync_claude_sessions.py
Flags: --dry-run (writes to /private/tmp/.../scratch-session-digests, never
updates the marker), --since-last (skip files unchanged since last run, via
process/.sync-claude-sessions.json), --limit N, .