sessionwiki
This MCP server lets agents search, inspect, and maintain a local sessionwiki knowledge base of past AI coding sessions.
Ask natural-language questions over wiki pages with ranked keyword search and raw-transcript fallback (
wiki_query).Find exact text in wiki pages and optionally raw session transcripts (
wiki_search).List session transcripts by project and read full wiki/raw/docs files (
wiki_list_sources,wiki_read_page).Check wiki health: broken/orphan wikilinks, confidence scores, lifecycle states, and dashboard stats (
wiki_lint,wiki_confidence,wiki_lifecycle,wiki_dashboard).Discover content by entity name/type or tags (
wiki_entity_search,wiki_category_browse).Import new agent sessions in dry-run mode by default, writing only with explicit confirmation (
wiki_sync).Export whole-wiki artifacts such as llms.txt, llms-full.txt, JSON-LD, sitemap, RSS, and manifest (
wiki_export).
Adds Obsidian notes as a source, bringing them into the same tagged, searchable wiki alongside coding-agent sessions.
Uses Ollama as a local LLM synthesis backend to turn redacted session transcripts into summary and project wiki pages.
Connects to OpenAI-compatible LLM APIs for synthesizing session summaries and project wiki pages.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@sessionwiki search past sessions for how I fixed the flaky auth test"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
๐ 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.

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 auditchecks the output before you publish anything.
Related MCP server: mnemo
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 |
Synthesis backends | Ollama, any OpenAI-compatible server (vLLM, SGLang, LM Studio, LiteLLM, hosted), agent-delegate, extractive (no model), offline dummy |
Signal over noise | Low-signal session coalescing, wikilink cleanup, concurrency control, cost |
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 | 15 tools: query, search, read, list sources, lint, sync, exports, dashboard, write/edit/archive pages (with a confirm step)โฆ |
AI exports |
|
Safe by default | Redaction of usernames and 17 secret patterns, read-only database exports, OS file locks and atomic state writes, |
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.

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

