Hive
Hive is designed for the way people actually use AI in code today, where you have three terminals open, you're running gemini on one feature, your friend is running it on another, and in five minutes you're already in a
Core trick
Gemini CLI hook scripts acquire file-level write locks before replace or write tools run, and inject team state into each agent turn.
Tags
Description
Hive is designed for the way people actually use AI in code today, where you have three terminals open, you're running gemini on one feature, your friend is running it on another, and in five minutes you're already in a merge conflict you didn't see coming because neither of these agents knows what the other is doing. That's not an enterprise problem, that's a vibe coder problem. You're moving quickly, you're shipping at 2 am, and your entire workflow is you and a few friends just vibing on a code base, throwing prompts at it, and you don't want to have to deal with PRs and code reviews, you want to not have to step on each other. Hive integrates directly into the gemini-cli you're already using, it doesn't require any config changes, and it gives all the agents in your session a live view of what the others are doing so you naturally stay out of each other's way.
README excerpt
# Hive A real-time coordination layer for multiple `gemini` CLI sessions working in the same repo simultaneously. Each teammate keeps using `gemini` locally as normal. Hive adds shared awareness, file-level write locks, and a live web UI — with zero changes to gemini-cli. --- ## How It Works Gemini CLI has a hook system: shell scripts wired into `~/.gemini/settings.json` that fire at specific moments. Hive uses four hooks: | Hook | When | What Hive Does | |------|------|----------------| | `BeforeAgent` | Before each agent turn | Fetches current team state → injected into system prompt | | `BeforeTool` | Before `replace`/`write_file` | Acquires a lock — blocks the tool if another agent holds it | | `AfterTool` | After any tool | Reports the event + file snapshot to the server | | `SessionEnd` | When gemini exits | Releases all locks held by this session | The hook scripts only ever `curl` your API. No gemini-cli source changes needed. --- ## Data Flow ### Write lock enforcement ``` gemini calls write_file or edit → BeforeTool hook → POST /api/rooms/[id]/locks → approve or deny → if approved, gemini writes the local file → AfterTool hook → POST /api/rooms/[id]/events → event + file snapshot stored in Supabase → Supabase Realtime pushes to all open browsers → Web UI updates file tree, editor content, activity feed ``` ### Context injection (before each turn) ``` gemini starts a new turn → BeforeAgent hook → GET /api/rooms/[id]/state?session_id=... → r