Keeping git as the source
Partly builtYour code stays in git; Codebase mirrors it.
Git stays the real home of this project’s own Clay code. Codebase reads a copy.
The mirror
clay mirror imports your Clay files into a store and writes them back byte for byte. clay mirror check proves that round trip, and is meant to run in your automated checks. The Git mirror view in Projects shows each file as matches git or diverges from git.
Getting a change back out
A change made in the store leaves as a patch: clay mirror patch writes it, and git apply applies it. Codebase shows and copies the same text. Applying is refused against a file that has moved on since.
Working this way today
Edit the Clay files as you always have. Run clay mirror import to refresh your local store. When an agent works on Clay code, give it its own branch in the store; its changes then show up in Projects, you review them there, apply the patch with git, and commit. Nothing about reviewing in Projects replaces git.
What is not built
Codebase does not write to git, and git does not yet read from Codebase. The plan is to make Codebase the source only when all of these hold: the mirror check has been green for a month of normal work, Projects can write with checks and a recorded approval, rules exist for each project’s main version, a fresh clone can rebuild everything from git alone, and you say so. Until then, git is the source.