Journal ·
How I made Claude Code and Antigravity share one set of instructions
I keep my study notes, a small knowledge base and my portfolio work in one Obsidian vault. It started as a Claude Code setup: one CLAUDE.md file with my rules and a handful of custom commands. Later I added Google Antigravity, Google's agent-based development environment that runs on Gemini models, so I could work on the same folder from both sides. Both agents now read the same folder. Until this week, though, they weren't really reading the same instructions, and I only noticed once the copies had already started to differ.
The problem: the same rules in two places
The vault had grown the way most setups do, one useful addition at a time:
- All rules lived in
CLAUDE.md. For Antigravity,AGENTS.mdjust said "go read CLAUDE.md". - My seven custom skills (study synthesis, video summaries, portfolio case studies and so on) existed twice: once as Claude slash commands in
.claude/commands/, once as Antigravity skills in.agent/skills/, copied over when I added Antigravity. - The copies had already drifted. Small things, like how each one handled arguments, but the direction was clear.
- No folder explained itself. An agent had to open files to work out what a folder was for, and nothing told it what to leave alone.
None of this was broken. But every improvement meant remembering to edit two files, and every new session started with an agent guessing where things lived.
The change: one source, pointers everywhere else
I had just read Interpretable Context Methodology: Folder Structure as Agent Architecture (Van Clief & McDermott, 2026). Its core idea is that for sequential, human-reviewed AI work, folder structure can do the job an orchestration framework would: numbered folders give order, small Markdown files tell the agent what each folder is for, and the agent loads only what the current task needs. The authors also publish a skill, icm-architect, that applies these rules to an existing folder.
I applied the parts that fit a personal vault and skipped the rest:
Before
CLAUDE.md ← all rules
AGENTS.md ← "read CLAUDE.md"
.claude/commands/*.md ← 7 skills
.agent/skills/*/SKILL.md ← the same 7 skills, copied
After
AGENTS.md ← the only source of rules (57 lines, mostly routing)
CLAUDE.md ← @AGENTS.md
GEMINI.md ← @./AGENTS.md (for the Gemini CLI)
.agent/skills/*/SKILL.md ← the only source of each skill
.claude/commands/*.md ← one-line pointers to the skills
02-Osaaminen/CONTEXT.md ← what this folder is for, what not to load
03-Portfolio/CONTEXT.md
…
Each CONTEXT.md is about 15 lines. It states the folder's one job, what's in it and how files are named, which skill writes there, and what an agent should not load. I also added two rules to AGENTS.md: load only what the target folder's CONTEXT.md names, and put new content into a numbered folder, never the root.
What it changes in practice
- One edit reaches both agents. If I change a rule or a skill, Claude Code and Antigravity both pick it up. There's nothing left to drift.
- Less unneeded context. A skill that writes study notes no longer has a reason to read portfolio drafts or unrelated folders. The paper's example workflow drops from roughly 42k tokens of mixed context to 2–8k per step. I haven't measured my own vault yet, but the mechanism is the same.
- New sessions start faster. "Summarize this video into my notes" now resolves through one routing table and one folder file, so I don't have to explain the setup again.
- Fixes stick. The paper's "edit the source, not the output" principle is now a written rule. If I keep correcting the same thing in a skill's output, the fix goes into the skill.
Daily use stayed the same: same commands, same folders, and the same "show me before saving" step.
Try this
- Pick one entry file. Use
AGENTS.mdand make every tool-specific file (CLAUDE.md,GEMINI.md) a one-line pointer to it. - Find your duplicates. Any instruction that exists twice gets one home, and the other copy becomes a link.
- Give each working folder a 10–15 line
CONTEXT.md: its job, its contents, who writes there, and what not to load.
Copy the prompt
Paste this into your own agent. It maps your setup first and changes nothing until you approve the plan.
I use more than one AI agent on the same folder (for example Claude Code and Antigravity, Gemini CLI, Codex or Cursor). Restructure the folder so every agent reads the same instructions from one place.
1. Inventory first and change nothing yet. List every instruction file (CLAUDE.md, AGENTS.md, GEMINI.md, Cursor rules and so on), every custom command or skill, and every instruction that exists in more than one place. Point out where copies already differ.
2. Propose a plan and wait for my approval:
- AGENTS.md becomes the only source of rules. Keep it under about 60 lines: who I am, how to work, and a table of where things live. It routes; it does not hold content.
- Tool-specific files become one-line pointers: CLAUDE.md contains `@AGENTS.md`, GEMINI.md contains `@./AGENTS.md`.
- Each duplicated skill or command keeps one source file, and every other copy becomes a short pointer to it.
- Each working folder gets a CONTEXT.md of 10–15 lines: its one job, what is in it and how files are named, what writes there, and what an agent should not load.
3. After I approve, apply the plan. Back up every file you change, delete nothing, and keep my existing commands working.
4. Finish with a short report: files changed, duplicates removed, and anything you could not verify.Sources
- Van Clief, J., & McDermott, D. (2026). Interpretable Context Methodology: Folder Structure as Agent Architecture. arXiv:2603.16021. https://arxiv.org/abs/2603.16021
- RinDig/icm-architect (MIT): https://github.com/RinDig/icm-architect