Skip to content
Frame
Back to all posts

Shared Project Context for Claude Code and Codex CLI

How Frame gives Claude Code and Codex CLI a shared source of project instructions, specs and outcomes without maintaining two sets of context.

By FramePublished Updated

The Challenge

Frame's context preservation system is built around .frame/AGENTS.md — a single file containing all project instructions, navigation rules, and conventions. But each AI tool reads context differently:

  • Claude Code loads every .claude/rules/*.md automatically at session start
  • Codex CLI is launched through Frame’s wrapper to read the project instructions in .frame/AGENTS.md

We needed each tool to get the same project context, without maintaining separate instruction files — and without Frame planting anything in the project root.

Solution: A Generated Rule File + Wrapper Scripts

Claude Code — .claude/rules/frame.md

Claude Code loads its rule files natively, so Frame writes one and keeps it in step with the single source of truth:

.frame/AGENTS.md          ← The actual file (single source of truth)
.claude/rules/frame.md    ← Generated copy, rewritten whenever AGENTS.md changes

One file to maintain, and nothing in the project root: an existing CLAUDE.md is the user's, and Frame never touches it.

Codex CLI — Wrapper Script

Frame keeps its instructions in .frame/AGENTS.md and uses a wrapper to direct Codex to that file. This describes Frame’s integration, rather than the full set of instruction mechanisms supported by Codex.

The final solution: a wrapper script in .frame/bin/codex that sends "Read .frame/AGENTS.md" as the initial prompt:

.frame/bin/codex → read .frame/AGENTS.md → consult project files and spec history

When Frame starts Codex CLI, it uses this wrapper instead of the bare codex command. The agent reads the instructions and follows their pointers to relevant project files.

Key Insight

Instead of trying to pass system prompts via flags (which vary per tool), simply ask the AI to read the .frame/AGENTS.md file. This approach is tool-agnostic and works with any AI coding assistant.

Switching Between Tools

In Frame's UI, switching between AI tools is a single click from the toolbar dropdown. Each tool gets proper context injection automatically:

  • Select Claude → runs claude directly (loads .claude/rules/frame.md natively)
  • Select Codex → runs via the .frame/bin/codex wrapper (injects .frame/AGENTS.md)

Same project context, different AI engines. Use whichever tool is best for the task at hand.

One history of the work

The shared context includes the spec workflow: intent in spec.md, approach in plan.md, work in tasks.md, and results in outcome.md. Switching tools should not require rewriting the reasoning behind a feature. See a worked example of specs becoming project context.