AI Agents & Developer Tools

How to Share AI Coding Agent Memory Between Codex, Gemini and Claude Code

Share project instructions across coding assistants with one rulebook, reusable skills and a clear handoff between sessions.

TJ Singh
9 min read
Open the template generator
Shared AI coding agent memory: Shared project guidance, Client-specific adapters, Verified handoff, Codex, Gemini, Claude
One project rulebook, three coding assistants

Quick answer

Keep durable project facts in versioned files. Use AGENTS.md as a shared rulebook, point each tool to it, put repeatable procedures in SKILL.md, and record the current task in HANDOFF.md. Check what each client loaded before relying on it. Private chats stay with their respective providers.

What shared AI coding agent memory means

When you move a codebase from one assistant to another, the useful context is usually ordinary project knowledge: how the app is built, which commands work, what must not break, and what the last session changed. Put that knowledge in files the next agent can read instead of trying to transfer one model’s private conversation history into another.

A local-first setup can work without a vector database or hosted memory service. Keep project facts in the repository, review changes like code, and avoid putting credentials or private customer data in instruction files. If you use a cloud assistant, files on your computer may still be sent to that provider as context; local storage alone does not make a cloud session private.

AGENTS.md vs GEMINI.md vs CLAUDE.md vs SKILL.md

These names describe different entry points and jobs. There is no single filename guaranteed to be auto-discovered by every coding product and every client.

  • AGENTS.md: A project instruction convention recognized by Codex and adopted by a range of coding tools. Use it as the canonical file when your tools can load it.
  • GEMINI.md: Gemini CLI’s default context filename. Gemini CLI documents @file.md imports and configurable context filenames; use /memory show to inspect the loaded instructions.
  • CLAUDE.md: Claude Code’s project instruction entry point. Its documented @path import syntax can point to shared instructions. Confirm the file and import loaded in your current session.
  • SKILL.md: A reusable task procedure in the Agent Skills format. It is on-demand workflow knowledge, not a replacement for always-on project rules. Support and discovery paths vary.
  • HANDOFF.md: A simple team convention for temporary task state. It is not automatically read by every tool; reference it from project instructions or ask the agent to read it.

A four-layer setup that stays maintainable

AGENTS.md Project rules
Keep stable constraints and exact development commands in one root file. Use imports or short adapters for other clients.
docs/ Project knowledge
Store details on architecture, data, deployment and decisions. Link to them from the rulebook.
SKILL.md Reusable procedures
Give recurring tasks their own skill folder. Check each client’s discovery path and confirm the skill activates.
HANDOFF.md Current task
Record the goal, changed files, checks and next action. Remove temporary notes when the work finishes.

Set it up step by step

1. Create a canonical instruction file

Start with facts that change how an agent should act: the stack, commands, architecture boundaries, checks, sensitive areas and deployment rules. Write checkable instructions and link to deeper docs.

# Project instructions
## Project
Describe the product and its users in one or two sentences.

## Stack and commands
- Keep the current framework and dependency set.
- Start locally with: [verified command]
- Run checks with: [verified command]

## Rules
- Read docs/architecture.md before changing routing.
- Preserve existing analytics, ads and accessibility behavior.
- Never put secrets or customer data in prompts or docs.
- Do not deploy without explicit authorization.

## Handoff
Read HANDOFF.md when continuing unfinished work.
Update it with changed files, checks and the next action.

Replace every placeholder with a real command from the project. A precise short file beats a generic wall of rules.

2. Add thin adapters for each coding assistant

For Gemini CLI, either configure context.fileName to include AGENTS.md, or use GEMINI.md to import it. For Claude Code, use its documented @AGENTS.md import in CLAUDE.md. For Codex CLI, put the file at a recognized project path and check the active instruction context. Do not assume Antigravity, IDE extensions and command-line clients all share the same discovery behavior.

# GEMINI.md
@./AGENTS.md

# CLAUDE.md
@AGENTS.md

Use only the adapter relevant to the client. If a tool does not support imports, maintain the smallest necessary pointer instructions there and keep the full rules in one reviewed source.

