{"id":45641269,"url":"https://github.com/rencryptofish/hydra","last_synced_at":"2026-02-27T05:00:45.858Z","repository":{"id":339710066,"uuid":"1162309026","full_name":"rencryptofish/hydra","owner":"rencryptofish","description":"Run multiple Claude and Codex agents in parallel, each in its own tmux session, managed from a single TUI.","archived":false,"fork":false,"pushed_at":"2026-02-25T02:25:03.000Z","size":533,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-25T06:39:14.075Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rencryptofish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-20T05:18:34.000Z","updated_at":"2026-02-25T02:25:07.000Z","dependencies_parsed_at":"2026-02-25T03:03:16.407Z","dependency_job_id":null,"html_url":"https://github.com/rencryptofish/hydra","commit_stats":null,"previous_names":["rencryptofish/hydra"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rencryptofish/hydra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rencryptofish%2Fhydra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rencryptofish%2Fhydra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rencryptofish%2Fhydra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rencryptofish%2Fhydra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rencryptofish","download_url":"https://codeload.github.com/rencryptofish/hydra/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rencryptofish%2Fhydra/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29885797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T23:51:21.483Z","status":"online","status_checked_at":"2026-02-27T02:00:06.759Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-24T02:34:26.750Z","updated_at":"2026-02-27T05:00:45.823Z","avatar_url":"https://github.com/rencryptofish.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"assets/hydra-logo.svg\" alt=\"Hydra logo\" width=\"420\" /\u003e\n\n# hydra\n\n**Multi-headed AI agent session manager**\n\nRun multiple Claude, Codex, and Gemini agents in parallel, each in its own tmux session, managed from a single TUI.\n\n[![Rust](https://img.shields.io/badge/rust-stable-orange.svg)](https://www.rust-lang.org/)\n[![CI](https://github.com/rencryptofish/hydra/actions/workflows/ci.yml/badge.svg)](https://github.com/rencryptofish/hydra/actions/workflows/ci.yml)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n\u003c/div\u003e\n\n---\n\n## Features\n\n- **Sidebar + Preview layout** — browse all agent sessions in a list, see live output in the preview pane\n- **Compose mode** — press Enter to open compose, type a full message, press Enter to send, Esc to cancel (draft preserved). Prompt history with Up/Down arrows. Bracketed paste support for multiline input.\n- **Status indicators** — green (idle), red (running), yellow (exited) dots per session, with auto-clearing status messages\n- **Task timer** — tracks elapsed time for the current running task per agent\n- **Last message preview** — shows the last parsed assistant response per session from provider logs\n- **Auto-generated names** — sessions get NATO phonetic alphabet names (alpha, bravo, charlie, ...)\n- **Session persistence** — sessions survive laptop shutdown; auto-revived on next launch using agent resume\n- **Session stats** — live cost, token, and tool-call metrics per agent from provider logs\n- **Diff tree** — sidebar shows per-file git diff stats grouped by directory\n- **Multi-agent support** — Claude (`claude --dangerously-skip-permissions`), Codex (`codex --yolo`), Gemini (`gemini --yolo`)\n- **Mouse support** — click to select sessions, scroll the preview pane\n- **Full scrollback** — keyboard and mouse scrolling through complete session history (PgUp/PgDn, Home/End)\n- **Copy mode** — press `c` to release mouse capture for terminal text selection\n- **Low resource usage** — idle sessions skip pane captures, batch tmux queries, parallel agent resolution\n\n## Requirements\n\n- [Rust](https://rustup.rs/) (stable)\n- [tmux](https://github.com/tmux/tmux) (installed and on PATH)\n- At least one of: [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [Codex](https://github.com/openai/codex), [Gemini CLI](https://github.com/google-gemini/gemini-cli)\n\n## Install\n\n```bash\ncargo install --locked --git https://github.com/rencryptofish/hydra.git hydra\n```\n\nIf you don't have Rust installed yet:\n\n```bash\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal \u0026\u0026 . \"$HOME/.cargo/env\" \u0026\u0026 cargo install --locked --git https://github.com/rencryptofish/hydra.git hydra\n```\n\nTo update later, run `hydra update`.\n\n## Usage\n\n```bash\nhydra                    # launch the TUI\nhydra new AGENT NAME     # create a new agent session (claude/codex/gemini)\nhydra kill NAME          # kill a session\nhydra ls                 # list sessions for the current project\nhydra update             # update to the latest version from GitHub\n```\n\n### Keybindings\n\n**Browse mode**\n\n| Key | Action |\n|-----|--------|\n| `j` / `k` | Navigate sessions |\n| `PgUp` / `PgDn` | Scroll preview pane |\n| `Home` / `End` | Jump to top / bottom of preview |\n| `Enter` | Open compose mode |\n| `n` | New session |\n| `d` | Delete session |\n| `c` | Toggle copy mode (release mouse for text selection) |\n| `q` | Quit |\n\n**Compose mode**\n\n| Key | Action |\n|-----|--------|\n| `Enter` | Send message |\n| `Shift+Enter` | Insert newline |\n| `Up` / `Down` | Browse prompt history |\n| `PgUp` / `PgDn` | Scroll preview pane |\n| `Esc` | Cancel (draft preserved) |\n\n## Architecture\n\nSingle-binary Rust TUI built on [ratatui](https://ratatui.rs) + [crossterm](https://docs.rs/crossterm) + [tokio](https://tokio.rs).\n\n```\nsrc/\n├── main.rs          CLI parsing, terminal setup, event loop\n├── app.rs           UiApp state, mode machine, key/mouse handlers\n├── backend.rs       Backend actor (owns all I/O, communicates via channels)\n├── backend/         Runtime sub-components (session, message, preview)\n├── agent/           Per-provider log parsing and command builders\n├── ui.rs            Root UI rendering (layout, draw dispatch)\n├── ui/              Rendering submodules (sidebar, preview, conversation, ...)\n├── tmux.rs          SessionManager trait + subprocess tmux manager\n├── tmux_control.rs  Persistent `tmux -C` control-mode manager\n├── session.rs       Session/AgentType data types\n├── manifest.rs      Session persistence (~/.hydra/\u003cproject\u003e/sessions.json)\n├── logs.rs          Log readers + session/global stats + cost calculations\n├── event.rs         Async crossterm event reader\n└── system/          Git diff parsing, process tree helpers\n```\n\nKey design decisions:\n- **Backend/UI actor model** — Backend runs in `tokio::spawn`, owns all I/O, and communicates with the UI via `watch` (state snapshots) and `mpsc` (commands, previews). The UI event loop never blocks on I/O.\n- **`SessionManager` trait** — all tmux interaction is behind an async trait for testability (mock/noop impls in tests)\n- **Hybrid status detection** — prefers tmux `%output` notifications and falls back to capture-based detection when needed\n- **Session revival** — manifest file persists session metadata; on startup, dead sessions are recreated with agent-specific resume commands\n- **Async I/O** — all tmux subprocess calls and manifest file I/O use `tokio` to avoid blocking the event loop\n- **Nested session isolation** — safely runs from within Claude Code by unsetting `CLAUDECODE` env vars in spawned sessions\n\n## Testing\n\n490+ tests across unit, snapshot, CLI integration, and property-based:\n\n```bash\ncargo test                # run all tests\ncargo insta review        # review snapshot diffs after UI changes\ncargo llvm-cov            # generate coverage report\ncargo +nightly udeps --all-targets  # detect unused dependencies\n```\n\n### Coverage\n\n| Module | Coverage |\n|--------|----------|\n| `session.rs` | 94% |\n| `ui.rs` | 91% |\n| `app.rs` | 83% |\n| `logs.rs` | 26% |\n| `main.rs` | 22% |\n| `tmux.rs` | 4% |\n| `event.rs` | 0% |\n| **Total** | **65%** |\n\n\u003e The low-coverage modules (`tmux.rs`, `event.rs`, `main.rs`) are I/O-heavy code that shells out to tmux or reads terminal events. Core logic and UI rendering are well covered.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frencryptofish%2Fhydra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frencryptofish%2Fhydra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frencryptofish%2Fhydra/lists"}