Share project configuration between Claude Code and Gemini CLI. One source of truth, both tools read it.
Claude Code reads CLAUDE.md. Gemini CLI reads GEMINI.md. If you use both, you maintain two files with the same content.
AGENT.md ← write once (source of truth)
CLAUDE.md → AGENT.md ← symlink (Claude Code reads this)
GEMINI.md → AGENT.md ← symlink (Gemini CLI reads this)
Same pattern for MCP servers — one YAML, generates both formats.
git clone https://github.com/petrogurcak/dual-cli.git
cd dual-cli
./setup.sh /path/to/your/projectcd your-project
mv CLAUDE.md AGENT.md
ln -s AGENT.md CLAUDE.md
ln -s AGENT.md GEMINI.mdThat's it. Both tools now read the same instructions.
Both Claude Code and Gemini CLI support MCP servers but store config differently:
| Tool | Config file | Location |
|---|---|---|
| Claude Code | .mcp.json |
project root |
| Gemini CLI | .gemini/settings.json |
project root |
The format is actually identical (mcpServers JSON), just different file paths. sync-mcp.sh generates both from one source:
# 1. Define servers once
vim mcp-servers.yaml
# 2. Generate both configs
./sync-mcp.sh
# → .mcp.json (Claude Code)
# → .gemini/settings.json (Gemini CLI)servers:
fetch:
command: npx
args:
- -y
- "@modelcontextprotocol/server-fetch"
filesystem:
command: npx
args:
- -y
- "@modelcontextprotocol/server-filesystem"
- "/path/to/project"Both tools support skills via SKILL.md files with the same format:
---
name: my-skill
description: Use when...
---
# My Skill
Instructions...Claude Code: Install through /plugins marketplace or plugin cache.
Gemini CLI: Link directly:
gemini skills link /path/to/skills/directoryIf your skills live in one directory, Gemini CLI can symlink them all at once.
Global configs can't be symlinked (different paths, different filenames):
| Tool | Global config |
|---|---|
| Claude Code | ~/.claude/CLAUDE.md |
| Gemini CLI | ~/.gemini/GEMINI.md |
Keep them manually in sync, or maintain a shared source and copy on change. The universal parts (identity, rules, personality) are the same — only tool-specific paths differ.
dual-cli/
├── README.md # this file
├── AGENT.md # example shared instructions
├── CLAUDE.md # → AGENT.md (symlink)
├── GEMINI.md # → AGENT.md (symlink)
├── mcp-servers.yaml # MCP server definitions (source of truth)
├── sync-mcp.sh # generates .mcp.json + .gemini/settings.json
├── setup.sh # add dual-CLI to existing projects
└── .gitignore # ignores generated configs
- Claude Code (any version)
- Gemini CLI v0.29+ (
npm install -g @google/gemini-cli) - Python 3 (for sync-mcp.sh)
MIT