What goes wrong
An agent edits a file in three steps: it reads the file, works out the change, and saves the new version. That takes seconds to minutes.
If Claude Code and Codex both work on the same file in that window, the second save can replace the first one's changes. Or one agent keeps building on a version of the file that no longer exists.
The fix is always the same idea: make sure two agents never change the same file at the same time. There are four ways to do that.
1Give them separate files or separate tasks
The simplest way. Give each agent its own part of the project: Claude Code works on the website pages, Codex on the server code. Or one writes the feature while the other only reviews and reports back without editing.
Fits when
The work splits cleanly by folder or by job.
Breaks when
Both tasks need the same shared file, like a settings file or a main page.
2Separate git worktrees, merged afterwards
Git is the tool most projects use to track changes. A worktree is a second copy of your project folder on its own branch (a separate line of changes). Each agent edits its own copy, so their edits can't collide. When both are done, you merge the branches back together.
How each tool does it, per their own docs
- Claude Code:
claude --worktree feature-auth(or-w) starts a session in a new worktree under.claude/worktrees/, on a new branch namedworktree-feature-auth. - Codex desktop app: choose Worktree when you start a new chat, and pick the branch to start from.
- Codex CLI: its command reference lists no worktree option. Make one with git, then start Codex in that folder:
git worktree add ../project-feature-a -b feature-a
codex --cd ../project-feature-aCleaning up: git worktree list shows them, git worktree remove deletes one when you're done.
Fits when
Both agents need to touch the same files, or the tasks are big.
Costs you
A merge at the end. If both changed the same lines, git reports a conflict and someone has to choose. Worktrees also need git, and at least one commit so each copy starts with your files.
3Take turns
Run one agent at a time. Claude Code builds, then Codex reviews or fixes, then back again. Nothing can collide because only one agent is editing.
Fits when
The second agent's job depends on the first one's result, like a review.
Costs you
Speed: one agent always waits. And you have to remember to start the next one.
4File locks: how Technically Not does it
Technically Not runs Claude Code, Codex and other agent CLIs side by side in terminal panels on the same project. Its file locks let one agent edit a file at a time, so they can share the folder:
Claude Code takes the lock by itself
When it's about to edit a file another agent holds, the edit is refused, with the holder's name and what to do instead:
tnai sendthe holder to split the work, or do something else and try later.Other CLIs lock files themselves
Codex and the others have no check before an edit, so Technically Not instructs them to run
tnai lock FILEfirst. That works when the agent follows the instruction.The holder hears about it
It gets a short message saying who wanted its file, so the two can agree who does what.
Locks end by themselves
On
tnai unlock, when the holder's terminal panel stops or closes, or 20 minutes after its last edit of that file.tnai locksshows who holds what.
Which one to pick
| Your situation | Use |
|---|---|
| Small, clearly split jobs | Separate files |
| Big jobs, or both need the same files | Worktrees |
| One job builds on the other | Take turns |
| Both in one folder, clash stopped as it happens | File locks |
What it costs
Separate files, worktrees and taking turns are free.
Questions
What happens if Claude Code and Codex edit the same file at once?
Each agent reads the file, changes it and saves it. If the other agent saved a change in between, the second save can replace it, or one agent keeps working from a version of the file that no longer exists. Nothing warns you; you find out later when something is missing or broken.
Do Claude Code and Codex support git worktrees?
Claude Code does: claude --worktree NAME starts a session in its own worktree on a new branch. Codex's desktop app has a Worktree option when you start a new chat. For the Codex CLI, create the worktree with git worktree add and start Codex in that folder, for example with codex --cd PATH.
Does Technically Not stop Codex from overwriting Claude Code's files?
Partly. Claude Code's edits of a file another agent holds are refused automatically. Codex and the other CLIs have no hook before an edit, so the app instructs them to run tnai lock before editing; that works when the agent follows the instruction. Edits made through shell commands are not seen. For full separation, use Own worktree.
Do I need git for any of this?
Separate files, taking turns and Technically Not's file locks work without git. Worktrees need a git repository with at least one commit, because each worktree starts from a commit; without one it starts empty.
Is there a free plan or trial?
No. Pro is $15/month or $144/year, and the Founder price is $99/year until December 25, 2026. You can try the real interface in the browser before you buy.

