anthropics / anthropics/claude-cookbooks

GNAP: add multi-agent coordination recipe using git as task board

Open
#441 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
52.7k
Forks
6.3k
Avg merge
25m
Merged PRs (30d)
6

Description

## Recipe request: GNAP pattern for multi-Claude-agent coordination

The Claude Cookbook covers a wide range of capabilities — tool use, RAG, multimodal, customer service agents. One gap: **multi-agent coordination patterns** where multiple Claude instances collaborate on shared tasks without a central orchestrator.

[GNAP](https://github.com/farol-team/gnap) (Git-Native Agent Protocol) would make an excellent cookbook recipe. It's a simple, Claude-native pattern: use a git repo as a shared task board. Tasks move through `board/todo/` → `board/doing/` → `board/done/` via file operations that Claude already knows how to do.

**Proposed recipe: multi-claude-gnap-coordination.ipynb**

```python
import anthropic
import subprocess

client = anthropic.Anthropic()

def claude_agent_worker(agent_name: str, repo_path: str):
"""A Claude agent that claims and completes GNAP tasks."""

# Claim a task from board/todo/
tasks = list_tasks(repo_path, "todo")
if not tasks:
return

task = tasks[0]
claim_task(repo_path, task, agent_name) # move todo/ → doing/

# Process with Claude
task_content = read_task(repo_path, "doing", task)
response = client.messages.create(
model="claude-opus-4-5",
max_tokens=1024,
messages=[{"role": "user", "content": f"Complete this task: {task_content}"}]
)

# Commit result to board/done/
complete_task(repo_path, task, response.content[0].text)
```

This recipe would demonstrate:
1. Multi-agent parallelism without a message broker
2. Crash-safe task claiming via git atomic operations
3. Full audit trail via git history
4. Works with any number of Claude instances

Given the cookbook's focus on practical patterns developers can copy, GNAP is a strong fit — zero dependencies beyond git and the Claude SDK.

Spec: https://github.com/farol-team/gnap

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.