Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 1.59 KB

File metadata and controls

58 lines (42 loc) · 1.59 KB

Setup — Codex CLI (OpenAI / GitHub Codex)

Files

Level File Purpose
0 ~/AGENTS.md (global) Global project map — Codex reads it on every session
1 <project-root>/AGENTS.md Per-project context — overrides/extends global on project-specific runs
1.5 <project-root>/graphify-out/GRAPH_REPORT.md Optional — Graphify graph
Hooks <project-root>/.codex/hooks.json Optional — pre-tool hooks

Step-by-step

Level 0 — global AGENTS.md

cp templates/level-0.md.template ~/AGENTS.md
# edit ~/AGENTS.md to add your real projects and servers

Codex looks for AGENTS.md first in the current working directory, then in $HOME. The global one acts as your Level 0.

Level 1 — per-project AGENTS.md

cd ~/projects/your-project-a
cp /path/to/ai-context-hierarchy/templates/level-1.md.template AGENTS.md

When Codex is invoked from inside the project, it merges both files: the local AGENTS.md takes precedence on conflicts.

Level 1.5 — Graphify hook

pip install graphifyy
cd ~/projects/your-project-a
graphify .
graphify codex install        # writes .codex/hooks.json with a BeforeTool hook
                              # that nudges the agent to read GRAPH_REPORT.md
                              # before grep/glob calls

Verify

codex
> List my projects

Codex should answer from ~/AGENTS.md without filesystem search. If it does not, check codex --debug to see whether AGENTS.md was discovered.

Removing

graphify codex uninstall
rm <project>/AGENTS.md
rm ~/AGENTS.md