A2A SSH Skill — Agent2Agent delegation over SSH. No HTTP server. No Agent Cards. Just SSH. Works with Claude Code, Codex, and any CLI AI.
a2a-ssh-skill is an early-stage Python project in the AI payments / x402 ecosystem, focused on a2a, a2a-protocol, agent-to-agent, agent2agent. It currently has 0 GitHub stars and 0 forks, and sits alongside related tools like capiscio-python, capiscio-sdk-python, fastapi-a2a, capiscio-python, a2a-demos, tap.
Agent-to-Agent delegation over SSH.
Zero dependencies. Works today.
Inspired by Google Agent2Agent (A2A) Protocol · Built for builders who need it working today
💬 Tired of 100+ MCP tools burning tokens just to talk across machines?
Google A2A wants you to build an HTTP server. We just need your SSH key. 🔑
💰 ~90% Less TokensNo framework context. No MCP overhead. |
⚡ 5 Min SetupClone → edit JSON → send task. |
🔒 Zero Attack SurfaceNo HTTP endpoints exposed. |
A2A SSH Skill is a practical, zero-dependency Python tool for Agent2Agent (A2A)-style delegation over SSH.
Google A2A defines a protocol for how agents should talk (JSON-RPC, HTTP endpoints, Agent Cards). A2A SSH Skill makes agents actually work across your machines right now — using nothing but SSH, Python, and a CLI AI tool like Claude Code or Codex.
Others are writing protocol specifications — your agents are already getting work done.
Others are deploying Agent Cards and webhook endpoints — your agents already finished the task.
Others spent a week on interoperability — you spent 5 minutes editingagents.json.
A2A SSH Skill and Google A2A are complementary, not competing:
| 🔀 A2A SSH Skill | 🌐 Google A2A Protocol | |
|---|---|---|
| What it is | Ready-to-use delegation tool | Interoperability protocol spec |
| Setup time | ⚡ 5 minutes | Hours to days |
| Dependencies | Python stdlib + SSH | HTTP server + JSON-RPC + SDK |
| Infrastructure | Your existing SSH keys | Agent Cards + HTTP endpoints + webhooks |
| Transport | SSH (encrypted by default) | HTTP/HTTPS |
| Discovery | agents.json | Agent Card metadata |
| Cross-machine | ✅ Native design goal | Possible, you build the infra |
| Task artifacts | ✅ Built-in files | Not provided |
| Failure recovery | ✅ Timeout, recursion guard, zombie cleanup | Up to implementer |
| Token efficiency | ✅ Prompt-only, ~90% less | Depends on impl |
| Explainability | ✅ Full log.md trace | Depends on impl |
| Best for | Getting work done today | Cross-vendor ecosystem interop |
TL;DR — Need your machines working as an AI team? A2A SSH Skill, 5 minutes. Need a public agent marketplace? Use Google A2A.
┌───────────────────────────────────────────────────────────────┐
│ │
│ $ python agent.py send gpu-server \ │
│ --cwd "/home/user/ml-project" \ │
│ --text "Run the failing tests and fix them" \ │
│ --mode write --wait │
│ │
│ ── Behind the scenes ────────────────────────────────────── │
│ │
│ 1. Creates job dir → prompt.md + meta.json + runner.py │
│ 2. Uploads to gpu-server via SCP │
│ 3. Launches runner.py via SSH │
│ 4. Remote AI reads code, runs tests, fixes bugs │
│ 5. Writes reply.md + log.md │
│ 6. Results fetched back │
│ │
│ ✅ [OK] │
│ Fixed 3 failing tests in src/utils.py: │
│ - test_parse_config: added missing default value │
│ - test_validate_input: boundary check was off by one │
│ - test_export_data: file path used wrong separator │
│ │
└───────────────────────────────────────────────────────────────┘
Prerequisites: Python 3.10+ · SSH access · A CLI AI tool on remote machine
# 1. Clone (no pip install needed!)
git clone https://github.com/YonganZhang/a2a-ssh-skill && cd a2a-ssh-skill
# 2. Configure
cp agents.example.json agents.json # Edit: SSH hosts, claude_path, python_path
# 3. Send your first task
python agent.py send my-server \
--cwd "/home/user" \
--text "Check Python version and disk usage" \
--mode read --wait
As a Claude Code Skill — copy to ~/.claude/skills/ and Claude auto-discovers it:
cp -r a2a-ssh-skill ~/.claude/skills/agent-task-delegate
| Scenario | Example Prompt | |
|---|---|---|
| 🧪 | Remote testing | "Run the test suite on the server and fix any failures" |
| 🔧 | Remote debugging | "Check why the API returns 500 errors" |
| 🤖 | GPU offloading | "Train this model on the GPU server, report metrics" |
| 📊 | Cross-machine inspection | "Compare configs between staging and production" |
| 🏗️ | Multi-node deployment | "Update the service on server A, verify from server B" |
| 🐛 | Log analysis | "Search nginx logs for timeout errors" |
| 📦 | Build delegation | "Compile on the Linux box, it's faster there" |
| 🔍 | Security audit | "Check open ports and running services" |
| Feature | Description | |
|---|---|---|
| 🪶 | Zero Dependencies | Python stdlib only. No pip install. Just copy and run. |
| 🖥️ | Cross-Platform | Windows · Linux · WSL · macOS. One unified Python runner. |
| ⚡ | Fast Path | Read-only Linux tasks stream via SSH stdout — zero runner overhead. |
| 🛡️ | Battle-Tested | Recursion guard · timeout cap · process-group kill · atomic writes. |
| 📄 | Observable | prompt.md · reply.md · log.md — human-readable, grep-able, diff-able. |
| 🔀 | Flexible Routing | Direct SSH · relay (A→B→C) · shared filesystem. |
| 🤖 | AI-Agnostic | Claude Code, Codex, Aider — any CLI AI with -p flag. |
| 🔒 | Anti-Loop | AGENT_DELEGATE_DEPTH blocks infinite delegation loops. |
| 💰 | Token Efficient | Prompt-only transmission. No context, no history, no overhead. |
┌───────────────┐ ┌───────────────┐
│ Node A │ SSH │ Node B │
│ (Dispatcher) │ │ (Executor) │
│ │ 1. Upload job (SCP) │ │
│ agent.py │ ─────────────────────► │ runner.py │
│ │ │ │
│ Creates: │ 2. Launch runner (SSH) │ Invokes: │
│ · prompt.md │ ─────────────────────► │ AI CLI tool │
│ · meta.json │ │ via stdin │
│ · runner.py │ 3. Fetch results (SCP) │ │
│ │ ◄───────────────────── │ Produces: │
│ Receives: │ │ · reply.md │
│ · reply.md │ │ · log.md │
│ · log.md │ │ · output/ │
└───────────────┘ └───────────────┘
| Target | Mode | Wait | Path | Speed |
|---|---|---|---|---|
| Linux | read | yes | Direct SSH stdout | ⚡ Fastest |
| Linux | read | no | Python runner | Fast |
| Linux | write | * | Python runner | Fast |
| Windows | * | * | Python runner | Fast |
A2A SSH Skill works with any number of nodes in any topology:
Two-Node Three-Node (Relay) Fan-Out
┌─► 🖥️ Server A
💻 ── SSH ──► 🖥️ 💻 ── SSH ──► 🖥️ ── WSL ──► 🐧 💻 ──┼─► 🖥️ Server B
└─► 🐧 GPU Box
Add nodes by editing agents.json. Each node auto-detects its identity. Any node can be sender, receiver, or both.
Every delegation creates a self-contained job directory:
jobs/<job-id>/
├── prompt.md 📝 Task instructions
├── meta.json ⚙️ Metadata (target, mode, timeout)
├── runner.py 🏃 Bundled executor
├── reply.md ✅ Result: [OK] or [FAILED]
├── log.md 📋 Execution trace
├── input/ 📁 Input files (optional)
└── output/ 📁 Generated artifacts (optional)
Everything is plain text. Debug with cat. Monitor with watch. Archive with tar. Search with grep.
You type a command
└─► agent.py detects your node, creates job dir
└─► SCP uploads to remote machine
└─► SSH launches runner.py
└─► runner.py pipes prompt to AI via stdin
└─► AI executes task, writes reply.md + log.md
└─► agent.py fetches results via SCP
└─► You see the result
| Mechanism | Prevents |
|---|---|
AGENT_DELEGATE_DEPTH |
Infinite A→B→A loops (token drain) |
MAX_TIMEOUT_SEC = 1800 |
Runaway processes |
os.setsid + os.killpg |
Zombie processes on SSH disconnect |
| Atomic file writes | Reading half-written results |
| Preflight checks | Launching on bad remote state |
| D-state monitoring | Stalled WSL instances |
| Waste Source | Traditional | A2A SSH Skill |
|---|---|---|
| Framework context injection | ~2000-5000 tokens/call | 0 (no framework) |
| MCP tool definitions | ~3000-8000 tokens | 0 (native tools on remote) |
| False retries | Re-sends entire context | Stderr-only matching |
| Delegation loops | Infinite token burn | Blocked at first recursion |
| Discovery handshakes | Agent Cards exchange | 0 (local agents.json) |
Concrete example — checking disk usage on a remote server:
| Approach | Tokens Used |
|---|---|
| MCP tools (tool schemas + prompt) | ~5,500 |
| A2A SSH Skill (prompt only) | ~500 |
| Savings | ~90% |
| ✅ | Test 1: Linux Read + Wait | Direct SSH stdout path — the fastest, most common operation. Verifies response streams correctly without runner overhead. |
| ✅ | Test 2: Linux Write + Wait | Full runner pipeline — SCP upload, remote launch, Claude execution with write permissions, reply.md creation, result fetch. |
| ✅ | Test 3: Timeout Cap | Passes --timeout-sec 99999, verifies it's silently clamped to 1800s. Prevents runaway processes consuming tokens for hours. |
| ✅ | Test 4: Windows Read + Wait | Cross-platform — Python runner on Windows via stdin pipe. Proves the unified runner handles Windows process management correctly. |
| ✅ | Test 5: Recursion Blocked | Asks delegated agent to re-delegate. It refuses — preventing A→B→A infinite loops that would burn tokens endlessly. |
| ✅ | Test 6: No False Retry | Output containing "overloaded" doesn't trigger retry. Only stderr errors do. Prevents wasting tokens on spurious retries. |
Test environment: Windows laptop ↔ Windows Server ↔ Ubuntu Linux — but A2A SSH Skill supports any OS combination over SSH.
# Run tests yourself
./tests/e2e-test.sh my-server
{
"agents": {
"my-laptop": {
"hostname_patterns": ["MY-LAPTOP-*"],
"platform": "windows",
"claude_path": "claude",
"python_path": "python",
"job_root": "C:/Users/me/exchange/jobs",
"ssh_from": { "gpu-server": "laptop-ssh" }
},
"gpu-server": {
"hostname_patterns": ["GPU-*"],
"platform": "linux",
"claude_path": "/usr/local/bin/claude",
"python_path": "python3",
"job_root": "/home/user/exchange/jobs",
"ssh_from": { "my-laptop": "gpu-ssh" }
}
}
}
| Field | Required | Description |
|---|---|---|
hostname_patterns |
Yes | Glob patterns for auto-detection (socket.gethostname()) |
platform |
Yes | "windows" or "linux" |
claude_path |
Yes | Path to AI CLI executable |
python_path |
Yes | Python interpreter for runner |
job_root |
Yes | Job directory location |
ssh_from |
Yes | {source: ssh_alias} map. null = same machine |
exchange_root |
No | Exchange filesystem root |
relay_via |
No | Fallback relay node |
wsl_distro |
No | WSL distribution name |
capabilities |
No | Node capability tags |
See agents.example.json for a commented template · examples/ for ready-to-use setups.
# Delegate a task
python agent.py send <target> --cwd <path> --text "task" --mode read|write [--wait] [--timeout-sec N]
# Check status
python agent.py status <job-id> [--detail]
# Clean up old jobs
python agent.py cleanup [--days 7]
| Status | Feature |
|---|---|
| 📦 | Standalone CLI — pip install a2a-ssh-skill |
| 🤖 | More AI adapters — Codex, Gemini CLI, Aider, Ollama |
| 📊 | Web dashboard — real-time job monitoring |
| 🌐 | A2A bridge — optional Google A2A compatibility |
| 🔄 | Job chaining — multi-step workflows (A→B→C) |
| 📱 | Notifications — Slack/Telegram on completion |
| Principle | How | |
|---|---|---|
| 💰 | Low token consumption | Prompt-only transmission — no context, no history |
| 🎯 | High accuracy | File-based results (reply.md), not chat-style output |
| 🔍 | Full explainability | Complete log.md with timestamps and exit codes |
| 🪶 | Zero bloat | No dependencies today. No dependencies tomorrow. |
-p flag works: Claude Code, Codex, Aider, etc. Set claude_path in config to your tool's binary.
agents.json. Supports direct SSH, relay routing (A→B→C), shared filesystem, and any mix of Windows/Linux/macOS.
--dangerously-skip-permissions flag enables non-interactive AI execution, which is architecturally required for headless operation.
Contributions welcome! Bug reports, feature requests, docs, code — all appreciated.
MIT — use it however you want.
🚀 Access and manage the CapiscIO CLI easily with this Python wrapper, ensuring optimal performance across your system and architecture.
Runtime security middleware for A2A (Agent-to-Agent) protocol agents. Provides always-on validation, signature verification, and rate limiting for AI agent interactions.
A zero-friction FastAPI plugin that turns any existing app into a fully compliant Agent-to-Agent (A2A) node — expose your routes as discoverable skills and delegate tasks to remote agents with a single decorator.
The official CapiscIO CLI tool for validating A2A agents. A lightweight Python wrapper that automatically manages the capiscio-core binary.
Demo agents showcasing CapiscIO Agent Guard and MCP Guard — trust badges, identity verification, and tool-level authorization for A2A and MCP protocols
Cross-vendor agent-to-agent protocol — Claude, Codex, and Gemini communicate via file-based P2P messaging.
The agent-native LLM router for autonomous agents. 55+ models (8 free), <1ms local routing, USDC payments on Base & Solana via x402.
The living ecosystem where AI agents complete tasks through workflow loops, improve through iterative execution, are evaluated by mentor agents or humans in the loop, and turn completed work into reusable work experience and data to improve future agents.
The living ecosystem where AI agents complete tasks through workflow loops, improve through iterative execution, are evaluated by mentor agents or humans in the loop, and turn completed work into reusable work experience and data to improve future agents.
The trust layer for agent-to-agent commerce — natural-language mandates, ERC-7710 delegated permissions, x402 payments, escrow, and dispute resolution as one open, catch-all Agent Skill / Claude Code plugin.
Open Source AI trading agent that operates autonomously across 1000+ markets - Polymarket, Kalshi, Binance, Hyperliquid, Solana DEXs, 5 EVM chains. Scans for edge, executes instantly, manages risk while you sleep. Agent commerce protocol for machine-to-machine payments. Self-hosted. Built on Claude.
Live data for AI agents — search, research, markets, crypto, X/Twitter. Pay-per-call via x402 micropayments.