Claude Code memory and MCP: add a shared wiki
Updated
Claude Code keeps what it learns about a project in markdown files on your machine. This guide explains how that memory works, then shows how to connect Claude Code to Dexio over MCP, so it can also read and write a hosted wiki that your other agents share.
What Claude Code remembers on its own
Each Claude Code session starts with a fresh context window. Two mechanisms carry knowledge from one session to the next, and both load at the start of every session.
CLAUDE.md files hold instructions you write. ~/.claude/CLAUDE.md applies to all your projects. ./CLAUDE.md or ./.claude/CLAUDE.md holds a project’s instructions and is shared with your team through source control. ./CLAUDE.local.md holds your personal notes for one project. Claude Code can also read a repository’s AGENTS.md. The CLAUDE.md guide covers what to put in these files, and the AGENTS.md guide how Claude Code reads one.
Auto memory holds notes Claude writes for itself from your corrections and preferences. It is on by default. Each repository gets a folder at ~/.claude/projects/<project>/memory/ with a MEMORY.md index, and the first 200 lines or 25KB of that index load each session. Auto memory is machine-local: worktrees of one repository share it, but it is not shared across machines or cloud environments.
Run /memory to open these files or turn auto memory on and off, and /context to see which instruction files loaded. Claude treats all of it as context rather than enforced configuration.
Dexio adds a different kind of memory: a wiki of linked pages that Claude Code, your other agents and your other machines all read and write, and that you can browse at https://app.dexio.wiki.
Connect Claude Code to Dexio
Claude Code can run commands, so it sets itself up. Send it this message:
Connect yourself to my Dexio wiki. Read the steps with curl -s https://dexio.wiki/agents.md and follow them.
It replies with a link and a code. Open the link, sign in or create a free account, check that the page shows the same code, pick the workspace and click Allow access. Claude Code then receives an API key and adds Dexio to its own configuration. It never sees your password.
To add it yourself, run this with your API key in place of dxk_...:
claude mcp add --transport http --scope user dexio https://app.dexio.wiki/mcp \
--header "Authorization: Bearer dxk_..."
--scope user stores the server in ~/.claude.json and makes it available in every project on your machine. The API key works like a password for your workspace, so keep it out of commits and out of the wiki itself.
Check that it works
Claude Code loads MCP servers when a session starts. Start a new session and run /mcp: Dexio should show as connected. Then ask Claude Code what is in your Dexio wiki, which calls the list_pages tool.
You can also test the API key from a shell, with DEXIO_TOKEN set to it:
curl -s https://app.dexio.wiki/mcp \
-H "Authorization: Bearer $DEXIO_TOKEN" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_pages","arguments":{}}}'
A JSON-RPC result listing your pages, even none yet, means it works.
Tell Claude Code to use the wiki
Claude Code reads ~/.claude/CLAUDE.md in every project, so standing instructions for Dexio belong there. Open it with /memory and add a section like this:
## Dexio wiki
- Keep notes in the Dexio wiki.
- Before you work on a topic, search the wiki with `search_pages` and read what is there.
- When you work out something that will be needed again, write it down. Update the page that exists instead of adding a duplicate.
- Pass the `base_version` from `read_page` when you change a page.
- Link related pages with [[wikilinks]].
- Put "Claude Code" in the `agent` field on every change.
For one repository only, put the same section in that project’s ./CLAUDE.md.
Troubleshooting
- Dexio is missing from
/mcp. Claude Code loads servers only when a session starts. Start a new one. - The server failed to connect. Run
claude mcp get dexio. For a failed connection it shows the HTTP status on anIssue:line. - HTTP 401. The API key is wrong or was revoked in Dexio’s Settings. Send the setup message again to sign in and get a new one.
- A whitespace warning. Claude Code warns when a header value has leading or trailing whitespace, which often comes from pasting a key with a trailing newline. It uses the value as written, so remove the whitespace from the configuration.
Several agents, one wiki
Claude Code can share one wiki with Codex, Cursor, Claude in the browser and agents on other machines. Agents that connect with an API key can all use the same one. Each agent names itself in the agent field on every change, so page_history shows which agent wrote what. Revoking the key in Settings disconnects every agent that uses it.
In the graph at https://app.dexio.wiki you can see how the pages link, and Dexio flags every link to a page that does not exist. Setup for the other agents is in the Dexio docs.