| name | capture |
| description | Review session work and propose knowledge captures for human review. Scans git commits, changed files, and patterns used across repos to generate structured knowledge items. Includes review workflow to approve/reject/edit pending captures before persisting to the knowledge base. |
| allowed-tools | Bash, Read, Write, Edit, Glob, Grep |
Knowledge Capture Skill
Reviews work done in the current session and proposes knowledge items for human review before persisting to the knowledge base.
Usage
/capture
/capture week
/capture 2026-01-15
/capture review
/capture review all
/capture review --batch
/capture status
/capture status --week
/capture status --tiers
/capture archive <file>
/capture icebox "idea"
/capture icebox list
/capture decay
/capture promote
/capture search <query>
/capture search "stx" --tier warm
/capture suggest
Subcommands
/capture (default) - Generate Captures
Scans git activity and generates new captures to ~/logs/captures/pending/.
/capture review - Process Pending
Interactive workflow to review pending captures:
- List pending - Show all captures awaiting review
- Present each - Display content, metadata, confidence
- Ask action - Approve, reject, or edit
- Process - Persist approved, archive rejected
Options:
review - Process one capture at a time
review all - Batch process all pending captures
review --batch - Quick batch mode for efficient processing
Batch Review Mode
Use review --batch for quick bulk processing:
> /capture review --batch
Processing 5 pending captures in batch mode...
1. [nugget] Clarity: stacks-block-height deprecation
Confidence: high | Repos: aibtcdev/agent-contracts
Quick action? [A]pprove / [R]eject / [S]kip (default: approve high)
2. [pattern] Error handling middleware
Confidence: medium | Repos: whoabuddy/moltbook
Quick action? [A]pprove / [R]eject / [S]kip
...
Batch complete!
- Approved: 3
- Rejected: 1
- Skipped: 1
Batch mode defaults:
- Auto-approve high confidence captures (press Enter)
- Ask for medium/low confidence
- Skip items you're unsure about for later review
/capture status - Show Counts
Display summary of capture activity:
Pending: 3 captures awaiting review
Approved: 12 captures persisted this month
Rejected: 2 captures archived
Options:
status - Quick summary counts
status --week - Detailed stats with category breakdown and weekly trend
status --month - 30-day detailed view
status --tiers - Include tier breakdown (warm/cold/icebox)
Uses capture-stats.ts helper for statistics.
/capture archive - Move to Cold Storage
Manually archive knowledge items that are outdated or rarely needed:
/capture archive nuggets/old-api.md
/capture archive patterns/deprecated-*.md
/capture archive nuggets/clarity.md --reason "superseded by new version"
Archived files:
- Move to
archive/{category}/ preserving structure
- Add archive metadata (date, reason, original path)
- Remain searchable but don't pollute active knowledge
- Can be promoted back if accessed frequently
/capture icebox - Park Ideas
Park ideas that aren't ready for the knowledge base:
/capture icebox "Consider using Deno for scripts"
/capture icebox list
/capture icebox get 3
/capture icebox delete 3
/capture icebox promote 3
Icebox is for:
- Unvalidated ideas
- Future possibilities
- Low-priority improvements
- Speculative patterns
Unlike archive (validated knowledge that decayed), icebox holds ideas that never reached warm tier.
/capture decay - Check Stale Items
Find warm-tier items that haven't been accessed in 90+ days:
/capture decay
/capture decay --dry-run
/capture decay --execute
/capture decay --days 60
Uses decay-check.ts helper. Decay is not automatic - run periodically or with /capture status.
/capture promote - Check Cold Items
Find archived items that should return to warm tier:
/capture promote
/capture promote --execute
Items are promoted when accessed 3+ times while in cold storage.
/capture search - Search Knowledge
Search across all knowledge tiers with tier-aware ranking:
/capture search "clarity errors"
/capture search "stx" --tier warm
/capture search "api" --category patterns
/capture search "token" --limit 5
Search features:
- Tier-aware ranking: Warm items ranked higher than cold/icebox
- Recency boost: Recently accessed items rank higher
- Frequency boost: Frequently accessed items rank higher
- Fuzzy matching: Partial keyword matches included
Results show:
- Title and path
- Tier indicator ([archived] for cold, [icebox] for parked)
- Match score and matched keywords
- Content snippet
Uses knowledge-search.ts helper. Automatically records access for cold items (for promotion tracking).
/capture suggest - Context-Aware Suggestions
Analyze current working directory and surface relevant knowledge:
/capture suggest
/capture suggest ~/dev/org/repo
Detects:
- Project types: Clarity, TypeScript, Hono, Cloudflare Workers, Python
- Recent git activity: Keywords from last 7 days of commits
- Key files: Clarinet.toml, package.json, wrangler.toml, etc.
Outputs:
- Highly relevant items (strong type/keyword match)
- May be useful items (partial matches)
- Archived items that might need warm loading
Uses context-suggest.ts helper. Run at session start to orient with relevant knowledge.
What It Does
- Scans git activity - Commits across repos in
~/dev/ for the date range
- Identifies patterns - New techniques, debugging approaches, common scenarios
- Generates captures - Structured markdown files with category and confidence
- Writes to pending - Saves to
~/logs/captures/pending/ for review
Output Format
Each capture is a markdown file in ~/logs/captures/pending/:
2026-02-01-clarity-try-unwrap.md
File structure:
---
category: nugget | pattern | runbook | decision
confidence: high | medium | low
source: session | git-diff | pattern-match
repos: [repo1, repo2]
date: 2026-02-01
---
`try!` unwraps a response and propagates the error to the caller.
Prefer over `unwrap!` when you want the caller to handle errors.
(define-public (transfer (amount uint))
(try! (stx-transfer? amount tx-sender recipient))
(ok true))
Observed in aibtcdev/aibtc-contracts during session review.
Commit: abc123 "fix: propagate transfer errors properly"
Review Workflow
Approve
When approved, the capture is:
- Moved to
~/logs/captures/approved/
- Persisted to the knowledge base at
~/dev/whoabuddy/claude-knowledge/
Destination by category:
| Category | Destination | Action |
|---|
nugget | nuggets/{topic}.md | Append to existing or create new |
pattern | patterns/{name}.md | Create new file |
runbook | runbook/{task}.md | Create new file |
decision | decisions/{nnnn}-{name}.md | Create with next ADR number |
Reject
When rejected, the capture is:
- Moved to
~/logs/captures/rejected/
- Reason added to frontmatter
Rejection reasons:
- Duplicate of existing knowledge
- Too specific (not reusable)
- Needs more validation
- Not accurate
- Custom reason
Edit
When editing:
- Display current content
- Ask what to change (content, category, confidence)
- Apply edits
- Then approve or reject
Categories
| Category | Description | Destination |
|---|
nugget | Quick fact or gotcha | nuggets/{topic}.md |
pattern | Recurring solution | patterns/{name}.md |
runbook | Procedural workflow | runbook/{task}.md |
decision | Architecture choice | decisions/{nnnn}-{name}.md |
Confidence Levels
- high: Clear, verified, immediately useful
- medium: Probably useful, might need refinement
- low: Tentative, needs validation
Session Review Logic
The skill analyzes:
Git Commits
for repo in ~/dev/*/*/.git; do
git -C "$(dirname $repo)" log --oneline --since="midnight" --author="$(git config user.email)"
done
Changed Files
- Look for new techniques or patterns in diffs
- Note files that were heavily edited (debugging, refactoring)
Pattern Recognition
- Debugging sessions (multiple commits to same file)
- New feature work (new files added)
- Refactoring (renames, restructuring)
- Integration work (config file changes)
Integration
- After work sessions: Run
/capture to review the day
- With /daily: Optionally call capture at end of daily summary
- Morning review:
/capture review to process pending items
- With /daily-brief: Surfaces pending capture count
Workflow
See runbook/knowledge-capture.md in the knowledge base for full workflow documentation.
Files
| Location | Purpose |
|---|
~/logs/captures/pending/ | Captures awaiting review |
~/logs/captures/approved/ | Reviewed and persisted |
~/logs/captures/rejected/ | Rejected with reason |
~/dev/whoabuddy/claude-knowledge/ | Knowledge base destination |
Knowledge Tiers
| Tier | Description | Location | Loaded |
|---|
| Hot | Always loaded | ~/.claude/CLAUDE.md Quick Facts | Every session |
| Warm | On-demand | nuggets/, patterns/, runbook/ | When relevant |
| Cold | Archived | archive/ | Rarely, manual |
| Icebox | Parked ideas | icebox/ | Never auto-loaded |
Tier Transitions
- Warm -> Cold (Decay): Items not accessed in 90 days move to archive
- Cold -> Warm (Promotion): Items accessed 3+ times while archived return to warm
- Warm -> Icebox: Manual; for ideas not ready for knowledge base
- Icebox -> Warm: Manual promotion when idea is validated
Tips
- Run at end of work session when context is fresh
- Higher confidence for explicit learnings (debugging gotchas)
- Lower confidence for inferred patterns (might be one-off)
- Captures are proposals - human reviews before persistence
- Don't capture sensitive info (credentials, internal URLs)
- Review pending captures in morning (with daily-brief) or before EOD
Example Session
Generating Captures
> /capture
Reviewing session work for 2026-02-01...
Found 12 commits across 3 repos:
- aibtcdev/aibtc-contracts: 5 commits (Clarity patterns)
- whoabuddy/moltbook: 4 commits (TypeScript, Hono)
- stacks-network/docs: 3 commits (documentation)
Generated 3 captures:
1. [nugget] Clarity: stacks-block-height vs block-height
Confidence: high
Source: aibtcdev/aibtc-contracts commit "fix: use current block height"
2. [pattern] Hono middleware error handling
Confidence: medium
Source: moltbook pattern observed across 3 files
3. [runbook] Deploying Clarity contracts to testnet
Confidence: low
Source: Inferred from commit sequence
Captures written to ~/logs/captures/pending/
Use /capture review to approve/reject.
Reviewing Captures
> /capture review
Pending captures: 3
---
## Capture 1/3: Clarity: stacks-block-height vs block-height
Category: nugget
Confidence: high
Source: aibtcdev/aibtc-contracts
Content:
Use `stacks-block-height` instead of `block-height` for current block.
`block-height` is legacy and deprecated.
---
Action? [a]pprove / [r]eject / [e]dit / [s]kip
> a
Approved! Persisted to nuggets/clarity.md
---
## Capture 2/3: Hono middleware error handling
...
Helper Scripts
The skill uses TypeScript helpers for stats and candidate generation:
capture-stats.ts
Compute capture statistics for status reporting:
bun ~/.claude/skills/capture/capture-stats.ts
bun ~/.claude/skills/capture/capture-stats.ts --week
bun ~/.claude/skills/capture/capture-stats.ts --month
bun ~/.claude/skills/capture/capture-stats.ts --tiers
bun ~/.claude/skills/capture/capture-stats.ts --json
Output includes:
- Pending/approved/rejected counts
- Approval rate percentage
- Category breakdown (nugget, pattern, runbook, decision)
- Weekly trend (last 4 weeks)
- Recently approved captures
- Pending items for review
- Tier counts (with --tiers): warm, cold, icebox
- Decay/promotion candidates
access-tracker.ts
Track when knowledge items are accessed:
bun ~/.claude/skills/capture/access-tracker.ts record <path>
bun ~/.claude/skills/capture/access-tracker.ts query <path>
bun ~/.claude/skills/capture/access-tracker.ts list
bun ~/.claude/skills/capture/access-tracker.ts list --stale
bun ~/.claude/skills/capture/access-tracker.ts list --cold-active
Access log stored at ~/dev/whoabuddy/claude-knowledge/.access-log.json.
decay-check.ts
Check for and execute tier transitions:
bun ~/.claude/skills/capture/decay-check.ts
bun ~/.claude/skills/capture/decay-check.ts --dry-run
bun ~/.claude/skills/capture/decay-check.ts --execute
bun ~/.claude/skills/capture/decay-check.ts --days 60
bun ~/.claude/skills/capture/decay-check.ts --promote
bun ~/.claude/skills/capture/decay-check.ts --promote --execute
capture-candidates.ts
Auto-generate capture candidates from git activity:
bun ~/.claude/skills/capture/capture-candidates.ts
bun ~/.claude/skills/capture/capture-candidates.ts 2026-02-01
bun ~/.claude/skills/capture/capture-candidates.ts --week
bun ~/.claude/skills/capture/capture-candidates.ts --json
Pattern matching:
- Fix commits -> high confidence nuggets
- Same file edited 3+ times -> debugging session nuggets
- Clarity contract changes -> domain-specific nuggets
- Config file changes -> runbook candidates
- New utils/patterns files -> pattern candidates
knowledge-search.ts
Full-text search across all knowledge tiers:
bun ~/.claude/skills/capture/knowledge-search.ts "clarity"
bun ~/.claude/skills/capture/knowledge-search.ts "stx" --tier warm
bun ~/.claude/skills/capture/knowledge-search.ts "api" --category patterns
bun ~/.claude/skills/capture/knowledge-search.ts --rebuild-index
bun ~/.claude/skills/capture/knowledge-search.ts --json
Search index stored at ~/dev/whoabuddy/claude-knowledge/.search-index.json.
Index auto-rebuilds if older than 1 hour.
context-suggest.ts
Context-aware knowledge suggestions based on working directory:
bun ~/.claude/skills/capture/context-suggest.ts
bun ~/.claude/skills/capture/context-suggest.ts ~/dev/org/repo
bun ~/.claude/skills/capture/context-suggest.ts --json
Detects project types and surfaces relevant knowledge from all tiers.
Daily Workflow Integration
Morning (with /daily-brief)
The daily-brief skill surfaces:
- Pending capture count
- Recently approved captures (last 7 days)
- Prompt to run
/capture review if pending > 0
Evening (with /daily)
After generating daily summary, optionally run capture:
/daily && /capture
/daily --capture
Weekly Review
Use stats to track capture health:
/capture status --week
Target metrics:
- Keep pending queue < 10
- Approval rate > 70% (captures are relevant)
- Review daily to prevent staleness