Skip to content
المشاريع

حول

Unified coding agent orchestration — CLI, plugin & MCP for async delegation and programmable workflows across Antigravity, Codex, Claude Code, DeepSeek Harness, and Grok.

أدوات التطوير

كيف تُقاس هذه الأرقام

175 نجمة14 التفرعات +15 خلال 24 ساعة

النمو المقاس للنجوم

خلال 24 ساعة
+١٥
خلال 7 أيام
+٩٧
خلال 15 يومًا
التحديث متأخر
خلال شهر
التحديث متأخر

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

COSPAN

Cospan: Cross-Harness Coding Agent CLI, Plugin & MCP

English | Simplified Chinese

Antigravity: plugin Codex: plugin DeepSeek Harness: plugin
Claude Code: plugin Grok Build: plugin
cospan-flow: workflow license: MIT

Unified orchestration across coding agents — call Codex, Claude Code, Antigravity, DeepSeek Harness, and Grok Build from one another. A zero-dependency CLI, native host plugin, and stdio MCP server for background async delegation and programmable cross-harness workflows (cospan-flow).

Cospan orchestration adapter connecting Antigravity, Codex, Claude Code, and DeepSeek Harness

Install · Core CUJs · cospan-flow · How It Works · Compare · FAQ

40s Demo

https://github.com/user-attachments/assets/f51a33fc-486c-479c-95d5-3cf35a1aeab1

Why Cospan

Frontier coding models perform best inside the native harnesses they were co-trained with—so the real unit of orchestration is Model × Harness, and different ecosystems bring distinct strengths: Gemini 4 Carbon (agy) for architecture and planning, GPT-6.2-Sol (codex) for deep bug-hunting review, GPT-6.1-Terra (codex) for live GUI and browser computer use, and Claude (claude) for frontend craft. Combining them unlocks massive leverage; humans can bridge harnesses manually with handoff prompts today, but orchestration belongs to the agents themselves.

Inspired and battle-tested by agy-staff, Cospan turns cross-harness delegation into an async, progressively disclosed protocol behind one unified adapter: your host dispatches peer Model × Harness units in the background, stays unblocked with a clean context window, and pulls live status or full execution traces only when needed. Reach for /cospan-<harness> for ad-hoc dispatches, or codify recurring multi-step loops into reusable, host-agnostic workflows with cospan-flow.

Why Cospan minimalist line-art diagram: moving from manual handoff ("You are the router") to Cospan ("Agents orchestrate peers") across Model × Harness units with async progressive disclosure

Core CUJs

Basic dispatch: one command, zero plumbing

Invoke /cospan-<harness> (or /cospan:<harness> in Claude Code, $cospan:<harness> in Codex) and specify any target model, reasoning effort, or timeout right in your prompt:

/cospan-codex Use sol (high effort, 20m timeout) to review src/webhook/ and flag real edge cases.

[!TIP] Handled automatically under the hood (no need to manage this yourself): Your host agent autonomously frames context (inline text or --prompt-file), launches a detached background session (send), monitors progress non-blockingly (wait / bounded observe, inspecting full trajectory logs only if needed), and collects the result—or resumes the same session (continue) for follow-up turns.

Unified live sidebar (agy & dsh)

Installing on Antigravity (agy) or DeepSeek Harness (dsh) adds the unified Cospan sidebar panel—tracking live background runs across all five harnesses, inspecting Q&A outputs, and aggregating sibling Git worktrees (wt:*) in one view (Install ↓):

Unified Cospan sidebar panel inside Antigravity (agy) and DeepSeek Harness (dsh) tracking Codex, Claude Code, Antigravity worktree, and DeepSeek Harness tasks

