---
title: "Wiring mdfy into Codex via AGENTS.md"
url: https://mdfy.app/y4sEEo1R
updated: 2026-05-14T18:15:49.480Z
source: "mdfy.app"
---
# Wiring mdfy into Codex via AGENTS.md

> Codex CLI + AGENTS.md. Same shape as the Claude Code recipe but with caveats specific to Codex's caching.

## What you put in AGENTS.md

Drop this near the top:

```
## Context
Load https://mdfy.app/hub/<your-slug> before answering project
questions. The hub contains the spec, the roadmap, and the bundles
for engineering, strategy, and research.

For per-project context, see the bundle URL in this file's section
"## Project bundle" below.
```

If you have a per-project bundle, add a second block:

```
## Project bundle
https://mdfy.app/b/<bundle-id>?compact
```

The `?compact` strips out long appendices and saves ~30% of the context window.

## Why two scopes (hub + bundle)

The hub gives the AI breadth: who you are, what you're building, what your prior work shows. The bundle gives it depth: the specific docs related to the current project. Both load; the model picks the right level depending on the question.

## What's different from Claude Code

Codex caches AGENTS.md at the start of a session. **If you edit AGENTS.md mid-session, Codex doesn't see the change** until the next session. This caught me twice on launch-prep day — I'd update the hub URL in AGENTS.md, expect Codex to pick it up, and Codex would keep loading the stale URL.

Workaround: when iterating on the AGENTS.md content, kill the Codex session and restart.

## Things to watch for

- **The `?compact` flag is doc-respectful but not bundle-respectful.** It compacts each member doc; it doesn't drop docs. If the bundle has 30 members, `?compact` still loads all 30.
- **For the smallest possible context, use `?full=0&graph=1`** — that returns only the bundle's analysis (themes, insights, summaries) without inlining any member docs.
- **Codex doesn't currently support MCP.** So the hub-load is GET-only over plain HTTP. Fine for public hubs; private hubs need the editToken in the URL (see /docs/integrate for the exact format).

## What this gives you

The AGENTS.md-tagged Codex sessions become "context-aware by default". You stop re-pasting the same explanations every time you open Codex. You stop asking "wait, do you know about X?" — Codex knows about X because X is in the hub.
