// Blog / comparison
Claude Code vs Codex for repo context
The important question is not which agent remembers your repo better. It is whether both agents can read the same repo-owned source of context.
// direct answer
Short answer
Claude Code and Codex use different interfaces, models, and tools. .knowledge gives both the same repository-owned starting instructions, relevant files, and verification history.
Understand how Claude Code, Codex, and other coding agents can share repo context without relying on one chat history.
// the problem
Agent context gets trapped in separate sessions
One agent builds useful repo context in its own session. Another agent starts later and repeats the orientation crawl.
The team then has two partial memories: one in chat history, one in tool state, neither easy to review beside the code.
Switching agents becomes expensive because each tool has to rediscover the same project structure and the same trust warnings.
// shared repository context
Give both agents the same repository instructions
.knowledge makes shared context part of the repository instead of an accident of one agent session.
Codex can read `.agents/skills/*/SKILL.md`; Claude Code can read `.claude/skills/*/SKILL.md`; both point back to the same .knowledge files.
The agent-specific integration changes, but the source-of-truth order stays the same.
// concrete example
A handoff between agents
Codex starts a migration, runs a release check, and leaves the module marked `needs_recheck` because tests were not conclusive.
Claude Code picks up the next task. Instead of trusting the prior chat, it reads the Routing Bundle, confidence report, unresolved follow-up work, and current source.
The handoff is now stored in repo-local files, not in one private conversation.
// files you can inspect
Shared files for Claude Code and Codex
Some repository-specific files appear only after setup or a health check. Run the documented setup workflow to create routing, confidence, freshness, search, metrics, and PR summary outputs.
.agents/skills/*/SKILL.md
Codex-specific workflows can point to the same .knowledge files the rest of the team uses.
These skill folders are added to your repository by install-agent-integrations.js.
- Codex onboarding
- Repeatable local commands
- Agent-specific product claims
- Skipping source review
.claude/skills/*/SKILL.md
Claude Code can consume the same repo-local routing layer with its own skill format.
These skill folders are added to your repository by install-agent-integrations.js.
- Claude handoff
- Shared source-of-truth rules
- Assuming identical model behavior
.knowledge/agent-integrations/
Agent integrations make the shared context portable across tools.
- Installing or refreshing integrations
- Auditing what each agent reads first
- Hiding agent instructions outside the repo
.knowledge/maintenance/handoff_summary.json
A compact handoff summary gives the next agent a repo-local continuation point.
- Session handoff
- Finding pending repair work
- Treating handoff prose as proof
AGENTS.md
AGENTS.md gives Codex repository-owned starting instructions after installation.
- Codex start instructions
- Shared .knowledge routing
- Replacing agent-specific verification
CLAUDE.md
CLAUDE.md gives Claude Code the matching repository-owned starting instructions after installation.
- Claude Code start instructions
- Shared source-of-truth order
- Assuming Claude and Codex behave identically
// commands to try
Commands and expected checks
node .knowledge/tools/install-agent-integrations.js - what it does
- Codex, Claude Code, OpenCode, and command integrations are installed or refreshed.
- where to look
- .agents/skills/ and .claude/skills/
node .knowledge/tools/build-routing-bundle.js - what it does
- The shared routing bundle is rebuilt for all agents.
- where to look
- .knowledge/maintenance/routing_bundle.json
node .knowledge/tools/doctor.js - what it does
- The next agent sees whether the shared layer is usable or needs caution.
- where to look
- .knowledge/maintenance/quality_report.json
One repo-local layer, multiple agents
// practical reference
Comparison that matters
| Area | Tool-specific behavior | Shared .knowledge behavior |
|---|---|---|
| Onboarding | Each agent may have a different command surface. | Each agent reads the same routing bundle and trust report. |
| Codex | AGENTS.md + .agents/skills. | Shared .knowledge routing, trust, and source-of-truth rules. |
| Claude Code | CLAUDE.md + .claude/skills. | Shared .knowledge routing, trust, and source-of-truth rules. |
| Memory | Session memory can be private to one tool. | Repo-local files are reviewable and portable. |
| Handoff | Chat summaries can drift. | Handoff points to source, evidence, and unresolved follow-up work. |
| Review | Agents can produce different plans. | Both plans can be checked against the same source-of-truth order. |
// quick FAQ
FAQ
Should a team pick only one coding agent?
Not necessarily. The safer pattern is to make the repository own the shared context so different agents can be swapped or combined.
Does .knowledge make all agents behave the same?
No. It gives them the same first-read map and trust rules. Model behavior and tool UX still differ.
// next step
Use this page when running more than one coding agent
Install the agent integrations, make .knowledge the first-read layer, and keep source and tests above every generated summary.