Back to list
sxhmilyoyo

session-recap

by sxhmilyoyo

🧠 Claude Code plugin marketplace featuring Second Brain - an agentic workflow system with persistent memory and tribal knowledge. Transform Claude from goldfish to elephant with cross-session learning.

1🍴 0📅 Jan 22, 2026

SKILL.md


name: session-recap description: Document Claude Code sessions by extracting knowledge into cross-referenced documentation. Triggers on "recap the session", "summarize the work", or after significant code changes. user-invocable: true

Session Recap

Systematically document Claude Code sessions into the knowledge bank.

Knowledge Bank Location: Read from ~/.claude/plugins/config/second-brain/config.json. Configure via skills/common/setup_kb_path.sh --configure.

Philosophy: Knowledge Bank = BRAIN, not ARCHIVE. Preserve workflows, edge cases, decisions—not verbose traces. Target 95% size reduction, 100% actionable knowledge.


Invocation

Important: Session recap should run in a new session after the work session ends. This ensures the full transcript is captured.

  1. During your work session: Note down the session path displayed at startup

    • Claude Code shows: Session: /path/to/.claude/projects/.../session-id.jsonl
    • Save this path for later
  2. Exit the work session: The final transcript is automatically saved

  3. Start a new session: Begin fresh to run the recap

    claude
    
  4. Invoke session-recap with the path:

    Recap the session at /path/to/session-id.jsonl
    

    Or:

    /second-brain:session-recap /path/to/session-id.jsonl
    

Why a New Session?

Running session-recap in the same session would miss the final conversation context. The transcript must be fully saved before knowledge extraction can begin.

Manual Invocation

  • Slash command: /second-brain:session-recap
  • Skill tool: Skill({ skill: "second-brain:session-recap" })

Visibility Settings

SettingValueEffect
user-invocabletrueVisible in slash menu, Skill tool allowed

Quick Reference

InputOutput
Session folder pathDaily log + extracted docs
Current conversationDaily log + extracted docs
Document TypeCross-Refs Required
Technical docs10-15 (MUST)
Reflections5-8 (MUST)

RFC 2119 Keywords

This skill uses RFC 2119 keywords:

  • MUST: Absolute requirement, cannot be skipped
  • SHOULD: Valid exceptions may exist but require conscious weighing
  • MAY: Truly optional

Workflow

Phase 1: ANALYZE

Goal: Load session data and extract facts.

1.1 Load Session Data

If session folder provided:

# Find latest segment
LATEST_SEGMENT=$(ls -d "$SESSION_FOLDER"/segment-* 2>/dev/null | grep -v 'segment-final' | sort -t- -k2 -n | tail -1)
[ -z "$LATEST_SEGMENT" ] && [ -d "$SESSION_FOLDER/segment-final" ] && LATEST_SEGMENT="$SESSION_FOLDER/segment-final"

# Read transcript
TRANSCRIPT="$LATEST_SEGMENT/transcript.jsonl"

If no folder: Analyze current conversation context.

1.2 Detect Project

./scripts/parse_transcript.sh "$TRANSCRIPT" project
Path PatternProjectKB Location
/.claude/ccprojects/cc/

1.3 Extract Session Facts

./scripts/parse_transcript.sh "$TRANSCRIPT" all

Extracts: user requests, files read, files modified, commands, errors, subagents, insights.


Phase 2: PLAN

Goal: Determine what to document and whether reflection is required.

2.1 Reflection Decision Gate (MUST complete)

Answer these questions:

QuestionAnswer
1. Did this session involve debugging or problem-solving?YES / NO
2. Did this session discover a workflow pattern?YES / NO
3. Did this session encounter tool/process friction?YES / NO

Decision:

  • If ANY answer is YES → MUST create at least 1 reflection
  • If ALL answers are NO → MAY skip reflections

Record decision for Phase 4 verification.

2.2 Search Cross-References (MUST complete before Phase 3)

./scripts/search_cross_references.sh "keyword"

Target 10-15 cross-references distributed across:

  • Concepts (3-5)
  • Components (3-5)
  • Best Practices (1-2)
  • Recent Sessions (1-2)
  • MOCs (1-2)

