Integrate

Your AI tools forget you between sessions. Fix it with one line.

Claude Code, Cursor, Codex, and every other agent boot with whatever you wrote in CLAUDE.md / AGENTS.md / .cursor/rules. Add a single line that points at your Memory.Wiki bundle or hub, and the next session opens with your prior decisions, notes, and analysis already loaded.

The URL response carries the bundle's pre-computed graph (themes, insights, concept relations) in the same payload — the receiving AI inherits the prior AI's work for free. No vendor lock-in, no API keys, no per-tool plug-in.

30-second setup

The same three steps apply to every tool below. The only thing that changes per tool is which file you drop the line into.

  1. Pick the bundle URL for the project (or the hub URL for personal context). Copy from the bundle's Deploy panel.
  2. Open your AI tool's context file (AGENTS.md works for most; tool-specific names below).
  3. Paste one line, commit, done.
markdown
# Project context

Working bundle: https://memory.wiki/b/<bundle-id>

Re-read on every session for spec, decisions, prior reasoning.
The bundle carries its own graph (themes, insights, concept relations).

That's the entire integration. Everything below is the per-tool variation of the same three steps.

Pick the right URL

Memory.Wiki exposes three URL shapes. For project-scoped tool config, the bundle URL is almost always the right choice — it carries the canvas analysis with it.

memory.wiki/{docId}single docOne spec, one decision, one note. Tightest token cost.
memory.wiki/b/{bundleId}bundleRecommended for AGENTS.md / .cursor/rules. 3-20+ docs grouped by intent, plus the canvas analysis (themes, insights, concept relations) shipped in the same response.
memory.wiki/hub/{you}whole hubYour entire knowledge graph with concept_index. Use sparingly — broad context costs more tokens.

Append ?compact to trim whitespace, ?full=1 (bundle only) to inline every member doc, ?graph=0 (bundle only) to drop the analysis section.

Privacy & sharing

The raw-markdown endpoint mirrors the viewer's gating exactly. If a person can't see the rendered page, an AI agent can't fetch the markdown either — the three states below apply equally to docs, bundles, and hubs.

PublicPublished, no allowed_emails. Any AI fetches anonymously — no headers required. This is the right setting for an open-source project's bundle that you want every contributor's AI tools to read.
RestrictedPublished, with allowed_emails set. The fetcher must identify itself: either an owner JWT in Authorization: Bearer <token>, or an X-User-Email header that matches one of the allowed addresses. Otherwise 403 / 404.
PrivateNot yet published. Only the owner (via JWT) can fetch. Private items return 404 to everyone else — including AI tools that don't know your auth. Publish the bundle first before referencing it in tool config.

Practical recipes

  • Open-source project: bundle public, paste in AGENTS.md. Every contributor's AI tool fetches anonymously. Zero coordination.
  • Internal / team project: bundle with allowed_emails of teammates. Each teammate's AI tool needs to send X-User-Email — most CLIs let you template request headers via env or rc files. The bundle's rendered viewer also gates on the same list, so non-teammates see 404 in both surfaces.
  • Solo / private notes: hub URL referenced from ~/.claude/CLAUDE.md. Hub-wide visibility is per-item, not per-hub — public docs surface, private docs stay hidden until you publish them.

Invariant: every gating decision happens server-side in the raw-fetch route. There's no way for the URL to leak content the rendered viewer wouldn't already show. Switching gating (e.g. removing an email from allowed_emails) takes effect on the next fetch — AI tools that already cached the markdown locally won't see the revocation until they re-fetch.

AGENTS.md — start here

If you only want to maintain one file, this is the one. AGENTS.md is the open cross-tool convention for “agent instructions at the repo root” — Codex CLI, Claude Code, and Aider all read it. Drop your bundle URL here and most of your agents pick it up immediately, no per-tool config.

AGENTS.md

AGENTS.md (project root)

