All writing
4 min

Your Coding Agent Should Be Replaceable. Your Engineering Context Should not Be.

Why I built Handoff (Agent Trace) in Go. A zero-sudo CLI, agent skill, and local :4044 web dashboard to transfer unfinished AI coding sessions between Antigravity, Claude Code, Kiro, and you with you own editor.


Every developer building with AI coding agents eventually hits the same wall. You are 400 steps deep into a complex feature wiring up database migrations, middleware, and payment splits sometimes which I was doing sometimes back when your free usage limit runs out or even the context gets too big and the models starts to hallucinate then you decide to take over or give that all context to new agent.

Suddenly, you are stuck. The agent's context lives inside an opaque conversation thread. If you switch from Antigravity IDE to Claude Code (or Kiro), or if you open the repository yourself in your terminal, you have to reconstruct everything from scratch:

  • What was the agent's mental model when it touched those 37 files?
  • Which files are uncommitted versus already committed?
  • Which terminal command failed last, and what was the exact exit code and stderr?
  • Which of the 5 agent sessions in this folder was the one working on the ambassador dashboard?
  • That frustration is why I built Handoff (Agent Trace) a provider-independent continuity layer for AI-assisted software engineering, written in Go.

    Loading...
    Handoff Web UI (:4044) showing multi-session workspace switching, unresolved command failures, thought process steps, and one-click editor takeover.
    Handoff Web UI (:4044) showing multi-session workspace switching, unresolved command failures, thought process steps, and one-click editor takeover.

    1. The Core Insight: Don't Transfer Chat Logs — Transfer Engineering State

    When I first sketched out Handoff, the temptation was to just export a raw conversation transcript and feed it to the next model. That fails in practice for two reasons:

  • Transcripts are noisy and unverified: A 2,000 line chat log burns the next agent's context window on dead ends and stale file contents.
  • Summaries without evidence lie: An agent summary might cheerfully claim "Authentication middleware is implemented," while tsc is actually failing with exit code 2.
  • 🧭
    Handoff doesn't try to recover an AI provider's private runtime state, credits, or browser tabs. Instead, it captures observable engineering activity paired with hard evidence.
    Engineering SignalWhat Handoff RecordsWhy It Matters
    Developer IntentChronological sequence of user promptsShows how the objective evolved over the session
    Thought ProcessStep-by-step Thinking blocks + model switches (Claude Sonnet 4.6, Claude Opus, Gemini)Preserves why a specific architecture was chosen
    File & Git EvidenceExact files touched by the agent + live git status and unified git diffDistinguishes agent edits from pre-existing repo changes
    Command & Failure EvidenceExecuted shell commands, exit codes, and stdout/stderr snippetsPinpoints the exact failing build, test, or migration
    Resume VerificationLive check at resume time (e.g. 37/37 files present, branch & HEAD SHA match)Warns if the repo drifted after the checkpoint was saved

    2. How I Built It in Go

    I wanted Handoff to be fast, dependency-light, and work 100% deterministically offline — because when you run out of API credits on Agent A, your handoff tool cannot depend on making another LLM API call just to summarize your session.

    Modular Adapter Architecture (internal/adapter)

    Different coding agents store their local session traces differently, so Handoff defines a clean Adapter interface:

    go· 6 lines
    1type Adapter interface {
    2    Name() string
    3    DiscoverSessions(workspacePath string) ([]model.SessionMeta, error)
    4    CollectEvents(session model.SessionMeta) ([]model.Event, []string, error)
    5    Resume(cp *model.Checkpoint, verificationReport string, opts ResumeOptions) (*ResumeResult, error)
    6}
  • Antigravity IDE Adapter (internal/adapter/antigravity): Queries ~/.gemini/antigravity/conversation_summaries.db (matching workspace_uris) and parses transcript_full.jsonl. Pairs run_command calls with their output blocks to extract exact exit codes, tracks model switches (Claude Sonnet, Claude Opus, Gemini), and extracts step-by-step thinking traces.
  • Claude Code Adapter (internal/adapter/claude): Discovers project transcripts under ~/.claude/projects/<workspace-slug>/*.jsonl, parses Bash, Write, Edit, and MultiEdit tool uses alongside tool_result error flags, and bootstraps claude --append-system-prompt when resuming.
  • We will soon be adding adapters for more AI coding environments soon.

    Two First-Class Destinations: Agent or Human

    Half the time, you aren't handing off to another AI agent — you are handing off to yourself. When I tested the first version of the CLI on a real 417-step session in one of my repositories, dumping the full markdown report to stdout was overwhelming, and I had 5 different agent sessions in that same folder.

    Diagram · System Flow
    Rendering diagram...

    3. How to Install & Use Handoff

    Handoff installs strictly in unprivileged user space (~/.local/bin) — no sudo, no root execution, and no automatic .zshrc mutation.

    Step 1: Zero-Sudo Installation (CLI + Agent Skill)

    bash· 9 lines
    1# One-line user-space installer (downloads binary + installs agent skills)
    2curl -fsSL https://raw.githubusercontent.com/aynaash/handoff/main/install.sh | sh
    3
    4# Or install via Go
    5GOBIN="$HOME/.local/bin" go install github.com/aynaash/handoff@latest
    6handoff skill install
    7
    8# Or install the skill via the Agent Skills CLI
    9npx skills add aynaash/handoff

    Workflow A: Visual Browser Dashboard (:4044)

    When you have multiple sessions across projects (or several sessions inside the same repo) and want a clean visual overview:

    bash
    handoff ui
  • Switch between concurrent sessions in the same working directory (This CWD) or filter to Claude sessions.
  • Inspect the red Attention: Unresolved Command Failure banner with exact exit codes and logs.
  • Step through the agent's Thought Process timeline and expand unified git diff blocks per file.
  • Click Open in Editor (nvim), Copy Claude Resume CLI, or Save .handoff/ Checkpoint.
  • Workflow B: Human Developer Takeover from Terminal

    When an agent stops and you want to take over the code yourself in Neovim or VS Code:

    bash· 8 lines
    1# Compact 20-line takeover card for the current folder
    2handoff takeover
    3
    4# Find and take over your most recent session that used Claude
    5handoff takeover --claude
    6
    7# Open all agent-modified files directly in $EDITOR / nvim
    8handoff takeover --claude --open

    Workflow C: Agent-to-Agent Handoff (Antigravity <-> Claude Code)

    bash· 5 lines
    1# 1. Capture the portable checkpoint (.handoff/latest.md, checkpoint.json, events.json)
    2handoff checkpoint
    3
    4# 2. Verify live git state & resume directly in Claude Code
    5handoff resume --agent claude

    Your coding agent should be replaceable. Your engineering context shouldn't be. — github.com/aynaash/handoff
    —views

    Comments

    Loading...