AI agents
Sign in

Topics

Backend

Tools & DevOps

All guides

Search

Topics

Practice

AI in development · AI agents

Several Claude threads on one project without conflicts

Author: Volodymyr Pichkurov Published: 4 min read
Git DevOps & deployment

One chat with an AI agent is easy. The trouble starts when a project grows and you open a second thread for the server, a third for store listings, a fourth for marketing. Each thread is smart, but each sees only its own context. Soon two threads edit the same file, one acts on a decision the other reversed yesterday, and a long chat silently forgets the rules from its first hour.

Below is a setup that keeps several threads (Claude, Cursor, Codex — the tool does not matter) on one repository without conflicts. Nothing here needs special software: a few files and a few rules.


1. One thread commits, the others write in their zones

The most important rule: only one thread commits to a repository. Call it the main thread. Every other thread works in its own documents and never touches git there.

Then give each thread a write zone — the folders and files it may change:

Thread May write
main everything, and all commits
server its own repository; here only docs/contracts/ and its state file
marketing docs/marketing/ and its state file

Zones turn "please don't break anything" into a check you can make: a diff outside the zone is a mistake, whoever made it. Write the zones in the project instructions file (CLAUDE.md, AGENTS.md or .cursorrules) so every thread reads them first.

If two threads must write code at the same time, give each a git worktree on its own branch. They merge through pull requests like two developers.


2. Talk through a board, not through memory

Threads cannot message each other, and you are not a reliable courier. Keep a board — one Markdown file with numbered entries:

markdown
## B-042 · server → main · question · open
Does the client send the locale on every request, or only at login?

Each entry has a number, sender, recipient, type (question, request, info) and status. A thread reads the board at the start of every session, answers what is addressed to it and closes what it finished. Decisions that came out of a discussion go to a separate decisions log with a date, so nobody has to dig through the board later.


3. An append-only journal

The board holds conversations; the journal holds facts: "14:20 · server · deployed the new endpoint", "15:05 · main · merged the profile fix". One line per event, one file per month.

The key detail: threads append to it with the shell (echo "…" >> docs/journal/2026-12.md), never with an editor tool. An editor rewrites the whole file from what the agent remembers, so two threads writing at once lose each other's lines. Appending cannot do that.

At the start of a session a thread reads tail -n 30 of the journal and knows what happened since it last worked.


4. Split context into small files

A long CLAUDE.md that holds everything costs tokens in every session and still goes stale. Split it:

  • now.md — a short entry point: current priorities and a map "task → file".
  • One state file per thread — what it is doing now, what is blocked, what is next. The thread keeps only current facts and deletes what is closed; history stays in git and the journal.
  • Topic files — rules that apply now (release process, naming, security).

A thread reads the entry file, its own state file and the journal tail. Everything else it opens on demand.


5. Hand off before the context runs out

Long chats degrade quietly: early rules fade, details from the first hours get mixed up. Set thresholds and act on them:

  • at about two thirds of the context window, warn;
  • close to the limit, write a handoff of no more than 60 lines — goal, state, open questions, next three steps, traps — and start a new chat from it.

Update the thread's state file after every commit, not only at handoff. Then a fresh chat loses almost nothing.


6. Shared resources get owners

Conflicts are not only about files. Two threads running tests on the same emulator, the same local port or the same test database will break each other in confusing ways. Give every shared resource a fixed name and an owner: "the phone emulator always runs on port 5558, one runner at a time". Write it down once, and stop debugging ghosts.


7. Dangerous commands stay with a human

Agents follow instructions literally, including the wrong ones. Keep a short list of commands no thread runs on its own: git push, git reset --hard, deleting files, anything on a production server. The thread prepares the command, explains it, and you run it. This costs seconds and removes the worst failures.


A starter checklist

  1. Write zones and "only the main thread commits" into the instructions file.
  2. Create board.md, decisions.md, journal/ and now.md.
  3. Give each thread a state file and the three reads at session start.
  4. Append to the journal only with >>.
  5. Set handoff thresholds.
  6. Name owners for shared resources.
  7. Keep push, hard reset, deletes and production with yourself.

With this in place you can open a new thread for any side task and know it will not undo the work of the others.

Was this guide helpful?

Read next

// Newsletter

New AI in development guides by e-mail

One e-mail a week with new guides on AI in development. No spam, unsubscribe in one click.

About the author

Volodymyr Pichkurov View portfolio

Spotted a mistake? Suggest an edit

Help us improve this article. Suggest edits, additions, or corrections.

No suggestions submitted yet. Be the first to share your feedback!

On this page