One file, covered by Codex CLI, Claude Code, Aider, and any future agent that respects the convention. Use the tool-specific files below only for nuances that don't belong at the cross-tool layer.

markdown
# Project agents

## Working context

Bundle: https://memory.wiki/b/<bundle-id>

Fetch this URL when you need this project's spec, decisions, or
cross-doc reasoning. The bundle's pre-computed graph (themes,
insights, concept relations) is in the same response — no separate
index call needed.

Pattern: keep tool-specific overrides in their respective files (.cursor/rules/, GEMINI.md, .windsurfrules) but put the Memory.Wiki URL in AGENTS.md. The URL is the portable bit; per-tool nuance stays per-tool.

Claude Code

Claude Code

CLAUDE.md (project root) — and AGENTS.md

Claude Code auto-loads CLAUDE.md from the project root and every parent directory, plus AGENTS.md when present. Either file works; CLAUDE.md is the right home for Claude-specific overrides.

markdown
## Project context (from Memory.Wiki)

Bundle: https://memory.wiki/b/<bundle-id>

This bundle carries the project's spec, ADRs, and decisions —
plus a pre-computed graph (themes, insights, concept relations).
Re-read it whenever you need cross-doc context.

For user-global memory across all projects, use ~/.claude/CLAUDE.md with your hub URL instead.

Cursor

Cursor

.cursor/rules/memorywiki.mdc

Cursor's newer multi-rule format. Frontmatter scopes when the rule applies; body holds the Memory.Wiki URL. Use one file per bundle for clean separation.

markdown
---
description: Project context from Memory.Wiki
alwaysApply: true
---

Project context lives at https://memory.wiki/b/<bundle-id>.

When you need spec / decisions / prior reasoning, fetch that URL.
The response is clean markdown with the bundle's graph analysis
(themes, insights, gaps, connections) included by default.

Legacy single-file .cursorrules works too — just drop the body content (without the frontmatter) into the root .cursorrules file.

Codex CLI

Codex CLI

AGENTS.md (project root)

OpenAI's Codex CLI is the agent AGENTS.md was originally defined for. If you've already followed the AGENTS.md section above, Codex is already covered — this block is here for completeness.

markdown
# Project Agents Manifest

## Working context

Bundle: https://memory.wiki/b/<bundle-id>

Fetch on demand for spec, decisions, prior reasoning.

Gemini CLI

Gemini CLI

GEMINI.md (project root)

Google's Gemini CLI reads GEMINI.md as its session-instructions file. Same content shape as the others.

markdown
# Gemini context

Project memory lives at https://memory.wiki/b/<bundle-id>.
Fetch on demand for spec, decisions, and cross-doc reasoning.

Windsurf

Windsurf

.windsurfrules (project root)

Windsurf reads .windsurfrules at the project root for its Cascade agent.

markdown
Project context: https://memory.wiki/b/<bundle-id>

When you need this project's spec / decisions / prior reasoning,
fetch that URL. It returns clean markdown with the bundle's graph
analysis included.

Aider

Aider

CONVENTIONS.md (project root)

Aider's terminal-first AI pair programmer reads CONVENTIONS.md as part of the chat context (add it via aider --read CONVENTIONS.md or list it under read: in .aider.conf.yml).

markdown
# Project conventions

External context for this project lives at:
https://memory.wiki/b/<bundle-id>

Fetch that URL when you need spec, decisions, or cross-doc reasoning.

GitHub Action sync — keep one Memory.Wiki doc in step with your repo

Treat one Memory.Wiki doc as your repo's “working knowledge URL”. Every push to main that touches CLAUDE.md, AGENTS.md, or docs/**.md PATCHes the combined markdown to your Memory.Wiki doc. Paste the doc URL into Claude, Cursor, or Codex and they always see the latest state of your repo's docs.

