[Workflow] Automated Claude Code Session Wiki: A Karpathy-style Knowledge Base with Slash Commands and Schema-Driven Compilation

Selected Workflow

Automated Claude Code Session Wiki: A Karpathy-style Knowledge Base with Slash Commands and Schema-Driven Compilation

Workflow value: 90/100
Status: active · Freshness: 70/100 · Confidence: 0.95 · Level: advanced
Categories: Quality Control, Token Saving, Context & Memory, Debugging, CLAUDE.md
Original source: r/ClaudeCode post/comment

What problem this solves

Retaining and organizing knowledge from Claude Code sessions to prevent loss of insights, debug past issues, and build a searchable, self-updating knowledge base. Addresses the challenge of maintaining coherence and accuracy in a large, LLM-generated knowledge base.

Summary

An automated system that compiles Claude Code session transcripts into a tagged, cross-linked Obsidian wiki. It uses a defined architecture (raw/, knowledge/, AGENTS.md schema) and a lifecycle managed by four slash commands (kb_sync, kb_health, kb_qa, kb_commit). Key insights include the importance of a robust schema, index-guided retrieval over vector search for this scale, and the necessity of maintenance (linting) to prevent knowledge base degradation.

Why it is useful

This workflow provides a detailed, validated, and repeatable method for transforming ephemeral Claude Code session transcripts into a persistent, organized, and searchable knowledge base. It addresses the critical problem of knowledge retention and reuse from LLM interactions. The post offers concrete architectural patterns, a lifecycle managed by specific slash commands, and crucial insights derived from 30 days of operation, such as the importance of schema design, effective retrieval methods at scale, and the necessity of maintenance. The offer to share underlying artifacts (schema, prompts) further enhances its value and transferability for users looking to implement similar systems.

Workflow

  1. Define a schema file (e.g., AGENTS.md) for article structure, tag taxonomy, and compilation rules.
  2. Set up an immutable source zone (raw/) for session transcripts, project docs, and plans, mirrored via rsync.
  3. Establish a compiler-owned knowledge zone (knowledge/) for concept articles, connection articles, and a master index.
  4. Implement kb_sync command: mirror sources, ingest, and compile transcripts into the wiki.
  5. Implement kb_health command: lint for broken wikilinks, orphans, stale articles, and near-duplicates.
  6. Implement kb_qa command: use an LLM to read the master index and select relevant articles to answer queries.
  7. Implement kb_commit command: stage, auto-message, and push changes to version control.
  8. Prioritize session transcripts as high-value input for knowledge capture.
  9. Focus on robust schema design for wiki coherence, rather than just folder structure.
  10. Utilize index-guided retrieval for knowledge base querying at scales of 50-500 articles, as it can be more accurate and simpler to debug than vector search.
  11. Regularly run maintenance/linting commands to prevent wiki degradation and ensure accuracy.

Tools / artifacts

  • Claude Code (for session transcripts)
  • Obsidian (wiki platform)
  • rsync (for mirroring files)
  • AGENTS.md (schema file)
  • raw/ directory (immutable source zone)
  • knowledge/ directory (compiler-owned zone)
  • kb_sync (slash command)
  • kb_health (slash command)
  • kb_qa (slash command)
  • kb_commit (slash command)
  • LLM (for compilation and QA)
  • Master index (for retrieval)

Validation signals

  • 30 days of Claude Code sessions
  • 553 articles (509 concepts, 43 connection articles, 1 long-form Q&A)
  • All articles written by the compiler, none by the user.
  • The wiki now answers questions the user's past self already solved.
  • Health pass caught duplicate pairs and 100+ broken wikilinks after the first heavy week, demonstrating effectiveness of maintenance.
  • Index-guided retrieval found to be more accurate and simpler to debug than RAG at 50-500 articles.

Limitations

  • The actual code for the compiler, the AGENTS.md schema, and the specific prompts are not provided in the post, only offered, requiring users to request them or reverse-engineer.
  • The complexity of setting up such a system might be high for beginners.
  • The post doesn't detail the specific LLM calls or internal logic of the compiler.

Rate this workflow

Upvote this post if the workflow is useful, reproducible, or worth recommending.

Downvote if it is vague, outdated, unsafe, overhyped, or not reproducible.

Reply if it worked for you, failed, is outdated, or has a better alternative.


This post was generated automatically from the workflow library database.

Posted Jun 11, 2026, 2:31 AM UTC

10
Loading comments…