Hail_Hydra
AR6420 · AR6420/Hail_Hydra
A multi-agent framework that uses speculative execution and specialized agents to make AI coding CLIs like Claude Code more cost-effective and faster.
🐉 Hail Hydra — Multi-headed speculative execution framework for Claude Code. 10 AI agents, 3x faster, ~70% cheaper. Inspired by speculative decoding.
Preview
What you can do with it
- Reduce the cost of complex coding tasks by delegating to specialized, cheaper models.
- Speed up development cycles by utilizing parallel speculative execution across multiple agents.
- Integrate a curated set of 10 specialized agents into your Claude Code or Gemini CLI workflow.
Safety check
No risky patterns found in the files we scanned.
Automated scan of the repo files. Always review code you run.
From the README
🐉 H Y D R A
Multi-Headed Speculative Execution for AI Coding CLIs Claude Code · Gemini CLI · Codex CLI · GitHub Copilot CLI
"Cut off one head, two more shall take its place." Except here — every head is doing your work faster and cheaper.
10 agents · 10 commands · 6 hooks · 4 host CLIs · Codebase map · Real token tracking · Persistent memory
🧬 What is Hydra?
Hydra is a curated multi-agent toolkit for AI coding CLIs — Claude Code, Gemini CLI, Codex CLI, and GitHub Copilot CLI. It ships 10 specialized agents pinned to each host's cost-effective models (Haiku/Sonnet on Claude Code, Flash tiers on Gemini, Luna/Terra on Codex), 10 commands for direct invocation, and one automatic touchpoint that recommends integration verification after substantial code changes — plus an opt-in /hail-hydra skill on Copilot with the same 10 roles on native subagents and no automatic hooks.
Each agent runs on the smallest model that can do its job well. When invoked, Hydra typically cuts per-task cost by ~50% compared to running the same work on the orchestrator alone — while maintaining output quality through verification. That's the same ~50% you'll see everywhere Hydra is described, and it comes from one place: real session logs, via /hydra:stats (51.5% in the sample below).
Think of it this way:
Would you hire a $500/hr architect to carry bricks? No. You'd have them design the building and let the crew handle construction. That's the model Hydra follows when you invoke a specialized head.
New — GitHub Copilot CLI (opt-in): use /hail-hydra <task> inside your existing
Copilot session. Normal messages keep the normal agent. No second CLI, API key,
background service or model-default change is needed. See Copilot setup.
Multi-Host: One canonical source (content/) generates a native payload per
host. Invoke with /hydra:* on Claude Code and Gemini CLI, $hydra-* skills on
Codex CLI, or /hail-hydra <task> on Copilot.
Everything else Hydra is known for is still here: persistent agent memory, the codebase map with blast-radius lookups, the sentinel verification touchpoint after substantial edits, internal-thinking compression (/hydra:stfu), and real token tracking with /hydra:stats. Full version history lives in the CHANGELOG.
When to Use Hydra Explicitly
Hydra's biggest cost savings come from explicit invocation in scenarios where specialized handling genuinely helps:
| Scenario | How to Invoke | Why It Saves |
|---|---|---|
| Broad codebase exploration | "use hydra-scout to find X" | Haiku reads files faster and cheaper than Opus |
| Multi-file changes | "use hydra-coder to update X across these files" | Parallel Sonnet dispatch beats sequential Opus |
| Security review | /hydra:guard | Pattern matching is Haiku-cheap |
| Environment validation | /hydra:preflight | Cross-references compatibility matrices on Sonnet |
| Codebase architecture review | /hydra:map | Dependency graph stored locally |
For one-off questions, simple edits, or conversational work, the host handles it directly. On Claude, Gemini and Codex, Hydra's only automatic intervention is the post-substantial-edit sentinel directive. Copilot has no automatic intervention.
🚀 Installation
One command. Done.
npx hail-hydra-cc@latest
Runs the interactive installer — pick your CLI(s) (Claude Code, Gemini CLI, Codex CLI, GitHub Copilot CLI) and scope, and it deploys the agents, commands, hooks, and per-host wiring. Done in seconds.
Installation Options
# Claude Code, all projects — no prompts (v2-compatible default)
npx hail-hydra-cc --global
# Pick your agent(s) explicitly
npx hail-hydra-cc --agent=claude --global
npx hail-hydra-cc --gemini --global
npx hail-hydra-cc --codex --global
npx hail-hydra-cc --copilot --global
npx hail-hydra-cc --agent=claude,gemini,codex,copilot --global
# Every detected agent, fully non-interactive
npx hail-hydra-cc --all --global --yes
# This project only / both scopes
npx hail-hydra-cc --claude --local
npx hail-hydra-cc --claude --both
# Preview what would be written (writes nothing)
npx hail-hydra-cc --dry-run --all
# Check what's deployed
npx hail-hydra-cc --status
# Remove everything
npx hail-hydra-cc --uninstall
All flags: --agent=<list> (claude,gemini,codex,copilot) or the aliases --claude /
--gemini / --codex / --copilot / --all (every detected agent) · scope --global /
--local / --both · --yes non-interactive (requires an agent selection) ·
--dry-run · --config-dir config-dir override (single agent only) ·
--status · --uninstall.
Per-Host Invocation
| Host | Commands | Notes |
|---|---|---|
| Claude Code | /hydra:help, /hydra:stats, … | StatusLine + hooks registered in ~/.claude/settings.json |
| Gemini CLI | /hydra:help, /hydra:stats, … | Restart Gemini CLI (or run /commands reload) to pick up the new commands |
| Codex CLI | $hydra-help, $hydra-stats, … (skills with a $ trigger) | Required once: run /hooks inside Codex to review and trust the Hydra hooks — they stay inert until then |
| GitHub Copilot CLI | /hail-hydra <task> | Run /skills reload; instruction-gated explicit requests, no hooks or persistent agent switch |
GitHub Copilot CLI (opt-in)
Requires a Copilot CLI version that supports skills and explicit invocation.
npx hail-hydra-cc@latest --copilot --global --yes # ~/.copilot/skills/hail-hydra (or $COPILOT_HOME)
npx hail-hydra-cc@latest --copilot --local --yes # .github/skills/hail-hydra, this project only
The installer honors COPILOT_HOME for the global pa