---
title: "Wiring mdfy into Codex via AGENTS.md"
url: https://memory.wiki/y4sEEo1R
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 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.


---

## Concepts in this document
- **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.
- **Context Injection** _(tag)_
  Techniques for providing AI tools with relevant background information.
- **Cursor Editor** _(entity)_
  Primary AI code editor with sophisticated context management and URL fetching capabilities.

## Concept relations (within this doc's concepts)
- **mdfy Integration Patterns** connects to **mdfy Platform**
- **AI tool integration** encompasses **mdfy Integration Patterns**
- **Cursor Editor** exemplifies **AI tool integration**
- **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
