Skip to main content
Glama

sessionwiki

Your AI coding sessions, compiled into a searchable, interlinked wiki โ€” from Claude Code, Codex CLI, Cursor, Gemini CLI, Copilot, ZCode and OpenCode. Local-first, with LLM synthesis, a session graph, and an MCP server so your agents can look up what you already solved.

License: MIT Python 3.9+ Version Tests CI Link check Wiki checks Docker

๐Ÿ‘‰ Live demo: necroz.github.io/sessionwiki

27 synthetic sessions across five projects and seven agents (Augโ€“Nov 2026) โ€” no personal data. Rebuilt from examples/demo-sessions/ on every push to master.

sessionwiki home: activity heatmap, token stats and project cards


Why

Every agent you work with writes a full transcript to disk: the plan, the dead ends, the fix, the reasoning behind it. Hundreds of them, in five different formats, and you never look at them again.

sessionwiki turns that history into a knowledge base:

  • One place for every agent. Claude Code, Codex CLI, Cursor, Gemini CLI, Copilot, ZCode and OpenCode sessions land in the same wiki, tagged by agent, project, model and date.

  • Always current. Hooks, an OpenCode plugin and nightly timers keep it in sync without you running anything.

  • Readable. LLM synthesis writes a summary page per session; low-signal sessions are folded into cluster pages instead of cluttering the wiki.

  • Usable by your agents. A built-in MCP server lets Claude Code, ZCode or any MCP client search past decisions before redoing them.

  • Yours. Everything runs locally; transcripts are redacted on the way in, and sessionwiki audit checks the output before you publish anything.

Already using Claude Code's built-in memory, claude-mem or a session search tool? The FAQ explains what sessionwiki adds โ€” and when another tool is the better choice.

Related MCP server: Context Grove

Highlights

10 sources

Built in: Claude Code, Codex CLI, ZCode, OpenCode. Opt-in: Cursor, Gemini CLI, Copilot Chat, Copilot CLI, ChatGPT export, Obsidian โ€” each with its own agent badge

Autosync

Claude Code Stop hook, ZCode Stop hook + nightly systemd / launchd / Task Scheduler job, OpenCode session.idle plugin

Synthesis backends

extractive (default, no model), Ollama, any OpenAI-compatible server (vLLM, SGLang, LM Studio, LiteLLM, hosted), agent-delegate, offline dummy

Signal over noise

Low-signal session coalescing, wikilink cleanup, concurrency control, cost --estimate

Static site

365-day heatmap, token and cache stats, filterable sessions table, session pages with highlighted code, project pages with topics, session โ†” project graph, โŒ˜K search, dark mode

MCP server

6 read tools by default (query, search, read, list sources, lint, dashboard); SESSIONWIKI_MCP_TOOLS=full adds sync, exports and write/edit/archive pages (with a confirm step) โ€” 11 in total

AI exports

llms.txt, llms-full.txt, JSON-LD graph, per-page .txt / .json, sitemap, RSS

Safe by default

Redaction of usernames and 31 secret patterns, read-only database exports, OS file locks and atomic state writes, doctor and audit

Screenshots

All screenshots come from the live demo and are regenerated with scripts/regen_docs_screenshots.py.

Every session, every agent โ€” filter by project, model and date; each row carries its agent badge.

sessions table with Claude, ZCode, Codex and OpenCode badges

Session pages โ€” the summary, the conversation, highlighted code and the tools that ran, plus token and cache usage.

session page with a highlighted Go code block and tool calls

Projects โ€” topics, description, activity and tool usage per project, with freshness badges on the index.

project page for infra-stack

projects index with freshness badges

Graph and search โ€” sessions grouped around their projects; โŒ˜K searches every page instantly.

session and project graph

command palette search for "redis"

Quick start

git clone https://github.com/necroz/sessionwiki.git
cd sessionwiki
./setup.sh                 # Windows: setup.bat โ€” creates .venv, detects your agents
./sync.sh                  # convert new sessions into raw/
./build.sh && ./serve.sh   # build the site and open http://127.0.0.1:8765