Projects โ topics, description, activity and tool usage per project, with freshness badges on the index.
|
|
Graph and search โ sessions grouped around their projects; โK searches every page instantly.
|
|
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:8765setup 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/sessionwikiA step-by-step walkthrough with screenshots lives in the setup guide.
Connect your agents
Claude Code, Codex CLI, Cursor, Gemini CLI, Copilot โ read straight from their session folders on sessionwiki sync. To sync after every Claude Code reply, add a Stop hook to ~/.claude/settings.json:
{
"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:
{
"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: one wiki scan per prompt โ measured median 170 ms with three pages returned, 140 ms when nothing matches.
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 SchedulerOpenCode (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_HOMEHook-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. Point it at any backend in config.local.json:
{
"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 โ lintBackends: ollama (local), openai (any OpenAI-compatible /v1: vLLM, SGLang, LM Studio, LiteLLM, hosted APIs), agent-delegate (let your coding agent write the pages), extractive (no model and no network: a useful page from the transcript itself), dummy (offline 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, and a SessionStart hook that puts the project's recent sessions into context. It asks for your sessionwiki folder on install:
/plugin marketplace add necroz/sessionwiki
/plugin install sessionwiki@sessionwikiAny 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 more โ 12 in total, stdio transport, no SDK dependency, path-traversal guarded.
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 mcp # MCP server on stdio
sessionwiki recall # a project's recent sessions, for a SessionStart hook
sessionwiki versionEvery 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 17 kinds of keys and tokens, 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 auditscansraw/,wiki/andsite/before you publish a site.
See docs/privacy.md and SECURITY.md.
Documentation
Documentation hub โ start here
Setup guide ยท Installation ยท Use with Claude Code ยท Windows
CLI ยท Configuration ยท Architecture
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
15 toolswiki_archive_pageArchive a pageAIdempotent
Retire one page under wiki/ without deleting it: set lifecycle: archived, archived_reason and last_updated in its frontmatter. The file stays where it is, so links keep working, and wiki_update_frontmatter with lifecycle: reviewed restores it. Nothing is ever deleted. Refused for system pages and pages with origin: human. Without confirm=true it writes nothing and returns a preview. Ask the user before confirm=true. Returns JSON {path, previous_lifecycle, written}. Use wiki_lifecycle with state 'archived' to list archived pages.
Inputs: path (required), reason (required), confirm.
wiki_category_browseBrowse by tagARead-onlyIdempotent
Browse the wiki by tag (the 'tags' frontmatter field; 'category' here means tag). Without tag: lists tags used by at least min_count pages, most used first, up to 100. With tag: lists up to 50 pages with that tag as 'path - title' (min_count is ignored). Returns plain text. Read-only. Use wiki_entity_search for named things and wiki_query for free-text questions.
Inputs: tag, min_count.
wiki_confidenceList pages by confidenceARead-onlyIdempotent
List wiki pages whose frontmatter confidence (0.0-1.0) is between min_confidence and max_confidence; pages without a confidence value are left out. Returns plain text: the match count, then up to 50 lines of 'score path - title', lowest score first. Read-only. Use max_confidence=0.5 to find weak pages to recheck; use wiki_dashboard for the overall distribution.
Inputs: max_confidence, min_confidence.
wiki_dashboardWiki overviewARead-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. Call it first to see the wiki's size and health, then use wiki_lifecycle or wiki_confidence for the page lists.
Inputs: no named parameters.
wiki_entity_searchFind entitiesARead-onlyIdempotent
Find entity pages (people, orgs, tools, libraries, APIs, projects, concepts): wiki pages with type: entity. name matches a case-insensitive substring of the title or path; entity_type matches exactly; when both are given both must match; with neither, every entity is listed. Returns plain text: the count, then up to 50 lines of '[type] path - title', sorted by title. Read-only. Use wiki_query for free-text questions and wiki_category_browse for tags.
Inputs: name, entity_type.
wiki_exportExport the whole wikiARead-onlyIdempotent
Return one generated export file from site/ as text, to load the whole wiki at once: 'llms-txt' (short llms.txt index), 'llms-full-txt' (all pages flattened), 'jsonld' (schema.org graph), 'sitemap' (sitemap.xml), 'rss' (feed of recent pages), 'manifest' (build manifest.json), or 'list' (JSON list of the export files that exist, with sizes). Output is cut at 200 KB. Read-only. Fails if the file is missing; run sessionwiki build first. For specific facts wiki_query is cheaper.
Inputs: format (required).
wiki_lifecycleList pages by lifecycle stateARead-onlyIdempotent
List wiki pages whose frontmatter lifecycle equals state (draft, reviewed, verified, stale or archived). Returns plain text: the match count, then up to 50 lines of 'last_updated path - title', newest first. Read-only. Use 'stale' or 'draft' to find pages to update; use wiki_dashboard to see how many pages are in each state.
Inputs: state (required).
wiki_lintCheck wiki linksARead-onlyIdempotent
Check the link structure of wiki/: find orphan pages (no inbound [[wikilinks]]; index, overview and log are exempt) and broken [[wikilinks]] that point to no page. Returns JSON {total_pages, orphan_count, orphans, broken_link_count, broken_links}, listing at most 50 of each. Read-only: it reports and changes nothing. Use it after wiki_sync or before publishing; use wiki_lifecycle or wiki_confidence to review page quality.
Inputs: no named parameters.
wiki_list_sourcesList session transcriptsARead-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. Read-only. Use it to see which sessions exist for a project, then open one with wiki_read_page.
Inputs: project.
wiki_queryAsk the wikiARead-onlyIdempotent
Start here for questions about the user's past work ('what did I decide about X', 'how did I fix Y'), 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 and project overview pages rank below sessions. Sessions that name the same tool or topic as two or more top hits rank too, marked 'via '. If no wiki page matches, it falls back to raw transcripts (see include_raw). Returns up to max_pages paths with a ~400-character snippet each, plus the start of wiki/overview.md; with no match, the start of wiki/index.md. Optional filters: project, type, tag, date_from, date_to. Read-only. Open a full page with wiki_read_page; use wiki_search for exact wording.
Inputs: question (required), tag, type, date_to, +4 more.
wiki_read_pageRead a pageARead-onlyIdempotent
Return the full text of one file, unmodified and not truncated. path is relative to the sessionwiki folder and must be under wiki/, raw/, docs/, examples/ or site/ (or README.md, CHANGELOG.md, CONTRIBUTING.md, LICENSE). Returns an error if the path is outside that set, escapes the folder, or does not exist. Read-only. Get paths from wiki_query, wiki_search or wiki_list_sources.
Inputs: path (required).
wiki_searchSearch exact textARead-onlyIdempotent
Find exact text: case-insensitive substring match, line by line, over wiki/ pages, plus raw session transcripts in raw/sessions/ when include_raw=true. Returns JSON {term, matches: [{path, line, text}], truncated, scan_incomplete, files_scanned, files_total, skipped_oversize_files}; stops at 200 matches (truncated), skips files over 4 MiB and reads at most 256 MiB per call (scan_incomplete). Read-only. Use wiki_query instead for ranked, question-style lookup; open a hit with wiki_read_page.
Inputs: term (required), include_raw.
wiki_syncImport new sessionsAIdempotent
Convert new agent sessions (Claude Code, Codex, Cursor, ZCode, OpenCode, ...) from their local session stores into markdown under raw/sessions/. Dry run by default: it only reports what would change. It writes only with dry_run=false and confirm=true; ask the user before that. A real run adds new files and never overwrites existing ones, so repeating it is safe; it may also rebuild site/. Returns the converter's output (last 256 KB) and fails after 120 s. Use it when wiki_list_sources lacks recent sessions.
Inputs: confirm, dry_run.
wiki_update_frontmatterEdit page fieldsADestructiveIdempotent
Change frontmatter fields of one existing page under wiki/; the body is kept byte for byte. fields may set title, type, tags (a list that replaces the old one), lifecycle (draft, reviewed, verified, stale, archived) and confidence (0.0-1.0); other keys are refused. add_tags and remove_tags change the tag list without replacing it. last_updated is set to today. Refused for system pages and pages with origin: human. Without confirm=true it writes nothing and returns the old and new value of each field. Ask the user before confirm=true. Returns JSON {path, changes: {field: [old, new]}, written}. Use wiki_write_page to change the body and wiki_archive_page to retire a page.
Inputs: path (required), fields, confirm, add_tags, +1 more.
wiki_write_pageWrite a pageADestructiveIdempotent
Create or replace one Markdown page under wiki/. content is the whole page and must start with frontmatter that has title and type. The tool sets origin: agent and last_updated (today) in it. mode='create' (default) fails if the page exists; mode='replace' overwrites it. Refused for paths outside wiki/, non-.md files, wiki/archive/, system pages (index, log, overview, ...) and pages with origin: human. Without confirm=true it writes nothing and returns a preview. Ask the user before confirm=true. A real write is atomic and adds a line to wiki/log.md. Returns JSON {path, action, written, old_bytes, new_bytes}. Put new facts for review under wiki/candidates/. Use wiki_update_frontmatter to change only tags or fields, and wiki_archive_page instead of deleting.
Inputs: path (required), content (required), mode, confirm.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 15 tools
The retrieval tools (wiki_search, wiki_query, wiki_entity_search, wiki_category_browse) all find pages but are explicitly separated by matching strategy (exact text vs. ranked question lookup vs. entity name vs. tag) and the descriptions cross-reference each other with 'use X instead' guidance. The reporting tools (wiki_dashboard counts vs. wiki_lifecycle/wiki_confidence lists) are likewise clearly scoped, leaving only mild residual overlap for an agent choosing among multiple read paths.
Every tool shares the wiki_ prefix and snake_case in a predictable verb_noun shape (wiki_read_page, wiki_write_page, wiki_archive_page, wiki_list_sources, wiki_update_frontmatter). A few read-only tools are noun-style (wiki_dashboard, wiki_lifecycle, wiki_confidence, wiki_export), a minor but harmless deviation from the dominant verb pattern.
Fifteen tools is well within a reasonable scope for a wiki server with read, write, lifecycle, sync and export concerns. Each tool maps to a distinct capability (dashboard, search, query, entity/tag browse, read, write, frontmatter, archive, lint, sync, export, lifecycle, confidence), with no filler.
The surface covers the full lifecycle: discovery (query/search/entity/tag/dashboard), reading, creation and replacement, frontmatter updates, archival (intentionally instead of delete), plus lint, sync and export. Minor gaps existโno dedicated move/rename or unarchive tool (restore is a frontmatter lifecycle change) and no bulk operationsโbut these are workaroundable and partly by design.
Maintenance
Related MCP Connectors
Persistent memory, hybrid search and a goal graph for AI agents, over stdio or remote HTTP.
Shared memory for coding agents. Stop re-explaining your codebase every session.
A cited wiki of your GitHub repo: search, read pages, find symbols and ask, with line citations.
Project memory, documentation and controlled secret access for AI coding agents.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceExposes 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
- AlicenseNot gradedqualityCmaintenanceServes local-first project memory over stdio, exposing tools to inspect project state, search and retrieve context, report memory, and create Git-aware checkpoints for coding agents.1Apache 2.0
- AlicenseAqualityCmaintenanceEnables 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.41MIT
- FlicenseNot gradedqualityAmaintenanceGives MCP-capable coding agents a single ask tool that returns cited Markdown answers grounded in a compiled wiki of the user's notes, docs, and transcripts. Runs locally over stdio or remotely as a streamable-HTTP endpoint at /mcp with optional bearer-token auth.-



