All articles
developer-toolsai-agentsconfigurationmcp

One Config for 6 AI Agents: How to Stop Duplicating Claude, Codex, and Gemini Configs

Most teams configure each AI agent CLI separately, creating drift and inconsistency. Here's how to use a single ai/ directory as the source of truth for all 6 tools.

7 min read
Single source of truth
ai/source of truthCLAUDE.mdAGENTS.mdopencode.json.mcp.json.gemini/
0dai sync → regenerates all configs from one directory

Every AI coding CLI has its own config format. Claude Code reads .claude/settings.json and CLAUDE.md. Codex reads .codex/config.yaml. OpenCode reads opencode.json. Gemini reads .gemini/settings.json. If you use two or more of these tools, you're probably maintaining multiple config files that say roughly the same thing — and slowly drifting apart.

The Problem: Config Drift

Config drift is subtle. You add a new rule to your CLAUDE.md (no mocking the database in tests) but forget to update the equivalent in AGENTS.md for Codex. Three weeks later, a Codex-generated test file mocks the database and breaks in production. You spend an hour tracking it down.

Multiple tools, multiple formats, zero single source of truth. Config drift is not a question of if — it's a question of when.

Or you configure Claude Code's delegation model but haven't touched the OpenCode config. Your Claude sessions delegate expensive tasks to Opus, but when you hand off to a teammate using OpenCode, they get a generic config with no routing logic.

Warning
Config drift compounds over time. A rule added to one tool's config in January is missing from the others by March. By June, your agent CLIs have meaningfully different understandings of your project's conventions.

The Solution: One ai/ Directory

0dai treats the ai/directory as the canonical source of truth for your project's AI configuration. Every native config file for every tool is generated from it. Change one thing in ai/, run 0dai sync, and every generated config updates.

ai/ — project structure
ai/
manifest/
project.yaml # stack, language, frameworks
discovery.json # auto-detected structure
commands.yaml # custom slash commands
personas/
default.md # shared agent persona
docs/
delegation-policy.md # routing rules
swarm/
queue/ active/ done/

Running 0dai sync against this directory generates:

Getting Started in 2 Minutes

terminal
npm install -g @0dai-dev/cli
added 1 package in 2s
cd your-project
0dai init
✓ Detected: Next.js · TypeScript · PostgreSQL
✓ Generated ai/ directory
✓ Generated CLAUDE.md, AGENTS.md, opencode.json
✓ Generated .mcp.json (shared MCP access)
Done in 8s.

0dai init analyzes your project (detects stack, existing CLIs, folder structure) and generates the entire ai/ layer plus all native configs in one API call. It works for Next.js, FastAPI, Go, Flutter, Rust, monorepos — any stack.

What's in the Generated Config

01

Delegation Policy

Every project gets a ai/docs/delegation-policy.md that defines which model to use for which task class: Fast tier (Mimo v2 Omni, Haiku) for search and exploration; Balanced tier (Sonnet 4.6, Mimo v2 Pro) for implementation and review; Deep tier (Opus 4.6, GPT-5.3-codex) for architecture and security analysis. Fast tasks on fast models, expensive tasks only when they need depth.
02

Shared Persona

All agents get the same persona from ai/personas/default.md— your project's conventions, forbidden patterns, preferred libraries. One edit propagates to Claude Code, Codex, Gemini, and OpenCode simultaneously.
03

MCP Tools

The generated .mcp.jsonincludes 0dai's shared MCP server. Any MCP-compatible agent (Claude Code, OpenCode) can call tools like get_project_health, get_swarm_status, and get_model_ratings without leaving their session.

Keeping Configs in Sync

After 0dai init, run 0dai sync whenever you update files in ai/:

terminal
# After editing ai/personas/default.md
0dai sync
✓ CLAUDE.md updated
✓ AGENTS.md updated
✓ opencode.json updated
→ 3 files changed, 2 unchanged
# Check health
0dai doctor
✓ All configs in sync

0dai sync is idempotent — it only writes files that have changed, and it records what version generated each config so you can always tell whether a native config is current.

Team Workflows

The ai/ directory belongs in version control. Your team commits shared conventions once, and every member gets the same agent behavior regardless of which CLI they prefer.

Native config files (.claude/, .codex/, etc.) can be committed or gitignored — your choice. The ai/ directory is always the canonical source, so even if you gitignore the generated files, any team member can run 0dai sync to regenerate them locally.

Note
For monorepos: each package can have its own ai/ directory, or you can share one at the root and use --target flags to generate package-specific configs. Run 0dai init --help for options.

Check Model Ratings

Once installed, you can also check which models are available on your machine and how they rank:

0dai models
0dai models --available  # only installed CLIs

This shows a ranked table of all supported models with tier, speed, and the exact CLI flag to use — useful when writing delegation policies or debugging which model a swarm task ran on.

Summary

If you use more than one AI coding CLI — or plan to — a shared config layer is the lowest- friction way to keep them consistent. 0dai init generates everything in one shot; 0dai sync keeps it current. The alternative is maintaining five config files by hand and hoping they stay aligned.

Try 0dai

AI agents that know your project

Shared context, session roaming, and multi-agent swarm for Claude Code, Codex, Gemini, Aider, and OpenCode — from a singleai/directory. Install in seconds.

npm install -g @0dai-dev/cli && 0dai init
Back to all articles