See cross-reference-guide.md for methodology.

2.3 External Document Distillation (MUST complete when investigation docs exist)

If external investigation documents exist (100+ KB):

  1. MUST detect documents for distillation:
./scripts/detect_external_docs.sh "$SESSION_FOLDER"
  1. MUST analyze distillation requirements:
./scripts/analyze_for_distillation.sh "$DOC_PATH"

See distillation-guide.md for detailed methodology.

2.4 Insight Classification (SHOULD complete when insights exist)

If insights were extracted in Phase 1.3, classify each:

Insight ContentClassificationAction
Reveals architectural patternConceptSHOULD create concept doc
Describes component behaviorComponentSHOULD update/create component doc
Documents methodologyBest PracticeSHOULD create best practice doc
Reveals workflow patternReflectionSHOULD create reflection
Identifies anti-patternReflectionSHOULD create reflection
General educational contextDaily LogMUST include in daily log

Record classifications for Phase 3.


Phase 3: CREATE

Goal: Write documentation in priority order.

Priority Order

  1. Concept docs - MUST if patterns discovered OR insight reveals architecture
  2. Component docs - MUST if components modified OR insight describes behavior
  3. Best practice docs - SHOULD if methodology identified OR insight documents technique
  4. Process reflections - MUST if Phase 2.1 decision = required OR insight reveals workflow/anti-pattern
  5. Daily session log - MUST (always required, includes all insights)

Document Locations

TypeLocationTemplate
Concept{KB}/projects/{project}/concepts/concept-template.md
Component{KB}/projects/{project}/components/component-template.md
Best Practice{KB}/projects/{project}/best-practices/best-practice-template.md
Reflection{KB}/reflections/{category}/process-reflection-template.md
Daily Log{KB}/daily-log/YYYY-MM-DD [Topic].mddaily-log-template.md

Reflection Categories

CategoryFolderTrigger
Architecture Patternsarchitecture-patterns/Threading, state, design patterns
Development Workflowdevelopment-workflow/Utility discovery, test-first, deps
Anti-Patternsanti-patterns/Wrong approaches, confusion
DX Improvementsdx-improvements/Search gaps, missing docs, tools

Note: These are example categories. The system discovers reflection categories dynamically from subdirectories in {KB}/reflections/. Create any category folders that fit your workflow.

Cross-Reference Requirements

Every document MUST include:

  • Technical docs: 10-15 WikiLinks (minimum 10)
  • Reflections: 5-8 WikiLinks (minimum 5)

Verify with:

./scripts/count_wikilinks.sh document.md

YAML Frontmatter (MUST include)

---
title: Document Title
aliases: [Alt 1, Alt 2]
tags: [category, topic]
type: concept|component|best-practice|daily-log|reflection
created: YYYY-MM-DD
modified: YYYY-MM-DD
project: Claude Code
---

Obsidian Syntax (MUST invoke when obsidian skills installed)

When obsidian skills are available, MUST invoke before creating knowledge bank documents:

/obsidian:obsidian-markdown

