Quickstart
This page walks you through installing AI Agents HQ and running your first task coordination workflow. By the end, you will have created a task, claimed it as an agent, and marked it complete — the same workflow that AI agents use in production.
You do not need Claude, Gemini, or Codex installed to follow along. The hq CLI works on its own. You will be playing the role of an agent manually to understand how the system works.
Installation
Prerequisites
You need two things installed on your machine:
- Go 1.23 or later — the programming language the project is written in
- Git — to clone the repository
If you are not sure whether Go is installed, run this in your terminal:
If you see a version number, you are good. If you see "command not found", you need to install Go first.
Installing Go
How to install Go on Linux / WSL
Download and extract Go to /usr/local:
Then add it to your PATH permanently by adding this line to your ~/.bashrc (or ~/.zshrc if you use zsh):
How to install Go on macOS
The easiest way is with Homebrew:
Or download the installer from go.dev/dl.
How to install Go on Windows
Download the MSI installer from go.dev/dl and run it. Go will be added to your PATH automatically. Restart your terminal after installing.
If you are using WSL (Windows Subsystem for Linux), follow the Linux instructions instead.
Clone and Build
Verify the Installation
Run the test suite to make sure everything is working correctly on your machine:
If all three packages show ok, you are good to go. The -race flag enables the race detector, which checks for concurrency bugs.
Your First Task
Let us walk through the complete lifecycle of a task. This is exactly what happens when AI agents coordinate — you are just doing it by hand to understand each step.
Step 1: Create a Task
Create a new task assigned to the "claude" tool in a team called "demo":
The system responds with JSON confirming the task was created. It has ID 1 and starts in pending status — meaning it is available for an agent to pick up.
Step 2: List Available Tasks
Check what tasks are available:
You can filter by tool, status, or only show tasks that are ready to claim (no unresolved dependencies):
Step 3: Claim the Task
An agent claims the task by providing its name, tool, and the current protocol version:
Notice what changed:
- Status went from
pendingtoin_progress - Owner is now
my-agent - Version bumped from 1 to 2 (every change increments the version)
- A lease was set (the agent has 30 minutes to finish or send a heartbeat)
If another agent tries to claim the same task now, it gets rejected:
Step 4: Send a Heartbeat (for Long Tasks)
If the work takes more than a few minutes, the agent should send periodic heartbeats to extend its lease:
This resets the 30-minute timer. Without heartbeats, the lease eventually expires and another agent could take over (this is the crash recovery mechanism).
Step 5: Complete the Task
When the work is done, the agent reports completion with a summary and an idempotency key:
The idempotency key (1-my-agent-complete) ensures that if this exact command runs again (due to a retry or crash recovery), it is silently ignored instead of causing an error.
Step 6: Communicate via Inbox
Agents can send messages to each other through inboxes. For example, after completing a task, an agent might notify the lead:
The lead agent reads its inbox:
What Just Happened?
You just walked through the complete task coordination workflow:
In a real deployment, AI agents do exactly these steps automatically. The orchestrator creates tasks, each AI tool's agent session picks up tasks assigned to it, does the work, and reports back. The hq CLI handles all the tricky parts — concurrency, crash recovery, duplicate detection — so agents can focus on the actual work.
Next Steps
Understand how CAS versioning, leases, and idempotency work to keep everything safe. Read more
Full reference for every hq command, flag, and exit code. Read more
Learn about the Claude, Gemini, and Codex agent definitions and how they collaborate. Read more
Dive into the Go code structure, protocol layer, and storage layer. Read more