One-time setup (under 5 minutes):

  1. Create the target doc on Memory.Wiki. The URL chip in the editor shows the id (the <id> in memory.wiki/d/<id>) — that's your MDFY_DOC_ID.
  2. On the same doc, open the Share modal (top-right of the editor). Scroll to the Developer access footer and click Copy edit token. That's your MDFY_EDIT_TOKEN. Treat it like a password — anyone with it can write to the doc.
  3. On GitHub: Settings → Secrets and variables → Actions → New repository secret. Add both MDFY_DOC_ID and MDFY_EDIT_TOKEN.
  4. Drop the workflow file below at .github/workflows/sync-memorywiki.yml and push. Run it once via Actions → Sync repo docs → Memory.Wiki → Run workflow to verify.

.github/workflows/sync-memorywiki.yml

yaml
name: Sync repo docs → Memory.Wiki

on:
  push:
    branches: [main]
    paths:
      - 'CLAUDE.md'
      - 'AGENTS.md'
      - 'docs/**.md'
      - '.github/workflows/sync-memorywiki.yml'
  workflow_dispatch: {}

jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Build the combined markdown
        id: build
        run: |
          set -euo pipefail
          OUT="$(mktemp)"
          {
            echo "# Repo working knowledge (synced from ${GITHUB_REPOSITORY}@${GITHUB_SHA:0:7})"
            echo
            echo "> Auto-updated by .github/workflows/sync-memorywiki.yml on push to main."
            echo "> Source: https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}"
            echo
            for f in CLAUDE.md AGENTS.md; do
              if [ -f "$f" ]; then
                echo; echo "---"; echo
                echo "## $f"; echo
                cat "$f"
              fi
            done
            if [ -d docs ]; then
              find docs -maxdepth 2 -name '*.md' -type f | LC_ALL=C sort | while read -r f; do
                echo; echo "---"; echo
                echo "## $f"; echo
                cat "$f"
              done
            fi
          } > "$OUT"
          echo "payload_path=$OUT" >> "$GITHUB_OUTPUT"

      - name: PATCH /api/docs/{id}
        env:
          MDFY_DOC_ID: ${{ secrets.MDFY_DOC_ID }}
          MDFY_EDIT_TOKEN: ${{ secrets.MDFY_EDIT_TOKEN }}
          PAYLOAD_PATH: ${{ steps.build.outputs.payload_path }}
        run: |
          set -euo pipefail
          BODY="$(jq -Rn \
            --rawfile md "$PAYLOAD_PATH" \
            --arg token "$MDFY_EDIT_TOKEN" \
            --arg summary "ci: sync from ${GITHUB_SHA:0:7}" \
            '{markdown: $md, editToken: $token, changeSummary: $summary}')"
          STATUS=$(curl -sS -o /tmp/resp.json -w '%{http_code}' \
            -X PATCH "https://memory.wiki/api/docs/${MDFY_DOC_ID}" \
            -H 'Content-Type: application/json' \
            --data "$BODY")
          echo "HTTP $STATUS"
          cat /tmp/resp.json
          [ "$STATUS" = "200" ]

What you get. One URL like memory.wiki/d/<your-id> that's always your repo's current docs. Paste it into Claude Code, Cursor, or any AI tool — they fetch the latest state on every session. Bonus: it makes a clean “we use our own product” artifact you can link from a README.

Staleness + auto-analyze

Doc content is auto-saved on every edit — the URL response always reflects the latest markdown without any push step. The analysis layer (bundle graph_data, hub concept_index) is computed once and cached.

When a member doc was edited after the last analysis run, the URL response flags it: analysis_stale: true in the frontmatter plus a warning blockquote at the top of the body. Receiving AI tools can weigh the analysis accordingly. The doc bodies themselves are always fresh; only the synthesised layer (themes / insights / concepts) may lag.

Free tier: re-analyze is explicit — open the canvas and click Re-analyze when you're ready. Pro tier (after beta) adds auto-analyze: stale fetches trigger a background regeneration so the next fetch is fresh, hands-free.