---
title: "Wiring mdfy into Claude Code"
url: https://memory.wiki/iok3gZo6
updated: 2026-05-14T18:15:49.480Z
hub: https://memory.wiki/hub/demo
bundle_count: 1
concept_count: 12
source: "memory.wiki"
---
# Wiring mdfy into Claude Code

> Tested against Claude Code v1.x. Single command, single line in CLAUDE.md, persistent across sessions.

## What you put in CLAUDE.md

Drop this somewhere near the top of the file (CLAUDE.md is loaded into every Claude Code session as system context):

```
## Context
When you need background on this project, fetch:
  https://mdfy.app/hub/<your-slug>

The hub contains the canonical product spec, the current roadmap,
and the bundles for each major work area (engineering, strategy,
research). Cite by hub-relative URL when answering.
```

That's it. Claude Code reads the URL on session start and treats whatever the hub returns as part of its working context.

## Why this works

- **Claude Code respects CLAUDE.md.** It's not a hint; it's a contract. Anything in CLAUDE.md is in the session's persistent system prompt.
- **mdfy hubs are URL-shaped.** No SDK, no auth, no streaming setup — just a GET that returns markdown plus an inlined graph_data JSON block.
- **Token cost is tunable.** Add `?compact` to the URL to strip low-density sections. Most users save 30-40% of the context window this way.

## What about per-project context?

Per-project goes in the *project's* CLAUDE.md (the one in the project root, not your global `~/.claude/CLAUDE.md`). Use a bundle URL there instead of a hub URL:

```
## Context
When you need project context: https://mdfy.app/b/<bundle-id>
```

The bundle URL gives Claude only the docs in that bundle — much tighter scope than the full hub.

## Things that bite you

1. **The CLAUDE.md update doesn't apply until you restart Claude Code.** The first time I tried this I assumed it was hot-reload. It's not.
2. **If your hub is private, you need to also configure the MCP server to authenticate.** The fully public path is `?` and works without setup; the private path is `?key=...&token=...` and is part of the Pro tier.
3. **The model can ignore the directive if you fill the context with too much other stuff.** Watch for "Claude isn't using my hub" — usually it means the live conversation has crowded out the system prompt.

## What this gives you, end to end

Before: every Claude Code session starts blank, you re-explain the project, you paste the same context block by hand.

After: every session starts with the hub loaded, you skip the re-explanation, and any change you make in mdfy.app shows up in the *next* Claude Code session automatically.


---

## Concepts in this document
- **mdfy** _(entity)_
  A tool that stores project context and decision history, integrated into Cursor via custom rules.
- **bundle URL** _(entity)_
  The delivery mechanism for markdown digests that now carries embedded graph analysis instead of doc list only
- **AI tool integration** _(concept)_
  Ability to paste hub URL directly into Claude, ChatGPT, Cursor, or Codex for question-answering against the hub.
- **Cursor IDE** _(entity)_
  Code editor that can fetch and utilize mdfy bundle URLs for project context.
- **mdfy Platform** _(entity)_
  Knowledge management platform designed for AI-first workflows with URL-based sharing.
- **Claude Code** _(entity)_
  AI coding feature mentioned as a primary context for AI-native developer adoption.
- **Codex CLI** _(entity)_
  Command-line interface that integrates with AGENTS.md to load project context and caches configuration at session start.
- **MCP protocol** _(entity)_
  Existing tool-call protocol that enables function calls across hosts but does not make context portable.
- **mdfy hub** _(entity)_
  The core platform being demonstrated; a personal-knowledge layer tool for organizing and sharing documents.
- **Model Context Protocol** _(concept)_
  Anthropic's open standard enabling AI tools to call external services, the foundational mechanism this document explains.
- **Session Context Management** _(concept)_
  How different tools handle and cache external context across user sessions.
- **mdfy Integration Patterns** _(concept)_
  Core strategy for connecting mdfy bundles to AI development tools through various protocols.

## Concept relations (within this doc's concepts)
- **mdfy Integration Patterns** connects to **mdfy Platform**
- **AI tool integration** encompasses **mdfy Integration Patterns**
- **Cursor IDE** fetches **bundle URL**
- **AI tool integration** advanced via **Model Context Protocol**
- **AI tool integration** queries **mdfy hub**

## Bundles containing this document
- [AI tool integration tour](https://memory.wiki/b/EJbI7cto)
  > Claude Code, Codex (AGENTS.md), MCP server, Cursor — every wiring path the demo hub supports.

_Hub canonical:_ https://memory.wiki/hub/demo
_Concept digest:_ https://memory.wiki/raw/hub/demo?digest=1&compact=1