Cross-ecosystem workflows

  • Parallel Review Fan out 2× Sol slice reviews from Carbon (Antigravity → 2× Codex) — Split deep code reviews across modules without blocking local tests; staggered async results merge cleanly on wakeup:

    /cospan-codex "Fan out 2 sol reviews across webhook/ and retry/ for real bugs."

    Gemini 4 Carbon uses 2 GPT-6.2-Sol reviewers to audit webhook/ & retry/ in parallel without blocking

  • Second Brain Multi-turn Carbon second brain for Astra (Codex ⇄ Antigravity) — Stress-test migration plans against a second model family and follow up in the same session while staying unblocked locally:

    $cospan:agy "Ask carbon to stress-test docs/plan.md, propose a cleaner route, and verify crash recovery."

    GPT-6.2-Astra consults Gemini 4 Carbon across 2 turns to stress-test docs/plan.md & verify crash safety

  • Computer Use Live browser & GUI testing via Terra (Claude Code → Codex) — Keep code and unit-test orchestration in Claude Sonnet, while GPT-6.1-Terra drives the live browser to catch layout bugs:

    /cospan:codex "Have terra open the local app and walk through the checkout coupon flow."

    Claude Sonnet uses GPT-6.1-Terra to drive the browser GUI, test SAVE20 at 375px, and catch a mobile CTA bug
More workflows (quota offloading & multi-stage research pipeline)
  • Fast Sidecars Offload repo scans & race checks to protect Fable quota (Claude Code → Antigravity + DeepSeek Harness) — Save scarce flagship context and quota by delegating repo surveys and concurrency checks simultaneously:

    "Map auth token refresh with hydrogen and verify 401 race conditions with v4.1-flash."

    Claude Fable offloads auth mapping to Gemini 4 Hydrogen & race checks to DeepSeek V4.1 Flash in parallel

  • Full Pipeline End-to-end research & review pipeline from Carbon (Antigravity ⇄ Codex + ×N Antigravity) — Drive a full plan → gate → bulk experiment → final audit → fix pass loop across Astra, Hydrogen ×N, and Sol:

    "Have astra review my spec, fan out hydrogen across all experiment configs, audit with sol, and send sol's fixes back to hydrogen for one final pass."

    Carbon (host) plans with Astra, fans out Hydrogen ×N, audits via Sol, and passes fixes to Hydrogen

cospan-flow

Unlike vendor-locked workflows tied to a single coding app or proprietary DSL, cospan-flow is an open, cross-harness workflow layer: write a routine once in .cospan/flows/<name>/flow.mjs (or ~/.cospan/flows/, plain .mjs with native .md prompt imports and zero runtime dependencies), trigger it from any host, and compose across any Model × Harness using four primitives mapped to foundational effective agent workflow patterns:

Primitive What it does
agent(spec, opts) Prompt chaining, routing & sectioning — stateless Model × Harness unit (effort, readonly, JSON schema self-repair, { cwd }). .run() returns a resumable Session (.continue(), .touches(), .diff) composed with plain await, if, and Promise.all.
synthesize(prompt, opts) Parallelization (voting) — runs diverse agents independently in parallel (readonly) without anchoring each other, then merges consensus and trade-offs via synthesizer.
orchestrate(prompt, opts) Orchestrator-workers — a central lead dynamically breaks down open-ended tasks at runtime, delegates 0..N parallel subtasks across workers, and returns lead's resumable Session.
refine(session, opts) Evaluator-optimizer — iterative loop where evaluator (agent or JS fn) audits L0 git manifests and feeds rework back into the generator's session via .continue() until pass or P0 blocked.

/cospan-flow "Run dev to fix retry lock bounds (#20)."

Animated cospan-flow demo: launch dev/flow.mjs detached from your coding app across Gemini 4 Neon (high) and GPT-6.2-Sol (high), rendering a proportional swimlane trace and stage bottleneck profile

Your host agent runs the workflow detached out-of-process (or can author a new flow for you), keeps your context window clean, and profiles stage bottlenecks automatically (with optional PR-ready Mermaid traces via trace.upsertIn(prBody)). See .cospan/flows/review/flow.mjs for this repo's live parallel review + simplify flow.

Full example: end-to-end feature workflow composing all 4 primitives (.cospan/flows/ship/flow.mjs)
import { agent, synthesize, orchestrate, refine } from 'cospan/flow';
import specPrompt from './spec.md'; // colocated .md/.txt files import directly as UTF-8 strings

const architect = agent('agy/gemini-4-carbon', { effort: 'high', readonly: true });
const secAuditor = agent('codex/gpt-6.2-sol', { effort: 'high', readonly: true });
const techLead = agent('agy/gemini-4-neon', { effort: 'high' });
const moduleCoder = agent('agy/gemini-4-hydrogen', {
  effort: 'high',
  description: 'Implement scoped module edits and unit tests.',
});