setup creates a checkout-local .venv, installs the package, scaffolds raw/, wiki/, site/, enables the adapters for the agents it finds and runs sessionwiki doctor. The wrapper scripts use the venv automatically; for the CLI, activate it (source .venv/bin/activate) or call .venv/bin/sessionwiki.

Or install the published package โ€” pick one:

uv tool install sessionwiki          # uv: CLI in its own isolated environment
uvx sessionwiki --help               # uv: run without installing
pip install sessionwiki              # pip, inside a virtualenv
pip install 'sessionwiki[graph]'     # + graphify graph engine (also works with uv tool install)

Docker โ€” serve a site you have built (image ghcr.io/necroz/sessionwiki, see Docker deployment for docker compose and running CLI commands in the container):

docker run --rm -p 8765:8765 -v "$PWD/site:/wiki/site:ro" ghcr.io/necroz/sessionwiki

A step-by-step walkthrough with screenshots lives in the setup guide.

Connect your agents

Claude Code โ€” one command sets up the whole pipeline:

sessionwiki claude install --dry-run   # show what will be written
sessionwiki claude install             # Stop + SessionStart hooks, nightly sync โ†’ synthesize โ†’ build

It adds a Stop hook (import new sessions in the background after every reply) and a SessionStart hook (recent sessions of the project into context) to ~/.claude/settings.json, writes a nightly job for systemd, launchd or Task Scheduler that runs sessionwiki claude nightly, and prints the claude mcp add command for the MCP server. Hooks and jobs that already exist โ€” also hand-written ones โ€” are left alone unless you pass --force. Without the nightly job only raw/ grows: nothing else turns transcripts into wiki pages.

Codex CLI, Cursor, Gemini CLI, Copilot โ€” read straight from their session folders on sessionwiki sync. The Stop hook that claude install writes looks like this, if you prefer to add it by hand:

{
  "hooks": {
    "Stop": [{ "hooks": [{ "type": "command",
      "command": "cd /path/to/sessionwiki && .venv/bin/python -m sessionwiki sync --no-auto-build >/dev/null 2>&1 &" }] }]
  }
}

Parallel hook runs are safe: sync and synthesize take an OS file lock and write their state atomically.

To add related past work to every prompt, opt in to a UserPromptSubmit hook โ€” it is off unless SESSIONWIKI_PROMPT_RECALL=1 is set. It injects up to three related pages plus up to three approved lessons (wiki/lessons/, lifecycle reviewed or verified); draft lessons never reach the prompt:

{
  "hooks": {
    "UserPromptSubmit": [{ "hooks": [{ "type": "command", "timeout": 10,
      "command": "cd /path/to/sessionwiki && SESSIONWIKI_PROMPT_RECALL=1 .venv/bin/python -m sessionwiki recall --prompt-hook" }] }]
  }
}

Cost: two wiki scans per prompt (pages, then lessons). A single scan measured a median of 170 ms with three pages returned, 140 ms when nothing matches (before lessons landed).

ZCode keeps sessions in SQLite. sessionwiki exports them read-only and installs the hook and a nightly job for you:

sessionwiki zcode install --dry-run   # show what will be written
sessionwiki zcode install             # Stop + SessionStart hooks, systemd / launchd / Task Scheduler

OpenCode (V2, opencode.db) gets a server plugin that runs autosync when a session goes idle:

sessionwiki opencode install --dry-run
sessionwiki opencode install          # honours $XDG_CONFIG_HOME

Hook-triggered runs skip instead of queueing when a cycle is already running; scheduled runs wait and catch up. Details: ZCODE.md, docs/adapters/opencode.md, and sessionwiki adapters for the full list.

LLM synthesis

sync fills raw/ with redacted transcripts. synthesize turns them into wiki pages: a summary per session, project pages, cross-links. Out of the box it uses extractive โ€” no LLM and no network. To use your own LLM, copy the template and fill in your server and model; config.local.json is git-ignored, so the address stays on your machine:

cp examples/config.local.example.json config.local.json   # then edit base_url and model
sessionwiki doctor                                         # the `llm` line shows the active backend
sessionwiki synthesize --check                             # test the connection

A fuller example:

