Use xNet from Claude Code / Codex
The same way people point Claude Code at an Obsidian vault, you can point it at your xNet workspace — and read, search, query, and edit your pages, databases, and canvases without leaving the terminal. The Agent Interfaces guide covers the surfaces in depth; this one is the quick on-ramp.
One-step connect
Section titled “One-step connect”xnet connect claude-code # project scope, read-onlyxnet connect claude-code --user # also install the skill for all projectsxnet connect claude-code --writes # register the MCP server with write accessxnet connect codex # Codex: AGENTS.md + .codex/config.tomlxnet connect is idempotent — it installs the SKILL.md, registers the
xnet MCP server, writes a CLAUDE.md/AGENTS.md contract, and (with
--vault <dir>) bootstraps a scoped checkout with an index. Re-running it
reports what is already in place and changes nothing. It finishes by running
xnet doctor --agent-access, which confirms the backend, full-text search, and
signing identity are all reachable.
Works whether or not the app is running
Section titled “Works whether or not the app is running”The agent verbs resolve a backend automatically:
- the desktop app’s local API (
:31415) when it is running, otherwise - a standalone SQLite store — discovered from the app’s data directory, or
pointed at explicitly with
--db <path>(or$XNET_DB).
So an agent can work against your data even with the app closed, and web-only
users can point at any local store. Writes made this way are signed by a key you
provide (--key, $XNET_SIGNING_KEY) or by an
enrolled agent passport (--agent <name>); the CLI
refuses to persist a write under a silent throwaway identity.
Three lanes, cheapest first
Section titled “Three lanes, cheapest first”flowchart LR A[Agent in Claude Code / Codex] -->|Bash| CLI[1 · xnet CLI] A -->|Read / Edit / Grep| V[2 · Vault checkout] A -->|MCP client| M[3 · xnet mcp serve] CLI --> Core[(xNet store · signed change log)] V <-->|checkout / commit| CLI M --> Core
- CLI —
xnet search/query/db getprint plain stdout. Reach here first: it costs far fewer tokens than loading a wall of MCP tool schemas. - Vault —
xnet checkout --query "…"materializes a scoped slice as Markdown you edit, thenxnet commitlifts the edits back through validated mutation plans. Never check out the whole workspace. - MCP — the registered
xnetserver is the fallback for shell-less clients (Claude Desktop, browser). It is read-only unless you connected with--writes.
Safe when the app and the agent collide
Section titled “Safe when the app and the agent collide”The store stays the source of truth, and every edit becomes a validated plan — never a blind file-to-database sync. If the app writes a node after you checked it out, committing your now-stale vault edit surfaces a conflict instead of overwriting the newer value:
$ xnet statusconflict Pages/shared-page.md stale-export based on updatedAt:10, live is updatedAt:11Fix the file against the current value and commit again. Stale edits never silently win.
Further reading
Section titled “Further reading”- Agent Interfaces — the checkout layout, the
full CLI,
SKILL.md, and the slim MCP surface - Identity — agent passports and signing