export default async ({ prompt: taskPrompt }) => {
  // 1. Parallelization (voting): unanchored multi-model analysis -> unified plan
  const plan = await synthesize(`${specPrompt}\n\n${taskPrompt}`, {
    agents: [architect, secAuditor],
    synthesizer: architect,
    stage: 'plan',
  });

  // 2. Orchestrator-workers: central lead dynamically delegates to workers -> resumable Session
  let leadSession = await orchestrate(plan.text, {
    lead: techLead,
    workers: { coder: moduleCoder, explorer: architect },
    stage: 'implement',
  });

  // 3. Evaluator-optimizer: iterative audit & rework over compact L0 git manifests
  leadSession = await refine(leadSession, {
    evaluator: secAuditor,
    criteria: 'Follow REVIEW.md. Flag real bugs and race conditions only.',
    maxRounds: 2,
    stage: 'review',
  });
  if (leadSession.blocked) return leadSession; // halt only on true P0 blockers

  // 4. Prompt chaining: resume the same lead session to run gates & summarize
  return await leadSession.continue('Run full test gates and summarize the changes.', {
    stage: 'verify',
  });
};

Install

Requires Node.js >= 20.6 plus whichever coding agent CLIs you want to connect (agy, claude, codex, dsh, grok).

[!TIP] Recommended — For agents: Paste this into any coding agent to let it detect your environment, install Cospan, and verify CLI contracts automatically:

Read the raw text of https://raw.githubusercontent.com/keli-wen/cospan/master/docs/INSTALL_FOR_AGENTS.md
(curl it — do not work from a summary) and follow it to install and verify Cospan for the harness you are running in.
Respond in the user's language.
Manual install (per harness)

Antigravity (agy)

git clone https://github.com/keli-wen/cospan.git ~/.cospan/repo
node ~/.cospan/repo/bin/cospan.mjs install --host agy

Claude Code (claude)

claude plugin marketplace add keli-wen/cospan
claude plugin install cospan@cospan

OpenAI Codex (codex)

codex plugin marketplace add https://github.com/keli-wen/cospan
codex plugin add cospan@cospan

DeepSeek Harness (dsh)

dsh plugin --profile desktop add github:keli-wen/cospan

(Or in the DeepSeek Harness desktop app: Plugins → install from github:keli-wen/cospan.)

Grok Build (grok)

grok plugin marketplace add keli-wen/cospan
grok plugin install cospan@cospan --trust

Restart Claude Code, Codex, or Grok Build afterwards so the plugin loads.

Upgrading & diagnostics
  • Antigravity (agy): git -C ~/.cospan/repo pull --ff-only && node ~/.cospan/repo/bin/cospan.mjs install --host agy
  • Claude Code (claude): claude plugin marketplace update cospan && claude plugin update cospan@cospan
  • OpenAI Codex (codex): codex plugin marketplace upgrade && codex plugin add cospan@cospan
  • DeepSeek Harness (dsh): dsh plugin --profile desktop add 'github:keli-wen/cospan#<tag-or-commit>'
  • Grok Build (grok): grok plugin update cospan

Claude Code and Codex cache plugins by version and require a restart after upgrading. Run node <cospan-repo>/bin/cospan.mjs doctor --check (zero tokens) at any time to verify installed CLI binaries and flag contracts; see docs/INSTALL_FOR_AGENTS.md for cache-refresh and Windows notes.

Harnesses

Harness Ecosystem Invocation Built-in model shortcuts
Antigravity (agy) Google · Gemini & Claude /cospan-* neon, carbon, hydrogen, opus, sonnet
Codex (codex) OpenAI · GPT $cospan:* sol, terra, astra, luna
Claude Code (claude) Anthropic · Claude /cospan:* sonnet, opus, haiku, fable
DeepSeek Harness (dsh) DeepSeek & custom providers /cospan-* v4.1-flash / flash, v4-pro / pro, <provider>/<model>
Grok Build (grok) xAI · Grok /cospan:* build, fast

More harnesses are on the way—Cospan's driver layer is designed to plug in additional coding agent CLIs cleanly.

How It Works

