harvest-sessions

Sweep recent Claude Code and Codex session transcripts into a reviewed secondbrain pull request.

Updated Aug 6, 2026
One-click install
npx skills add https://github.com/wkentaro/skills --skill harvest-sessions-wkentaro
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: harvest-sessions
Source: https://github.com/wkentaro/skills/tree/main/skills/in-progress/harvest-sessions
Command: npx skills add https://github.com/wkentaro/skills --skill harvest-sessions-wkentaro

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Valuable insights from AI coding sessions—root causes, decisions, measured numbers, workarounds—are lost when sessions end. This Skill runs an unattended sweep over recent Claude Code and Codex transcripts, judges what is durable and unrecoverable, and files survivors into a secondbrain knowledge base via a pull request the user can veto. ## Core Features & Use Cases - Session Digesting: Parses Claude Code and Codex JSONL transcripts, stripping tool traffic and reasoning to leave only human turns and agent prose, with automatic redaction of common secret shapes. - Watermark-Based Idempotency: Tracks a state file so each run only processes sessions newer than the last tick; an empty pass is a success and simply advances the watermark. - Reviewed Capture Workflow: Applies a durable-and-unrecoverable test to each session, edits existing secondbrain pages where possible, and opens a harvest/YYYY-MM-DD pull request listing every capture and rejection for audit. - Use Case: A developer runs dozens of AI sessions per week. A scheduled tick sweeps yesterday's transcripts, finds one hard-won root cause, adds it to the existing secondbrain page, and opens a PR for review—nothing is committed to main without approval. ## Quick Start Use $harvest-sessions to sweep recent Claude Code and Codex sessions into the second brain.

Frequently Asked Questions about harvest-sessions

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

FAQPage Schema
How do I capture knowledge from Claude Code sessions automatically?▼

Run the harvest-sessions sweep, which digests recent Claude Code and Codex JSONL transcripts into human turns and agent prose. It judges each session against a durable-and-unrecoverable test and files survivors into a secondbrain repository through a pull request.

How does the session digest script filter transcripts?▼

The digest_sessions.py script reads JSONL transcripts from ~/.claude/projects and ~/.codex session directories, keeping only user and assistant text turns. It drops reasoning, tool calls, and tool output, redacts known secret patterns, and skips sessions with fewer than two user turns.

What are the requirements to run session harvesting?▼

You need local Claude Code or Codex transcripts, Python 3, Git, GitHub CLI access, and a checkout of wkentaro/secondbrain. The skill reads CLAUDE.md conventions from the target repository and never commits directly to main.

What happens when a harvest run finds nothing to capture?▼

An empty pass is treated as success. The run reports zero sessions captured, advances the watermark from the tick snapshot, and creates no branch, commit, issue, or pull request.

What happens if the pull request fails to open?▼

The watermark is left unstamped so the next run re-judges the same window rather than losing it. The report records the failure and the existing harvest branch or commit for recovery, without retrying indefinitely.

Does the harvest process modify source repositories?▼

No. The sweep only touches the wkentaro/secondbrain checkout. It never edits, commits to, or opens issues against any source repository that a transcript merely described, and it cites transcript paths instead of copying raw session content.