explaingit

djolex999/vir

12TypeScriptAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

A command-line tool that reads your Claude Code session transcripts and distills reusable patterns, decisions, and gotchas into a searchable Obsidian knowledge vault so past sessions teach future sessions.

Mindmap

mindmap
  root((vir))
    What it does
      Read session transcripts
      Classify with Haiku
      Extract with Sonnet
      Write Obsidian notes
    Note Types
      Patterns
      Decisions
      Gotchas
      Tools
    Setup
      Init wizard
      Run command
      Schedule daemon
      MCP server
    Tech Stack
      TypeScript
      SQLite
      Node.js
      Ollama optional
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Process all past Claude Code session transcripts into a structured Obsidian vault of patterns and decisions you can search later

USE CASE 2

Set up a background daemon that runs every three hours and adds new Claude Code session insights to your vault automatically

USE CASE 3

Expose your accumulated knowledge to future Claude Code sessions via an MCP server so the AI can query it during work

USE CASE 4

Cut enrichment API costs by routing vir through Kie.ai instead of Anthropic directly while keeping the same underlying models

Tech stack

TypeScriptNode.jsSQLiteHaikuSonnetOllama

Getting it running

Difficulty · moderate Time to first run · 30min

Requires an Anthropic or Kie.ai API key, first run costs $1 to $5 depending on how many past Claude Code sessions you have.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice (MIT).

In plain English

Vir is a command-line tool for developers who use Claude Code, Anthropic's AI coding assistant. Every Claude Code session produces transcripts stored as JSONL files on your computer, and those transcripts often contain useful patterns, decisions, and lessons. Vir reads those transcripts, filters them for meaningful content, and distills what it finds into structured notes inside an Obsidian knowledge vault. The goal is a feedback loop: past sessions teach future sessions. The tool uses two AI models in sequence. A cheaper, faster model (Haiku) does an initial pass to classify sessions worth keeping. A more capable model (Sonnet) then extracts durable knowledge from the survivors, tagging it as a pattern, a decision, a gotcha, or a tool. Notes are cross-linked using Obsidian's wiki-link format. State lives in a local SQLite database so the tool never reprocesses the same session twice. An optional integration with Ollama, a local model runner, adds vector-based semantic search over the distilled notes. An MCP server exposes the vault to Claude Code so the AI can query your accumulated knowledge during future sessions. Setup follows three commands: init (an interactive wizard that asks for your AI provider, vault location, and how often to run), run (a single processing pass), and schedule install (registers a background daemon that runs every three hours). On macOS the daemon uses launchd, on Linux it tries systemd first and falls back to cron. Windows is not yet supported. The first run processes all historical sessions and typically costs between one and five dollars in API fees, depending on how many sessions you have. Each subsequent run costs around five cents. The README notes that using Kie.ai as the API provider instead of Anthropic directly cuts costs by roughly 72 percent while using the same underlying models. The author ran the tool against 226 of their own sessions on the first night and extracted 126 notes: 54 patterns, 47 decisions, 23 gotchas, and 2 tool notes. The project is MIT-licensed and available on npm as @djolex999/vir-cli.

Copy-paste prompts

Prompt 1
I just installed @djolex999/vir-cli. Walk me through running `vir init` to choose my AI provider, set my Obsidian vault path, and configure the processing schedule.
Prompt 2
I have 200 Claude Code sessions and want to run vir to extract patterns and decisions. Estimate my first-run API cost and show me the exact command to start processing.
Prompt 3
Help me configure the vir MCP server so Claude Code can query my Obsidian vault for relevant past decisions during a new coding session.
Prompt 4
Show me how to set up vir's schedule daemon on Linux using systemd so it processes new Claude Code sessions every three hours automatically.
Prompt 5
I want to use Kie.ai with vir instead of Anthropic to cut API costs by 72 percent. How do I configure vir to point to the Kie.ai endpoint?
Open on GitHub → Explain another repo

← djolex999 on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.