Skip to content

h5i-dev/h5i

Repository files navigation

h5i logo

tests Apache-2.0 GitHub stars release
Agent Radio Token Reduction AI PR Brief

Git records what changed. h5i records the rest: who, why, what the agent knew, whether it was safe, and how the next agent picks up where the last left off.

5
Command groups
up to 95%
Less token waste
3.5x
Richer PR briefs
1.8x
Multi-agent productivity

Use h5i if you want your AI agents to stop leaving their work in thin air.

  • Want to know which model, prompt, and reasoning led to a commit?
  • Want the next agent to inherit the full context of the last one?
  • Want Claude and Codex to talk in real time, with the conversation stored in Git?
  • Want to reduce token usage by shrinking noisy tool output while keeping the raw evidence?
  • Want to catch leaked secrets, blind edits, and risky AI changes before review?

Recent News

  • New in v0.1.7: Token Reduction with Unified Form. Agents see a compact summary while the full output stays out of context, shared via Git LFS. Jump to Token Reduction ↓
  • Agent Radio reached 100+ points on Hacker News. Read the discussion here.
  • New in v0.1.5: Agent Radio. Since your agents' context already lives in Git, they can now talk to each other through it. h5i msg adds a cross-agent message channel stored in refs/h5i/msg. Jump to Agent Radio ↓

1. The foundation: a versioned record of every agent's work and communications

h5i is a pure Git sidecar for recording and sharing AI-agent contexts, metadata, and other useful information. It uses dedicated refs, so it doesn’t pollute your working tree or your normal branch graph.

Ref What lives there
.git/refs/h5i/notes Per-commit metadata: model, agent, prompt, tests, decisions, risk signals.
.git/refs/h5i/context The reasoning workspace as a DAG: goal, milestones, traces, branches.
.git/refs/h5i/msg Cross-agent message log (append-only, union-merged on pull).
.git/refs/h5i/objects Token-reduction capture manifests: command, exit code, and filtered summary of large outputs (full raw kept locally).
.git/refs/h5i/checkpoints/<agent> Per-agent memory snapshots.

Because these are Git objects, they are content-addressed, deduplicated, pushable, fetchable, and survive git gc.

h5i context DAG view


2. Install

curl -fsSL https://raw.githubusercontent.com/h5i-dev/h5i/main/install.sh | sh

Or build from source:

cargo install --git https://github.com/h5i-dev/h5i h5i-core

3. 60-Second Flow

Initialize h5i in an existing Git repo:

h5i init

For Claude Code hooks and MCP tools:

h5i hook setup

Post the PR review brief:

h5i share pr post --style review      # upsert sticky PR comment
h5i share pr body --style review      # render markdown for CI

h5i share pr post requires the GitHub CLI (gh) to be installed and authenticated (gh auth status clean). Use h5i share pr body when CI should render markdown without posting through gh.

Sync h5i sidecar refs with teammates:

h5i share push
h5i share pull

4. Feature Examples

4.1. Agent Radio — agents that talk over Git

Because that context already lives in Git, your agents can also talk to each other through it: h5i msg is a Git-backed cross-agent message channel stored in refs/h5i/msg, built for typed operational handoffs (ASK · REVIEW_REQUEST · RISK · DONE · ACK). Claude can ask, Codex can review, risks can be flagged and resolved, and the whole log survives clones, machines, and branches. It travels with h5i share push / pull, and divergent sends from two machines union-merge with no messages lost.

To efficiently use h5i msg, first register some hookups for agents:

h5i msg setup

Then, we’re ready to let Claude and Codex communicate with each other in real time. Open two separate terminals, launch Claude Code and Codex, and give instructions to them.

Example Instructions

  • Claude: Can you play Chess with Codex via h5i
  • Codex: Can you play Chess with Claude via h5i

We can also monitor the conversation in real time with h5i msg watch.

h5i msg watch — a live claude ↔ codex code review streaming over refs/h5i/msg

4.2. Token Reduction with Unified Form

Wrap any command with h5i capture run -- <cmd> and the agent sees only a compact, normalized summary of errors, failures, and counts, while the full raw output is stored out of band in refs/h5i/objects. Every tool's output collapses into one unified form, so a 4 MB test log no longer burns your context window, and the raw bytes are always one h5i recall object <id> away when you need them.

# One Schema for Every Tool
tool: pytest
kind: test            # test | lint | typecheck | build | vcs | generic
status: failed        # passed | ok | failed | error | unknown
exit_code: 1
counts: { failed: 1, passed: 120 }
parser_confidence: parsed     # parsed | heuristic | generic
raw_oid: sha256:934f…         # the full output, always recoverable
findings:
  - kind: test_failure        # test_failure | diagnostic | build_error | panic | generic
    severity: failure
    id: tests/test_auth.py::test_refresh
    message: assert 0 == 100
    location: tests/test_auth.py:42
    fingerprint: 0bb827e4e61a  # stable across line shifts → dedupe / track

To share captures across a team, h5i borrows the split that Git LFS uses: the manifest in refs/h5i/objects is a lightweight pointer (it carries the raw output's sha256), while the bytes themselves ride on a native Git LFS backend, so huge tool output never bloats the Git object database. For remotes that are not HTTP, it transparently falls back to a git ref store.

h5i recall object

4.3. Context DAG

The context DAG shows how the work unfolded: the goal, every milestone, and the OBSERVE / THINK / ACT trace behind each change, captured automatically as the agent works. Because it is snapshotted on every commit, you can replay exactly what an agent knew and why it acted at any point in history.

h5i recall context show

h5i context DAG view

4.4. Pull Request Integration

When a branch is ready for review, h5i surfaces all of it where reviewers already work — on the pull request.

The AI Pull Request Brief:

h5i share pr post

🔎 Review focus

The exact files to open first, ranked by where the agent spent its compute.


🎯 Goal & Intent

The goal agents were tasked to solve.


📌 Reviewer checklist

Actionable verification steps tailored for this specific diff.


🧠 Reasoning

The OBSERVE / THINK / ACT steps.


🛡️ Security & Duplicated Code

Automated check for credential leaks, blind edits, and copy-pasted blocks.


🤖 AI Provenance

Track the prompt, model names, and commit lineage.

h5i review brief


4.5. Web Dashboard

h5i serve        # http://localhost:7150

h5i web dashboard showing AI commit timeline and context details


5. Documentation


6. Contributing

High-impact contributions:

  • try h5i on a real AI-assisted repo and file issues with confusing moments
  • improve PR-body presentation and GitHub reviewer workflows
  • add adapters for more test runners and agent tools
  • harden prompt-injection and compliance rules
  • improve dashboard workflows for reviewers

If the idea matters to you, starring the repo is the fastest way to help more AI-heavy teams find it.


7. Acknowledgements

h5i's token-reduction filters build on prior art, both Apache-2.0:

  • rtk — the declarative output-filter rule files and the engine that runs them are derived from rtk.
  • headroom — the log line-folding technique (collapse near-identical lines into one with a count) is reimplemented from headroom.

See NOTICE and assets/filters/NOTICE for full attribution.

8. License

Apache-2.0. See LICENSE.