hydra CLAUDE.md

hydra CLAUDE.md is an instructions file for coding agents from saadnvd1/hydra. It costs 625 tokens per session, scanned A, original, MIT.

Project instructions for hydra, a Go command-line program that wraps AI coding tools in a terminal window. It detects usage limits, can switch providers, saves session information, and records logs.

In plain words
What is it for?
Use them when developing hydra to understand its Go packages, configuration file, terminal handling, session files, tests, and provider-switching signals.
Why use it?
They give an AI coding agent the project's structure, build command, configuration locations, and design rules before it changes the code. This reduces the chance of breaking the wrapper's terminal, session, or provider-switching behavior.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/saadnvd1/hydra/claude-md
Clone the repo
git clone --depth 1 https://github.com/saadnvd1/hydra

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for hydra CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/saadnvd1/hydra/claude-md.svg)](https://agentmods.dev/instructions/saadnvd1/hydra/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/saadnvd1/hydra/claude-md"><img src="https://agentmods.dev/badge/instructions/saadnvd1/hydra/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 625 This file is loaded in full into every session.
When invoked 625 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00625 $0.00625
Opus 5 $0.00313 $0.00313
Sonnet 5 $0.00125 $0.00125
Haiku 4.5 $0.00063 $0.00063

Measured 4d ago against content hash e5d9d595e488, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

hydra CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 41 lines

How it starts

The opening of the file, as written. The whole thing — 41 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ai-cli

Go CLI. PTY-based wrapper around AI coding CLIs with automatic limit detection and provider switching.

Structure

  • main.go — entry point, arg routing, ai switch (SIGUSR1 to all PIDs), clipboard helper
  • internal/config/ — YAML config loading, default limit patterns from real CLI source
  • internal/proxy/ — PTY proxy: spawns CLI in pseudo-terminal, monitors output, SIGUSR1/SIGQUIT signal handling, provider picker menu (raw mode single-keypress), multi-PID management
  • internal/session/ — session persistence, Claude Code JSONL session file extraction (~/.claude/projects/<project>/<id>.jsonl), git diff/log capture, continuation prompt builder
  • internal/logger/ — append-only log file
  • test/ — fake provider scripts for testing limit detection flow

Build

go build -o /usr/local/bin/ai .

Config

~/.config/ai-cli/config.yaml — provider chain, permission bypass args/env, limit patterns.

Key Design

  • Full PTY passthrough — user sees actual TUI, no filtering
  • Output ring buffer (8KB) scanned for limit patterns (ANSI-stripped via regex)
  • ai switch sends SIGUSR1 to ALL running ai processes via PID files in ~/.local/share/ai-cli/pids/
  • Context extraction reads Claude Code JSONL session files directly, parses user/assistant messages
  • Extra CLI args only forwarded to initial provider, not fallbacks (prevents flag leakage)
  • Provider picker uses raw mode for single-keypress selection
  • Permission bypass baked into config per provider (different mechanisms: CLI flags for Claude/Codex, env var for OpenCode, none needed for Pi)

Provider-Specific Notes

  • Claude Code: --dangerously-skip-permissions flag. Sessions stored as JSONL at ~/.claude/projects/
  • OpenCode: OPENCODE_PERMISSION='{"*":"allow"}' env var (TUI doesn't support --dangerously-skip-permissions, only opencode run does). Model format: provider/model (e.g. google/gemini-2.5-flash)
  • Codex: --full-auto flag. Model format: just model name (e.g. o3)
  • Pi: No permission system. Model format: pattern match without provider prefix (e.g. gemini-2.5-flash). Binary requires full nvm path in config due to lazy-loaded nvm.

Read the full file on GitHub · 41 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 41 lines · 625 tokens per session scan A e5d9d595e488

Subscribe to this mod's changes

hydra CLAUDE.md is an instructions file published in the GitHub repository saadnvd1/hydra (18 stars, last pushed 4mo ago), licensed MIT. It adds 625 tokens to every session, about $0.0031 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.