The timeline below follows a background task from dispatch to completion. Your host agent delegates a peer Model × Harness unit via send, waits non-blockingly (wait / batch WaitAll), inspects a bounded <= 8 KiB activity snapshot via observe only when needed, collects the clean report and diff, and can resume the exact same native session via continue:

Cospan async delegation and progressive disclosure lifecycle: host dispatches a peer Model x Harness via send, waits non-blockingly, observes bounded <= 8 KiB snapshots on demand, and resumes via continue

Full peer stream logs live out-of-tree under ~/.cospan/trajectories/ so your repo stays clean. Wait expiry leaves the detached worker running; cancel <id> terminates the job and its descendant process group cleanly.

How Cospan Compares

Approach Representative Tools Core Difference from Cospan
One-way bridge plugins openai/codex-plugin-cc, agy-staff Scoped to calling a single peer from one host (e.g., Claude Code → Codex). Cospan is symmetric across all 5 harnesses, adding batch WaitAll, unified worktree sidebars, and programmable cospan-flow.
Centralized agent workbenches T3 Code, Orca, Multica, AgentsRoom Standalone desktop ADEs or web boards where humans switch sessions in a new UI. Cospan is a decentralized plugin & CLI: stay in your primary client and let your host agent dispatch peers on demand.
API proxies & model routers claude-code-router, 9router, CLIProxyAPI Swap raw model APIs behind one client shell, losing native tool loops and client-only capabilities. Cospan invokes official native headless CLIs locally, preserving full Model × Harness co-training.
Manual Git worktrees & copy-paste handoffs Shell scripts, manual terminal tabs Humans manually copy prompts, watch runs, and relay diffs. Cospan automates non-blocking background runs (send/wait), bounded <= 8 KiB snapshots (observe), and multi-stage cospan-flow pipelines.

For a deeper trade-off breakdown, see Appendix: Comparison with Related Approaches.

FAQ

Can I call OpenAI Codex from Claude Code (and vice versa)?

Yes. Cospan supports bidirectional, peer-to-peer delegation across Antigravity (agy), OpenAI Codex (codex), Claude Code (claude), DeepSeek Harness (dsh), and Grok Build (grok) via native host slash commands (/cospan:codex in Claude Code, $cospan:claude or $cospan:agy in Codex, /cospan-* in Antigravity and DSH) and its stdio MCP server.

How do I orchestrate Claude Code, Codex, and Antigravity together in one workflow?

Use /cospan-<harness> for ad-hoc background dispatches, or save recurring multi-step pipelines in .cospan/flows/<name>/flow.mjs with cospan/flow (agent, synthesize, orchestrate, refine) and trigger them from any host via /cospan-flow.

Does Cospan require a new IDE, API keys, or reverse proxies?

No. Cospan runs locally as a pure ESM Node.js CLI, native plugin, and MCP server on top of the official CLIs you already authenticate (agy, codex, claude, dsh, grok), reusing your existing subscriptions without proxying credentials.

How does Cospan avoid bloating my main context window?

Detached background workers write raw event streams out-of-tree under ~/.cospan/trajectories/. Your host agent stays unblocked, pulls bounded <= 8 KiB observe snapshots only when needed, and receives concise final deliverables—or compact L0 git change manifests during refine() loops.

Roadmap

  • Cross-machine peer delegation over SSH — Fire-and-collect async task handoff across machines (LAN / Tailscale) via short-lived SSH, keeping remote credentials and execution isolated without long-lived connections.

References and License

  • Deep Dive — cospan: Unified Orchestration Across Coding Agents (中文版) · Design rationale behind Model × Harness, async progressive disclosure, real-world multi-harness workflows, and reflections toward cospan-flow.
  • agy-staff — Hire Google's Antigravity CLI (agy) as a fast worker and second brain across Claude Code, Codex, DeepSeek Harness, Pi, and OpenCode. Cospan generalizes the async jobs protocol and progressive disclosure architecture first pioneered and benchmarked in agy-staff (Bench v1 Tech Report).
  • Community — LINUX DO (Where possible begins, a developer & AI community).
  • License — MIT © 2026 Keli Wen · Release notes in docs/releases/ · Architecture & contributor guide in AGENTS.md.

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…