sessionwiki

io.github.necroz由 GitHub 帳號 necroz 發布v2.0.2更新於 Nov 6, 2026

Search a local wiki compiled from your Claude Code, Codex, Cursor and other AI coding sessions.

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

搜尋並讀取由 Claude Code、Codex、Cursor 等 AI 程式開發工作階段紀錄編譯而成的本機 wiki。

可以做什麼
  • 以自然語言問題查詢 wiki,從過往工作階段取得答案
  • 搜尋 wiki 頁面(可選擇包含原始工作階段紀錄),並讀取個別頁面
  • 列出可用來源,並對 wiki 執行規則檢查
  • 同步新的工作階段、匯出供 AI 讀取的檔案,以及開啟儀表板檢視
適用情境
適合希望助理在重做之前先查清先前程式開發工作階段中已解決的問題,並把多個程式開發代理與專案的歷史集中在同一個本機知識庫的情境。
執行需求
透過 uvx 從 PyPI 套件 sessionwiki 以 stdio 在本機執行。需設定環境變數 SESSIONWIKI_HOME,指向包含 raw/ 與 wiki/ 的資料夾,並先在該處執行 sessionwiki sync。僅限桌面端;未宣告驗證。
安裝前請注意
部分工具會寫入:sync 匯入新的工作階段,export 在該資料夾產生檔案。wiki 由完整工作階段紀錄建構,可能含程式碼、路徑與金鑰;文件稱會做去識別化與稽核,但應自行確認。若設定遠端合成後端,工作階段紀錄會離開你的電腦。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 sessionwiki,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

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.

Highlights

8 sourcesClaude Code, Codex CLI, Cursor, Gemini CLI, Copilot Chat / CLI, ZCode, OpenCode, Obsidian — each with its own agent badge
AutosyncClaude Code Stop hook, ZCode Stop hook + nightly systemd / launchd / Task Scheduler job, OpenCode session.idle plugin
Synthesis backendsOllama, any OpenAI-compatible server (vLLM, SGLang, LM Studio, LiteLLM, hosted), agent-delegate, offline dummy
Signal over noiseLow-signal session coalescing, wikilink cleanup, concurrency control, cost --estimate
Static site365-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 server12 tools: query, search, read, list sources, lint, sync, exports, dashboard…
AI exportsllms.txt, llms-full.txt, JSON-LD graph, per-page .txt / .json, sitemap, RSS
Safe by defaultRedaction of usernames and 17 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.

Graph and search — sessions grouped around their projects; ⌘K searches every page instantly.

Quick start

bash
git clone https://github.com/necroz/sessionwiki.gitcd 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:

bash
uv tool install sessionwiki          # uv: CLI in its own isolated environmentuvx sessionwiki --help               # uv: run without installingpip install sessionwiki              # pip, inside a virtualenvpip 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):

bash
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, 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:

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.

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

bash
sessionwiki zcode install --dry-run   # show what will be writtensessionwiki 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:

bash
sessionwiki opencode install --dry-runsessionwiki 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. Point it at any backend in config.local.json:

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

Backends: 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 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@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):

json
{  "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

bash
sessionwiki init                    # scaffold raw/ wiki/ site/sessionwiki sync                    # export ZCode/OpenCode + convert transcripts to markdownsessionwiki synthesize              # LLM summaries into wiki/ (--estimate, --coalesce-only, --force)sessionwiki build                   # static site + AI exportssessionwiki serve                   # local server on 127.0.0.1:8765sessionwiki all                     # build → graph → export → lint (add --with-synth)sessionwiki query "<question>"      # ask the wiki a question from the terminalsessionwiki graph                   # session/project and wikilink graphsessionwiki lint                    # wiki lint rulessessionwiki export                  # llms.txt, JSON-LD, sitemap, RSS, …sessionwiki candidates              # review candidate pagessessionwiki adapters                # available adapters and their statesessionwiki doctor                  # check Python, deps, config, agent pathssessionwiki audit                   # scan raw/ wiki/ site/ for usernames and secretssessionwiki zcode                   # export · autosync · installsessionwiki opencode                # export · autosync · installsessionwiki mcp                     # MCP server on stdiosessionwiki recall                  # a project's recent sessions, for a SessionStart hooksessionwiki 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 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 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.

來源:README.md,提交 48e7701

工具

12

wiki_query

Search the sessionwiki by keyword and return relevant page content. Reads wiki/index.md, wiki/overview.md, and any matching pages. Use for questions like 'what did I decide about X' or 'what's my preferred approach to Y'.

輸入參數question必填max_pages

wiki_list_sources

List all raw source markdown files under raw/sessions/ with their metadata.

輸入參數project

wiki_read_page

Return the full content of one wiki or raw page. Path is relative to the repo root (e.g. 'wiki/sources/clever-munching-parnas.md').

輸入參數path必填

wiki_lint

Run the lint workflow over the wiki: find orphan pages, broken wikilinks, contradictions, and stale summaries. Returns a JSON report.

無需輸入參數。

wiki_sync

Run the session-transcript converter to pull in any new sessions from the agent's session store into raw/sessions/. Returns the converter's summary line. Defaults to dry-run; pass confirm=true to actually write.

輸入參數confirmdry_run

wiki_export

Dump the entire wiki in a machine-readable format for AI agents. Returns the requested format as text. Use 'llms-txt' for the short llms.txt index, 'llms-full-txt' for the flattened content dump, 'jsonld' for the schema.org JSON-LD graph, 'sitemap' for the sitemap.xml, or 'list' to list every available export.

輸入參數format必填

wiki_confidence

Return confidence scores for wiki pages. Filters by minimum confidence threshold. Pages below threshold may need review.

輸入參數max_confidencemin_confidence

wiki_lifecycle

List pages by lifecycle state: draft, reviewed, verified, stale, or archived. Use to find pages needing review or archival.

輸入參數state必填

wiki_dashboard

Return a summary of wiki health: page counts by type, confidence distribution, lifecycle distribution, stale pages, and recent updates.

無需輸入參數。

wiki_category_browse

List tags and the count of pages for each. Optionally return all pages for a specific tag.

輸入參數tagmin_count

版本歷史

2
  1. v2.0.5Nov 7, 2026
  2. v2.0.2最新Nov 6, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分