# Task Management for AI Coding Agents That Don't Collide

Published 2026-12-01. https://kanbanmcp.com/blog/task-management-for-ai-coding-agents

# Task Management for AI Coding Agents That Don't Collide

## Key takeaways

- Treat each task as a coordination unit an agent claims, works on, and hands off, not a personal reminder.
- Prevent collisions with one card per task, one git worktree per card, and a claim before any code is written.
- Write cards with a scoped goal, runnable acceptance criteria, branch or worktree name, constraints, and context pointers.
- Keep handoff notes to three lines: what is done, what is left, and any trap hit.
- File-based backlogs work for one or two sequential sessions but break at three or more parallel sessions because they lack a claim mechanism.

Task management for AI coding agents comes down to one mechanic: agents claim a card, do the work in an isolated git worktree, and leave a handoff note for whoever picks it up next. Run that on a shared board and you can keep three or more parallel sessions across Claude Code, Cursor, Codex or Antigravity moving without two agents editing the same code. This guide walks through the full card lifecycle, the collision scenarios that break naive setups, and a minimal setup you can ship on day one.

## What does task management mean when your coworkers are coding agents?

Classic personal task management assumes one worker reading one list. With three or more parallel agent sessions across Claude Code, Cursor and Codex, a task is no longer a reminder to yourself. It is a coordination unit: something one agent claims, works on and hands off, while others avoid it.

### The failure mode: two agents, one file, zero warning

