Swarm's lightweight handoff pattern is elegant — agents transfer control via simple function returns.
GNAP (Git-Native Agent Protocol) extends this to persistent, cross-runtime coordination.
The gap: Swarm's handoffs are ephemeral — if the process dies, coordination state is lost. GNAP persists task state in git:
# Swarm handoff → GNAP task
def transfer_to_writer():
gnap.create_task(
title="Write article from research",
assigned_to="writer_agent",
input=research_results,
parent_task=current_task_id
)
return writer_agent # still works as normal Swarm handoff
# Writer agent on another machine picks up via git pull
# Full audit trail: who transferred to whom, when, with what input
Why git: Swarm is intentionally minimal — no state, no persistence. GNAP adds persistence without adding infrastructure. Any Swarm agent can participate by cloning a repo.
Cross-runtime bonus: a Swarm agent can hand off to a CrewAI agent, a Claude Code subagent, or any runtime that can read a JSON file. Git is the universal adapter.
Repo: https://github.com/farol-team/gnap
Swarm's lightweight handoff pattern is elegant — agents transfer control via simple function returns.
GNAP (Git-Native Agent Protocol) extends this to persistent, cross-runtime coordination.
The gap: Swarm's handoffs are ephemeral — if the process dies, coordination state is lost. GNAP persists task state in git:
Why git: Swarm is intentionally minimal — no state, no persistence. GNAP adds persistence without adding infrastructure. Any Swarm agent can participate by cloning a repo.
Cross-runtime bonus: a Swarm agent can hand off to a CrewAI agent, a Claude Code subagent, or any runtime that can read a JSON file. Git is the universal adapter.
Repo: https://github.com/farol-team/gnap