{
  "synthesis": {
    "backend": "openai",
    "base_url": "http://127.0.0.1:8000/v1",
    "model": "qwen3-coder",
    "max_concurrency": 8,
    "coalesce_low_signal": true
  }
}
sessionwiki synthesize --estimate     # what it will cost before you run it
sessionwiki synthesize                # new sessions only; idempotent
sessionwiki all --with-synth          # synthesize โ†’ build โ†’ graph โ†’ export โ†’ lint

Backends: extractive (the default โ€” no model and no network: a useful page from the transcript itself), ollama (local), openai (any OpenAI-compatible /v1: vLLM, SGLang, LM Studio, LiteLLM, hosted APIs), agent-delegate (let your coding agent write the pages), dummy (offline metadata stubs). sessionwiki warns when a non-loopback base_url would send transcripts off your machine. See docs/modes/api/.

Ask your wiki from your agents (MCP)

Claude Code plugin โ€” the MCP server, a skill that tells the agent when to search the wiki, a SessionStart hook that puts the project's recent sessions into context, and a Stop hook that imports new Claude Code sessions in the background after every reply. It asks for your sessionwiki folder on install. For wiki pages from those sessions, add the nightly synthesize job without a second set of hooks: sessionwiki claude install --no-hooks.

/plugin marketplace add necroz/sessionwiki
/plugin install sessionwiki@sessionwiki

Any MCP client โ€” run the published package with uvx, and point SESSIONWIKI_HOME at the folder that holds raw/ and wiki/ (run sessionwiki sync there first):

{
  "mcpServers": {
    "sessionwiki": {
      "command": "uvx",
      "args": ["sessionwiki", "mcp"],
      "env": { "SESSIONWIKI_HOME": "/path/to/your/sessionwiki" }
    }
  }
}

From a source checkout, use "command": "/path/to/sessionwiki/.venv/bin/sessionwiki" with "args": ["mcp"]; the checkout is the data root, so no env is needed.

Add it to Claude Code, Claude Desktop, ZCode or any MCP client. Tools include wiki_query (ranked search over wiki pages in any language, falling back to raw transcripts), wiki_search (exact text, optionally over raw transcripts), wiki_read_page, wiki_list_sources, wiki_lint, wiki_sync, wiki_export, wiki_dashboard and the guarded write tools โ€” 11 in total, stdio transport, no SDK dependency, path-traversal guarded.

By default the server lists only the six read-only tools, so the rest do not cost tokens in every session. Every install path โ€” the plugin, uvx, a source checkout โ€” gets the same six. Set "SESSIONWIKI_MCP_TOOLS": "full" in env to add wiki_sync, wiki_export and the three write tools; new sessions reach the wiki through hooks and the nightly job, not through wiki_sync.

CLI reference

sessionwiki init                    # scaffold raw/ wiki/ site/
sessionwiki sync                    # export ZCode/OpenCode + convert transcripts to markdown
sessionwiki synthesize              # LLM summaries into wiki/ (--estimate, --coalesce-only, --force)
sessionwiki build                   # static site + AI exports
sessionwiki serve                   # local server on 127.0.0.1:8765
sessionwiki all                     # build โ†’ graph โ†’ export โ†’ lint (add --with-synth)
sessionwiki query "<question>"      # ask the wiki a question from the terminal
sessionwiki graph                   # session/project and wikilink graph
sessionwiki lint                    # wiki lint rules
sessionwiki export                  # llms.txt, JSON-LD, sitemap, RSS, โ€ฆ
sessionwiki candidates              # review candidate pages
sessionwiki adapters                # available adapters and their state
sessionwiki doctor                  # check Python, deps, config, agent paths
sessionwiki audit                   # scan raw/ wiki/ site/ for usernames and secrets
sessionwiki zcode                   # export ยท autosync ยท install
sessionwiki opencode                # export ยท autosync ยท install
sessionwiki claude                  # install (hooks + nightly job) ยท nightly
sessionwiki mcp                     # MCP server on stdio
sessionwiki recall                  # a project's recent sessions, for a SessionStart hook
sessionwiki version

Every subcommand has --help. Full reference: docs/reference/cli.md.