Two sessions that each think a task is theirs will both edit the same file, and git will only tell you at merge time. The fix is claim-before-work plus isolation: one card per task, one worktree per card, so parallel sessions never share a checkout. The [official git worktree docs](https://git-scm.com/docs/git-worktree) support running several checkouts of one repo side by side.

### Why chat history is not a system of record

Chat sessions are working memory, and they are disposable. If the project only exists across agent chats, recovering context a week later means re-reading hundreds of messages. Tasks need one durable home the next agent can read cold, with a handoff note attached. That is the shift the rest of this guide builds on, and it is what a shared board like [KanbanMCP](https://kanbanmcp.com/pricing) is built around.

## What does a task need so any agent can pick it up cold?

A card an agent can act on has five parts: a scoped goal, runnable acceptance criteria, a branch or worktree, constraints, and pointers to context. If a fresh session can't start from the card alone, it isn't a task, it's a reminder.

### Scope one card to one reviewable diff

If the card's finished work spans more than one review sitting, split it. A good test: you should be able to read the git diff in the morning and say yes or no. Cards that touch several lanes of a codebase produce merges nobody wants to review.

### Acceptance criteria the agent can run (tests, not vibes)

"Make it faster" sends an agent wandering. "These three tests pass and the suite stays green" gives it a finish line it can verify itself. Write criteria as commands: `npm test`, a lint pass, a curl against a route. The agent runs them; you don't interpret screenshots.

### What goes in the card vs the CLAUDE.md

The CLAUDE.md holds what's true for every task: conventions, stack, test commands. The card holds only what's true for this one: files in play, constraints, the handoff note from the previous session. Duplicating global rules per card guarantees drift. This card structure is the same one behind the claim/do/note loop on [KanbanMCP](https://kanbanmcp.com/compare/taskmaster), and it's the unit the rest of this workflow assumes.

## How do you stop two agents from editing the same code?

Three or more parallel sessions collide the moment they share a working directory. The fix is a set of rules that make collisions structurally unlikely: claim first, isolate per card, and fence off files.

### One worktree per card, one branch per agent

Every card on the board carries its own worktree and branch, so each agent edits an isolated copy of the repo. This only works if the card states enough context for an agent to start cold, since agents lean on project files like [CLAUDE.md conventions documented for Claude Code](https://docs.anthropic.com/en/docs/claude-code) and similar context files in Cursor and Codex. The card should name the branch, the worktree path, and any files the agent must not touch. A claimed card is locked: the second agent that reads it sees "claimed by session X" and moves on instead of duplicating the work. Tools that speak MCP, including [KanbanMCP](https://kanbanmcp.com/docs/connect), let agents claim and update cards directly from their session.

The long version of the rule: a worktree per card is cheap in git and expensive to skip. When two agents share one checkout, the failure is not a merge conflict you notice later, it is silent overwrites where the last writer wins and the first agent's tests pass against code that no longer exists. Isolation turns that class of bug into an ordinary merge, reviewed as a diff on one branch. Cost is a few megabytes and a `git worktree add` per card.

### Lanes by subsystem or risk level

Group cards into lanes by subsystem, like "payments", "auth", or "docs", and keep at most one claimed card per lane per hour. Risk lanes work too: a "safe" lane for tests and refactors can run three agents, while anything touching migrations runs solo.

### What to do when a collision still happens

Rebase the older branch first, resolve, and leave a note on both cards naming the overlapping files. The next agent reading either card inherits the warning.

## What does a handoff note between agents actually contain?

The claim/do/note cycle is the whole contract: an agent claims a card, does the work, and leaves a note so the next session can pick it up cold. Anything the next agent must know to continue belongs in the note. Anything git already records belongs in the commit message.

### Claim: lock the card before touching code

The agent moves the card to its lane and marks it claimed before writing a line. That lock is what stops a second session from starting the same work in a parallel window. On a shared board like KanbanMCP, the claim is visible to every other session, including one running Codex (https://kanbanmcp.com/agents/codex).

### Do: work, commit, run tests

The agent works in a worktree, commits with a message that says what changed and why, and runs the tests. The commit message carries the diff-level story: files touched, decisions made, failing tests skipped and why. If a reviewer reads only the commit, they should get the change; if they read only the note, they should get the state.

### Note: the three lines the next agent needs

Keep the handoff note to three things: what is done, what is left, and any trap you hit. "Auth refactor committed on branch `card-42`, tests green except `stripe.test.ts`, which fails on main too." That is the whole note. Longer notes become documentation for documentation's sake, and nobody revisits them.

## How do you review parallel agent work without losing the thread?

Review one card at a time, in the same order the board shows them. The board is your index of what changed: each card carries the agent's handoff note, so you read the note, then the diff, then decide. With claim/do/note mechanics, a card only reaches done if you move it there, which keeps a human gate in the loop ([KanbanMCP protocol docs](https://kanbanmcp.com/docs)). If you run agents across tools, the same flow works whether the session was Claude Code or [opencode](https://kanbanmcp.com/agents/opencode).

### Reading the board as a changelog

Skim lanes left to right as if the board were a commit log: done cards are yesterday's merges, in-review cards are open PRs. Each note tells you what the agent tried and what it skipped, so you know where to look in the git diff before you open the editor.

### When to merge, when to discard

Merge when tests pass and the diff matches the note. Discard when the note admits guesswork or the diff touches files the card never mentioned. Cheap cards make discarding cheap.

## Which tools can hold this workflow?

Judge every option against the same four criteria: can any agent claim a card atomically, can it write a handoff note, can it isolate work per card (worktrees), and can you see the board without digging through chat logs.

### Comparison of options against the same criteria

| Option | Claim a card | Handoff note | Worktree isolation | You can see it |
| --- | --- | --- | --- | --- |
| CLAUDE.md / backlog.md files | No, agents race on edits | Yes, plain text | Manual | Yes |
| CLI lists (Task Warrior-style) | Partial, per-machine | Cramped | Manual | Weak |
| Taskmaster | Task list from a spec | Via task details | No | CLI |
| Vibe Kanban | Yes | Yes | Yes | Web board |
| Agent Kanban | Yes | Yes | Varies | Web board |
| Flow (FlowCollab) | Yes | Yes | Varies | Web board |
| KanbanMCP | Yes, claim a card | Note for the next agent | Yes, per card | Same board you steer from |

### Where file-based setups win, where they break at 3+ sessions

Files in the repo win on simplicity: backlog.md diffs with your code, needs no new tool, and any agent that reads files can use it. One reader put it well: a spec plus a kanban board is enough, and anything fancier is documentation nobody rereads. If you run one or two sessions sequentially, stop here.

The break comes at three or more parallel sessions. A markdown file has no claim mechanism, so two agents can pick up the same card, and nothing tells you which session did what. You end up reconstructing the git diff in the morning. A board the agents read and write, with claim and note mechanics built in, removes that race and gives you one place to watch and steer.

## How would this run on a shared board like KanbanMCP?

### The same lifecycle, mapped to board mechanics

Each card is a task with its context baked in: the goal, the branch or worktree name, and the acceptance check. An agent claims a card through MCP, which removes it from the pool so no parallel session picks up the same work. When it finishes, it writes a handoff note on the card — what changed, what passed, what the next agent should check. You watch the lanes move and steer from the same board, dropping comments or new cards mid-run.

The claim/do/note loop is the same shape you would build by hand with backlog.md or a home-made board; KanbanMCP just makes the claim atomic so two sessions in different tools cannot grab one card.

### Honest limits: what the board does not solve

It does not isolate code. Worktree-per-card is still your git setup, and merge conflicts are still yours to catch. It also does not replace your review: the note tells you where to look, but the git diff in the morning is the real record. If you want a hosted UI without the MCP claim mechanics, [Vibe Kanban](https://github.com/BloopAI/vibe-kanban) is the direct alternative to compare.

## What does a minimal setup look like on day one?

Start with three lanes: backlog, in progress, review. That is enough. Every card gets the same template: goal in one sentence, files or directories in scope, how to verify (the test command), and a handoff note field that stays empty until an agent finishes.

Before the first session, create one worktree per card and name it after the card ID. A three-line shell script that takes a card ID, runs `git worktree add`, and prints the path is all you need. Agents claim a card, work in their worktree, leave a note, and move the card to review.

Then build the habit: one git diff pass in the morning across every review-lane card. Fifteen minutes. If a card needs more context than the template holds, it is two cards, not a longer one.

## FAQ

### Can multiple AI coding agents work on the same repo at the same time?

Yes, if each session works in its own git worktree and claims a card before touching code. Three or more parallel sessions across Claude Code, Cursor and Codex can run this way without sharing a checkout. Skip the claim step and two agents will happily edit the same file, with git only surfacing the damage at merge time.

### How do I keep context between agent sessions when a task spans days?

Put it on the card, not in chat. Chat history is disposable working memory; a week later you would be re-reading hundreds of messages. A handoff note with three lines, what is done, what is left, and any trap hit, lets the next session start cold without archaeology.

### Is a kanban board overkill for a solo dev running agents?

Not if you run three or more parallel sessions, because the claim mechanic is what prevents duplicate work. If you run one or two sessions sequentially, a markdown backlog in the repo is enough. The board earns its keep the moment agents need to coordinate rather than just take orders.

### Should tasks live in the repo as files or on a separate board?

Files win on simplicity and diff alongside your code, but they have no claim mechanism, so two agents can grab the same card with no warning. At three or more parallel sessions that race becomes the failure mode. A board the agents read and write makes the claim atomic and gives you one place to steer.

### How do I stop my agents from overwriting each other's changes?

Make collisions structurally unlikely: one card per task, one worktree per card, and a claim before any code is written. A claimed card reads as locked to every other session. If a collision still happens, rebase the older branch, resolve, and note the overlapping files on both cards so the next agent inherits the warning.