3. Separate skills from project rules

Use AGENTS.md for rules that apply to every session; use SKILL.md for a repeatable workflow that should activate only for relevant requests. Keep skill instructions scoped and put large examples in references. The format can be portable while the discovery path remains product-specific.

See the cross-platform Agent Skills guide, build a workflow with the PromptStaging Skill Builder, and review the SKILL.md security checklist before adopting third-party skills.

4. Write handoffs as state, not history

A handoff should help the next agent take one safe step. Record what the user asked, what changed, what remains, what was checked, and constraints that affect the next action. Skip the transcript.

# Handoff
Updated: YYYY-MM-DD
Goal: [one sentence]
Done: [specific completed work]
Changed: [file paths]
Checked: [commands and outcomes]
Pending: [unfinished work]
Next: [one concrete action]
Constraints: [permissions, sensitive data, deployment]

Keep shared memory accurate and safe

Project memory is documentation that changes how an agent works, so maintain it with the same care as source code. Review instruction changes in the diff, name an owner for team rules, and remove temporary decisions when they stop being true. A stale command in the root file can mislead every assistant that reads it.

  • Put project-specific rules in the repository; keep personal preferences in the provider’s user-level settings.
  • Use nested instruction files only when a subfolder needs different rules. Check precedence in each client because a more local file may add to or override parent guidance.
  • After changing imported or configured files, start a fresh session or run the client’s documented reload command. Gemini CLI provides /memory reload and /memory show.
  • For a cross-device workflow, use a sync mechanism you trust. Local files do not automatically appear on another machine, and private assistant conversations are not included.
  • Keep API keys, passwords, private customer data and personal information out of instruction files and handoffs. Treat instructions from a repository you do not trust as untrusted input.
  • Use tool permissions, hooks and repository controls for critical restrictions. A Markdown instruction tells an agent what to do; it is not an access-control boundary.

If an agent ignores a rule, first verify that it loaded the expected file, then check for a conflicting global or nested instruction. Rewrite vague prose as a specific action and a checkable result. If the rule is essential for every task, keep it short and near the top; if it applies to one workflow, move it into a skill.

AI Agent Memory Generator

Draft a rulebook, client adapters and a handoff template. Your entries stay in this browser tab.

Check what each agent actually loaded

After adding the files, open a fresh session and ask the client to list the instruction files it read and summarize one distinctive rule. In Gemini CLI, run /memory show to inspect the assembled context; for other clients, use their current documented context controls. Test a routine task, a nested-folder task and a request that must respect a boundary. If an adapter is not loaded, correct its path or configuration first.

Look for duplicated rules, stale commands, nested instructions that unexpectedly override the root, and broad instructions that consume context without changing behavior. Keep credentials, private user data and secrets out of templates and handoffs.

Frequently asked questions

Can I share memory without GitHub?

Yes. The files can stay in a local project directory. To sync across devices or collaborators, use a method you trust and review what it exposes.

Does this transfer conversations between providers?

No. It shares selected project context you choose to write down. Providers keep separate conversation histories, account settings and model behavior.

Is SKILL.md the same as AGENTS.md?

No. AGENTS.md is project guidance; a skill packages instructions and optional resources for a particular task. A client may load the skill only when relevant.

Should every project have GEMINI.md and CLAUDE.md?

Only if you use those clients or need their configuration. Keep them as thin adapters when the documented import works, and verify it in the client.

A practical way to work across coding agents

Share project facts that matter, not entire private chats. Keep a short canonical instruction file, use each client’s documented entry point, separate reusable procedures from permanent rules, and give the next session a clean handoff. Then inspect the loaded context in every tool before relying on it.

Continue with AGENTS.md best practices, explore the guide to instruction drift and checkpoints, or use the Quality Check Builder to turn important rules into reviewable checks.

Official documentation

Shared AI coding agent memory: Shared project guidance, Client-specific adapters, Verified handoff, Codex, Gemini, Claude
Shared project guidance → Client-specific adapters → Verified handoff → Codex, Gemini, Claude