This ensures proper Obsidian Flavored Markdown syntax for:

  • WikiLinks: [[Note]], [[Note#Heading]], [[Note|Display]]
  • Callouts: > [!note], > [!warning], > [!tip], etc.
  • Properties (YAML frontmatter)
  • Tags: #tag, #nested/tag
  • Embeds: ![[Note]], ![[image.png]]
  • Block references: [[Note#^block-id]]

Verification: Check if obsidian skills exist in available skills list before creating documents.


Phase 4: VERIFY

Goal: Confirm all requirements met before declaring complete.

4.1 Run Verification Script (MUST complete)

./scripts/verify_session_recap.sh \
  --kb-path "$KB_PATH" \
  --project "$PROJECT" \
  --daily-log "YYYY-MM-DD [Topic].md" \
  --reflection-required  # or --no-reflection based on Phase 2.1

4.2 Validate Obsidian Syntax (MUST complete)

./scripts/validate_obsidian_syntax.sh "$DAILY_LOG_PATH"
./scripts/validate_obsidian_syntax.sh "$REFLECTION_PATH"  # if reflection created

MUST validate:

  • Frontmatter required fields (title, tags, type, created)
  • Callout syntax ([!note], [!warning], etc.)
  • WikiLink format and heading anchors

4.3 Verification Checklist

Documentation (MUST verify):

  • Daily session log created
  • Cross-references ≥ 10 in daily log
  • YAML frontmatter present

Reflection Gate (MUST verify):

  • Phase 2.1 decision recorded
  • If decision = required → reflection exists
  • Reflection has ≥ 5 cross-references

Quality (MUST verify):

  • No broken WikiLinks
  • Code references include file paths and line numbers

Syntax Validation (MUST verify):

  • validate_obsidian_syntax.sh exits with code 0 for daily log
  • validate_obsidian_syntax.sh exits with code 0 for reflections (if created)

Index Maintenance (MUST verify):

  • Obsidian Base indices regenerated for project
  • MOC Canvas updated (if MOC modified)

4.4 MOC Updates (conditional)

If new categories or significant content: Add links to relevant MOC.


Phase 5: MAINTAIN

Goal: Update knowledge bank indices and visualizations.

5.1 Regenerate Obsidian Base Indices (MUST complete when new docs created)

MUST regenerate indices when new documents added to knowledge bank:

./scripts/generate_knowledge_base.sh --project "$PROJECT"

Generates queryable indices for concepts, components, practices, and sessions.

5.2 Update MOC Canvas (MUST complete when MOC modified)

MUST update canvas when MOC files modified:

./scripts/generate_moc_canvas.sh "$MOC_PATH"

Creates visual JSON Canvas representation of knowledge relationships.


Decision Reference

When Reflection is REQUIRED

Session CharacteristicReflection Required
Debugging occurredMUST
Problem-solving with investigationMUST
New pattern discoveredMUST
Workflow friction encounteredSHOULD
Simple file edits onlyMAY skip
Documentation-only changesMAY skip

When to Create Each Document Type

Document TypeCreate When
ConceptNew pattern/principle discovered
ComponentNew class/interface/behavior documented
Best PracticeReusable methodology identified
ReflectionSee decision gate above
Daily LogAlways (every session)

Scripts Reference

ScriptPurposePhase
parse_transcript.shExtract data from session transcript1.2, 1.3
detect_project.shAuto-detect project from path1.2 (internal)
search_cross_references.shFind cross-reference targets2.2
detect_external_docs.shScan for investigation documents2.3
analyze_for_distillation.shAnalyze docs for distillation2.3
count_wikilinks.shCount WikiLinks in document3
verify_session_recap.shFinal verification gate4.1
validate_obsidian_syntax.shValidate Obsidian markdown syntax4.2
validate_cross_references.shCheck for broken WikiLinks4.3
verify_quality.shVerify document quality4.3
generate_knowledge_base.shGenerate Obsidian Base indices5.1
generate_moc_canvas.shCreate MOC visualization canvas5.2

Common Mistakes

Mistake 1: Skipping Reflections

Symptom: Only technical docs created, no reflections. Cause: Treating "OPTIONAL" as "skip if unsure". Fix: Complete Phase 2.1 decision gate explicitly.

Mistake 2: Insufficient Cross-References

Symptom: Document has < 10 WikiLinks. Cause: Skipping cross-reference discovery. Fix: Run search_cross_references.sh before writing.

Mistake 3: Premature Completion

Symptom: Declaring done without verification. Cause: Not running Phase 4 checklist. Fix: MUST run verify_session_recap.sh before declaring complete.

See common-mistakes.md for full list.


Completion Criteria

Session recap is complete when:

  1. verify_session_recap.sh exits with code 0
  2. ✅ Daily log created with ≥ 10 cross-references
  3. ✅ Reflection created (if Phase 2.1 decision = required)
  4. ✅ All documents have YAML frontmatter
  5. ✅ No broken WikiLinks
  6. ✅ Obsidian syntax validation passes
  7. ✅ Knowledge bank indices updated (if new docs created)

Only then declare: "✅ Session Recap Complete"


Resources

Score

Total Score

75/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon