Agent Dual Proxy — Development skill for Claude Code
Local dual-path proxy for CLI agents: auto-selects a working gateway among proxies and direct, verifies the channel, and fails over without restarting the agent.
How to install Agent Dual Proxy
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open gambn/agent-dual-proxy and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Agent Dual Proxy does
Local dual-path proxy for CLI agents: auto-selects a working gateway among proxies and direct, verifies the channel, and fails over without restarting the agent.
Alternatives in Development
- Claude Code Rails Upgrade Skill — 🤖 The one and only Claude Code Skill to Upgrade Rails by FastRuby.io -- Based on 60,000 dev/hours of experien 410 ★
- Watch Job — Watch a VASP job and diagnose/fix issues if it fails 155 ★
- Aod.Project Plan — Create implementation plan with dual sign-off (PM + Architect) - Streamlined v2 89 ★
README
agent-dual-proxy
[中文](README.md) · [English](README.en.md)
[](https://github.com/gambn/agent-dual-proxy/actions/workflows/ci.yml) [](https://www.npmjs.com/package/agent-dual-proxy)
**Agent 的网关管理器:在多个网关之间在线自动切换,让模型请求不再被一条不稳的路卡死。**
它把「agent 到模型端点的网络路径」当成可管理的资源:在配置的上游、额外指定的代理、启动环境里的代理和直连之间自动选一条能通的;运行中用真实请求持续验证,失败立刻切到下一条——不需要重启 agent,也不需要改客户端配置。
快速开始
# 独立 CLI
npm install -g agent-dual-proxy
# 给 Claude Code 等 CLI agent 套上
agent-gateway run claude --resume
要求 Node.js ≥ 22.0.0。内置短名覆盖 Claude Code、Codex CLI、Gemini CLI、Aider、OpenCode、Qwen Code、Cursor CLI、Droid、Amp、Crush、Goose、GitHub Copilot CLI 和 pi;完整对照见 [docs/agents.md](docs/agents.md)。不在表里的命令用 `agent-gateway run -- [args...]`。
从源码安装(可选):
git clone https://github.com/gambn/agent-dual-proxy.git
cd agent-dual-proxy
npm install
两种用法,同一份核心:
- AGENT 启动器(推荐):
agent-gateway run,起代理 + 注入代理变量 + exec,agent 退出时代理跟着关; - 独立进程:
dual-proxy跑一个常驻代理,或挂 systemd 用户服务。
它解决什么
上游代理并不稳定:同一个代理可能对 A 站通、对 B 站不通,也可能整段时间全挂;本机同时装着两个代理时,哪个能用还会变。只认一条路的客户端在这种时候会成片失败,而在死路上重试只是拖延。
这一层把候选路都握在手里,按 host 选:
客户端 → 127.0.0.1:7898
├── 网关 A(TLS 探测通过)→ 上游代理
├── 网关 B(TLS 探测通过)→ 上游代理
└── 都探测失败 → 直连
健康检查用一个真实请求把同一组候选走一遍,谁先给出 <500 的响应,谁就成为全局首选。
行为
- 候选网关 =
upstreamHost:upstreamPort(或upstreamUrl)+gateways+ 启动环境的HTTP(S)_PROXY/ALL_PROXY,去重并排除自身监听端口,最后补direct。 - 上游代理认证:
upstreamUrl、gateways或环境变量里的 HTTP 代理 URL 可带user:pass;连接代理时会带Proxy-Authorization: Basic。0.7.0 只支持http://上游代理:upstreamUrl传https://会报错;额外候选(gateways、--gateway、GATEWAY、启动环境代理)里的https://或非法值会给脱敏 warning 后跳过。Basic 只是 base64,不是加密,只建议回环或受信任网络。 - CONNECT(HTTPS):443 上先对候选做 TLS 握手探测,通过的才用来开隧道;失败换下一条。
- 普通 HTTP:请求体先缓冲(上限 8 MB),按同一顺序换路重放;建连用
attemptTimeoutMs(已知路径用fastFailTimeoutMs),等响应头用 `responseTimeout
Related Skills
Stay Fresh Lsp Proxy
A Claude Code plugin that proxies any LSP server and filters stale/noisy diagnostics from conversation context
Proxy0x
Windows proxy manager for residential HTTP/SOCKS5 proxies. One click routes apps through a local proxy, rotate
Dsh Usage
🌊 Persistent dock & fully-customizable balance/usage panel for DeepSeek Harness — activity heatmap, dual-chan
Dotline
A direct line between your ChatGPT dot and Claude Code: a tiny HTTPS mailbox, claim-and-reply, Monitor hook or
Hitl Channel
HITL Channel - Claude Code MCP channel plugin for direct mobile-to-agent communication. Privacy-first, no inte
Grok Proxy Cc
Anthropic Messages API proxy for Grok (xAI) — reuses ~/.grok/auth.json CLI login. Born at maximum optimization
Related Agents
Dual Channel Drift Auditor
Cold pairwise audit of a declared @dual-pair anchor group. Given ONLY an anchor (never the PR diff or narrativ
Open Claw Guru.Agent
Use this agent when the user needs expert guidance on the OpenClaw AI assistant platform (openclaw.ai) — inclu
Fintech Payment Sentinel
MANDATORY specialist subagent for FinTech Billing, DOKU Payment Gateway (Checkout & SNAP BI Direct API), SaaS