Setup guide
Set Up a Knowledge Base Your Coding Agents Can Query
Install the Wenlan runtime, connect Claude Code, Codex, and Cursor, add one project source set, and prove the capture, distill, cite, and refresh loop before expanding.
About this guide
Workflows
Developers setting up shared, cited project knowledge for Claude Code, Codex, Cursor, or another coding agent
8 min read
01
One local daemon holds the knowledge; every connected client queries the same sources and pages.
02
Start with one client and one bounded source set, then prove citations and refresh before expanding.
03
Keep the repository authoritative; the knowledge base holds the reasoning that is expensive to reconstruct.
01
Quick answer
Install the runtime for your operating system, run `wenlan status`, connect one coding client, point `wenlan sources add <path>` at one bounded project folder, distill one repeated topic into a cited Page, then verify that a second client can retrieve it and that editing a source marks the Page stale.
Wenlan is a local-first, open-source (Apache 2.0) knowledge base built around a lightweight Rust daemon. Claude Code, Codex, Cursor, Claude Desktop, Gemini CLI, and other clients reach the same sources, memories, and maintained Pages over MCP or plugins, with citations, staleness, revisions, and human review kept visible.
02
When this problem appears
A coding agent starts every session by re-reading the repository and rediscovering the same architecture decisions, external constraints, and tribal knowledge. Stuffing all of it into AGENTS.md burns context on every task and goes stale quietly. Raw search finds text, but it cannot tell which conclusion is current, cited, and reviewed.
03
Build the loop in one afternoon
Resist the urge to connect every client and import the whole company drive. The setup is done when one bounded topic survives the full read, cite, verify, and refresh loop.
- Install the runtime for your operating system. On macOS Apple Silicon with Node.js: `npx -y wenlan setup`. Linux and Windows have their own one-command paths; the setup doc below lists them all.
- Run `wenlan status` and confirm the local daemon reports healthy before touching any client configuration.
- Connect one coding client first. Claude Code and Codex have Wenlan plugin paths with a `/setup` skill that installs or repairs the runtime and verifies the MCP round trip. For Cursor and other local MCP clients, `~/.wenlan/bin/wenlan connect cursor` writes the client configuration.
- Add one bounded source set: `wenlan sources add <project docs folder>`. Read the found, ingested, and skipped counts; supported inputs are Markdown, text, text-extractable PDFs, folders, and read-only Obsidian vaults.
- Capture two or three real decisions or lessons with the client's capture path, then run `/distill <topic>` and `/pages <topic>` in a plugin client, or the equivalent Wenlan tools in an MCP-only client. Distill only what the sources can actually support.
- Run `/lint` and `/curate` to catch malformed citations, orphan links, and broken embeddings before anyone relies on the Page.
- Verify from a second client: retrieve the Page, open the citation to confirm it supports the claim, edit the cited source, and confirm the Page is marked stale.
- Only then add the next source set or client. Growing in small verified steps keeps one bad import from poisoning the whole knowledge base.
First-client setup sequence
npx -y wenlan setup
wenlan status
~/.wenlan/bin/wenlan connect cursor
wenlan sources add ~/projects/my-app/docs
# in a Wenlan plugin client:
/distill <recurring project topic>
/pages <recurring project topic>
/lint
/curate04
What to check next
Do not duplicate the repository inside the knowledge base. Current code, tests, and specifications stay authoritative; maintain only the reasoning, external constraints, and cross-file conclusions that are expensive to reconstruct. Keep AGENTS.md or CLAUDE.md short and let cited Pages carry the long explanations on demand.
Prove one topic before scaling
Set up one client and one source set, verify citations and refresh, then grow the knowledge base in small verified steps.
FAQ