---
title: "Wiring mdfy into Claude Code"
url: https://mdfy.app/iok3gZo6
updated: 2026-05-14T18:15:49.480Z
source: "mdfy.app"
---
# 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.