Configuration

Settings are layered; later files win:

examples/sessions_config.json  โ†’  config.json  โ†’  config.local.json
   (shared defaults)              (gitignored)      (gitignored, machine-local)

Put machine-specific values โ€” synthesis backend and keys, redaction patterns, project roots, adapter toggles โ€” in config.local.json. Reference: docs/configuration-reference.md. Use .llmwikiignore to exclude projects or sessions.

How it works

 Claude Code ยท Codex ยท Cursor ยท Gemini ยท Copilot       ZCode ยท OpenCode (SQLite)
              โ”‚ JSONL                                          โ”‚ read-only export
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                     โ–ผ
                       sync  โ†’  raw/sessions/*.md          redacted, immutable
                                     โ”‚
                       synthesize    โ–ผ
                                  wiki/                    sources ยท projects ยท entities ยท concepts
                                     โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ–ผ                โ–ผ                  โ–ผ
                 build โ†’ site/   MCP server        exports (llms.txt, JSON-LD)

Three layers, following Karpathy's LLM Wiki pattern: raw/ is the immutable source of truth, wiki/ is maintained by the LLM, site/ is generated. Your raw/ and wiki/ are gitignored โ€” your data never enters the repository.

Privacy

  • Transcripts are redacted on conversion: your username, home paths and 31 kinds of keys, tokens and passwords, plus your own patterns.

  • ZCode and OpenCode databases are opened read-only.

  • Nothing leaves your machine unless you configure a remote synthesis backend โ€” and sessionwiki warns when you do.

  • sessionwiki audit scans raw/, wiki/ and site/ before you publish a site.

See docs/privacy.md and SECURITY.md.

Documentation

Based on llmwiki

sessionwiki started as a fork of llmwiki by Pratiyush (MIT) at v1.3.82 and keeps its full history. Most of the converter, site, lint and MCP foundations are his work. sessionwiki adds the ZCode and OpenCode sources with autosync, the OpenAI-compatible synthesis backend, session coalescing, locking and atomic state, doctor and audit, the session graph, and a long list of fixes โ€” see what's different and how to migrate.

Thanks also to Andrej Karpathy for the LLM Wiki idea, Python Markdown, highlight.js and vis-network.

Contributing

Read CONTRIBUTING.md. Keep PRs to one concern, use feat: / fix: / docs: / chore: / test: titles, add a CHANGELOG entry for feat and fix, and never commit real session data. CI must be green.

License

MIT ยฉ 2026 Igor Lashkevich (sessionwiki) ยท ยฉ 2026 Pratiyush (original llmwiki). See NOTICE.

Available Tools

6 tools
wiki_dashboardWiki overviewA
Read-onlyIdempotent

Overview of the whole wiki in one call: total page count, pages per type (source, entity, concept, ...), pages per lifecycle state, and how many pages have high (>=0.8), medium, low (<0.5) or no confidence. Returns plain-text Markdown. Read-only, no parameters. No cache: every call re-reads wiki/ from disk, so the numbers are current and the cost grows with the wiki. Call it first to see the wiki's size and health, then use wiki_query with lifecycle or tag filters for the page lists.

Inputs: no named parameters.

wiki_lintLint the wikiA
Read-onlyIdempotent

Run the wiki's structural lint rules โ€” the same engine as the CLI sessionwiki lint: orphan pages, broken [[wikilinks]], frontmatter completeness and validity, content freshness, index sync, duplicates and every other registered rule that needs no LLM. Returns JSON {total_pages, summary: {severity: count}, issue_count, issues: [{rule, severity, page, message}], truncated}; the issues list stops at 200 items, summary and issue_count cover all. Read-only: it reports and changes nothing. Use wiki_dashboard for a quick health overview; wiki_query to open the pages it names.

Inputs: no named parameters.

wiki_list_sourcesList session transcriptsA
Read-onlyIdempotent

List raw session transcripts in raw/sessions/ (one markdown file per agent session), sorted by path, oldest first. Returns a JSON array of {path, project, date, filename, size_bytes}; project and date come from each file's frontmatter, so either can be empty. project is a case-sensitive substring match; omit it to list every session, and an unknown value returns an empty array. Read-only. Use it to see which sessions exist for a project, then open one with wiki_read_page. To find sessions by content, use wiki_search with include_raw=true instead.

Inputs: project.

wiki_queryAsk the wikiA
Read-onlyIdempotent

Start here for questions about the user's past work ('what did I decide about X'), in any language: session pages keep the user's original request. Ranks wiki/ pages by keyword matches, rare words weighted higher (no LLM, no embeddings). Service pages are skipped; project hubs rank below sessions. Pages sharing a tool or topic name with two or more top hits rank too, marked 'via '. If no wiki page matches, falls back to raw transcripts (see include_raw). Returns up to max_pages paths, each with a status line (type, lifecycle, confidence, date, sources; raw hits marked not yet in wiki) and a ~400-character snippet, plus the start of overview.md (index.md when nothing matches). max_pages clamps to 1-50. Optional filters: project and type match frontmatter exactly; tag equals one whole tag, ignoring case; lifecycle takes comma-separated states; date_from/date_to are YYYY-MM-DD, invalid dates ignored. Filters apply to both layers. Open a full page with wiki_read_page; use wiki_search for exact wording.

Inputs: question (required), tag, type, date_to, +5 more.

wiki_read_pageRead a pageA
Read-onlyIdempotent

Return the full text of one file, unmodified and not truncated. path is relative to the sessionwiki folder and uses '/' separators; absolute paths and '..' escapes are rejected, and symlinks are resolved before the allowlist check. The file must be under wiki/, raw/, docs/, examples/ or site/ (or be README.md, CHANGELOG.md, CONTRIBUTING.md or LICENSE at the root). Returns an error if the path is outside that set, does not exist, is not a file, or is not valid UTF-8. Reads the whole file with no size cap, so very large files are returned in full. Get paths from wiki_query, wiki_search or wiki_list_sources.

Inputs: path (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelogโ€ฆ

    TDQS

    A4.7/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a clearly distinct role: exact substring search vs ranked question lookup, structural lint vs aggregate dashboard, transcript listing vs content search, and full-file reads. Descriptions explicitly cross-reference each other and state when to prefer an alternative, leaving little room for misselection.

    Naming Consistency5/5

    All six tools use the same wiki_ prefix with snake_case verb_noun or noun forms (wiki_search, wiki_read_page, wiki_list_sources), forming a predictable, readable pattern. No mixed conventions or casing deviations.

    Tool Count5/5

    Six tools is well-scoped for a wiki inspection server; each earns its place covering search, ranked retrieval, reading, linting, health overview, and source listing. Nothing feels redundant or missing from the count perspective.

    Completeness4/5

    The read-only surface covers content discovery, exact search, full reads, structural validation, health metrics, and raw session listing. Minor gaps exist, such as no explicit list-all-pages or tag browsing tool, but wiki_query's filters and overview output largely compensate.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Exposes a living systems memory vault to autonomous agents, letting them search notes with BM25 ranking, read sections within token budgets, extract API/port/schema contracts, compute dependency blast radius, and run machine-verifiable invariant assertions before mutating code. It also supports surgical frontmatter edits, schema linting, wikilink integrity checks, and worklog recording, over stdio MCP.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI coding agents to consult a project's Git-versioned Markdown knowledge base over local stdio โ€” checking knowledge health, listing the catalog, searching topics, and reading guides before acting. Access stays read-only, so project guidance, decisions, and lessons learned remain shared with human teammates and traceable beside the code.
      4
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Exposes read-only tools over stdio that let an agent search the user's past Claude Code sessions by keyword and meaning, open exchanges with their neighbours, brief whole sessions, and trace everything touching a file, commit, PR or URL. The agent retrieves for itself and answers from what comes back, so it can recall what was said or decided in earlier conversations without leaving the machine.
      14 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Gives AI agents access to a persistent document workspace, letting them search, read, and update notes, guides, and project documentation across a full catalog of tools, prompts, and resources. It connects either to the hosted Cloud endpoint over Streamable HTTP with OAuth or API-key auth, or to a self-hosted instance through a stdio bridge.
      MIT