← Back to .knowledge

// 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.

Codex entrypoints ADDED TO YOUR REPOSITORY

.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.

Use it for
  • Codex onboarding
  • Repeatable local commands
Do not use it for
  • Agent-specific product claims
  • Skipping source review
Claude Code entrypoints ADDED TO YOUR REPOSITORY

.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.

Use it for
  • Claude handoff
  • Shared source-of-truth rules
Do not use it for
  • Assuming identical model behavior
Integration templates INCLUDED IN THE DOWNLOAD

.knowledge/agent-integrations/

Agent integrations make the shared context portable across tools.

Use it for
  • Installing or refreshing integrations
  • Auditing what each agent reads first
Do not use it for
  • Hiding agent instructions outside the repo
Handoff state OPTIONAL OUTPUT

.knowledge/maintenance/handoff_summary.json

A compact handoff summary gives the next agent a repo-local continuation point.

Use it for
  • Session handoff
  • Finding pending repair work
Do not use it for
  • Treating handoff prose as proof
Codex instructions ADDED TO YOUR REPOSITORY

AGENTS.md

AGENTS.md gives Codex repository-owned starting instructions after installation.

Use it for
  • Codex start instructions
  • Shared .knowledge routing
Do not use it for
  • Replacing agent-specific verification
Claude Code instructions ADDED TO YOUR REPOSITORY

CLAUDE.md

CLAUDE.md gives Claude Code the matching repository-owned starting instructions after installation.

Use it for
  • Claude Code start instructions
  • Shared source-of-truth order
Do not use it for
  • 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
Shared context files and checks

One repo-local layer, multiple agents

01 Current code and tests stay first.
02 Evidence and module summaries guide the next read.
03 Codex, Claude Code, and OpenCode integrations point to the same files.
04 Chat history becomes optional context, not the system of record.

// practical reference

Comparison that matters

The team should compare workflows around a shared repo layer.
AreaTool-specific behaviorShared .knowledge behavior
OnboardingEach agent may have a different command surface.Each agent reads the same routing bundle and trust report.
CodexAGENTS.md + .agents/skills.Shared .knowledge routing, trust, and source-of-truth rules.
Claude CodeCLAUDE.md + .claude/skills.Shared .knowledge routing, trust, and source-of-truth rules.
MemorySession memory can be private to one tool.Repo-local files are reviewable and portable.
HandoffChat summaries can drift.Handoff points to source, evidence, and unresolved follow-up work.
ReviewAgents 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.