Complete installation and configuration guide for Agent HUD.
- Node.js 20+
- pnpm (
npm install -g pnpm)
- Android SDK (Android Studio or command-line tools)
- JDK 17+
- GitHub account with a personal access token (for the karoo-ext Maven package)
- Claude Code CLI installed
curlavailable in your shell
cd bridge
pnpm install
pnpm devOn startup, the bridge prints:
Agent HUD Bridge running on http://0.0.0.0:7420
Pairing code: 742816
Use POST /api/v1/pair with this code to get a bearer token
Note the pairing code -- you'll need it for both the Claude Code hooks and the Karoo extension.
curl -X POST http://localhost:7420/api/v1/pair \
-H 'Content-Type: application/json' \
-d '{"pairingCode": "742816"}'Response:
{"token": "ahud_ZGPzbZ1fa07AIHnAe01Rkg", "bridgeName": "your-hostname"}Save this token. You can generate multiple tokens by calling /pair again with the same code.
The bridge is configured via environment variables:
# Custom port
PORT=8080 pnpm dev
# Debug logging
LOG_LEVEL=debug pnpm dev
# Bind to localhost only
HOST=127.0.0.1 pnpm devpnpm build
PORT=7420 node dist/index.jspnpm test # Single run
pnpm test:watch # Watch modeAdd to your shell profile (~/.zshrc, ~/.bashrc, etc.):
export AGENT_HUD_TOKEN="ahud_your_token_here"Reload your shell or run source ~/.zshrc.
Open ~/.claude/settings.json and merge the hooks from hooks/claude-hooks.json.
If you already have hooks configured, add the Agent HUD hooks alongside your existing ones. Each hook event (SessionStart, PostToolUse, etc.) accepts an array, so you can have multiple hooks per event.
Example merged config:
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "curl -sf -X POST -H 'Content-Type: application/json' -H \"Authorization: Bearer $AGENT_HUD_TOKEN\" -d \"$(cat)\" http://localhost:7420/api/v1/hooks/session-start",
"timeout": 5
}
]
}
]
}
}See hooks/claude-hooks.json for the complete configuration with all 6 events.
Start a Claude Code session and check the bridge:
curl -s http://localhost:7420/api/v1/agents \
-H "Authorization: Bearer $AGENT_HUD_TOKEN" | python3 -m json.toolYou should see your session listed with status: "working".
| Event | When it fires | What the bridge does |
|---|---|---|
SessionStart |
Claude Code session begins | Creates agent, sets status=working |
PostToolUse |
After each tool call | Increments tool count, infers phase, updates status line |
PostToolUseFailure |
Tool call fails | Increments error count |
Notification |
Permission prompt appears | Increments pending questions, sets status=waiting |
Stop |
Agent finishes | Sets status=idle, progress=100 |
SessionEnd |
Session closes | Sets status=stopped |
If the bridge runs on a different host or port, replace http://localhost:7420 in each hook command.
- Hooks not firing: Verify
AGENT_HUD_TOKENis set in your shell (echo $AGENT_HUD_TOKEN) - Connection refused: Ensure the bridge is running (
curl http://localhost:7420/api/v1/health) - 401 Unauthorized: The token may be expired or wrong. Re-pair with the bridge
- Hooks are non-blocking: If the bridge is down, Claude Code continues normally. Hooks use
curl -sf(silent, fail-fast) with a 5-second timeout
The karoo-ext SDK is hosted on GitHub Package Registry. Add your credentials to ~/.gradle/gradle.properties:
gpr.user=YOUR_GITHUB_USERNAME
gpr.key=YOUR_GITHUB_PERSONAL_ACCESS_TOKENThe token needs the read:packages scope. Generate one at GitHub Settings > Tokens.
If the karoo-app/ directory doesn't have gradlew, generate it:
cd karoo-app
gradle wrapper --gradle-version 8.6Or copy the wrapper files from the karoo-ext-template.
cd karoo-app
./gradlew assembleDebugThe APK is at app/build/outputs/apk/debug/app-debug.apk.
Option A: Hammerhead Companion App
- Transfer the APK to your phone
- Open the file and share it with the Hammerhead Companion App
- The Companion App installs it on your connected Karoo
Option B: ADB
adb install -r app/build/outputs/apk/debug/app-debug.apk- Open the Agent HUD app on the Karoo
- Enter the bridge URL (e.g.,
http://192.168.1.100:7420) - Enter the 6-digit pairing code from the bridge console
- Tap Pair
- Open your ride profile settings on the Karoo
- Add a data field page
- Select Agent HUD as the source
- Choose from: Agent Progress, Agent Questions, or Agent Status
The Agent Status field is graphical and shows the most information (name, phase, status line).
adb logcat -s AgentHud- The Karoo and the bridge must be on the same network (WiFi/LAN)
- The bridge binds to
0.0.0.0by default, making it accessible from any device on the network - Default poll interval is 3 seconds (configurable 2-10s in the Karoo app settings)
- Each poll transfers ~100-500 bytes -- negligible battery impact
Ensure port 7420 (or your custom port) is open for incoming TCP connections on the machine running the bridge.
For riding outside your home network:
- Phone hotspot: Connect both your laptop and Karoo to your phone's hotspot
- Tailscale/VPN: The bridge and Karoo both join the same Tailscale network
- Update the bridge URL in the Karoo config to the new IP
cd karoo-app
./gradlew assembleRelease \
-Pandroid.injected.signing.store.file=keystore.jks \
-Pandroid.injected.signing.store.password=$STORE_PASSWORD \
-Pandroid.injected.signing.key.alias=agenthud \
-Pandroid.injected.signing.key.password=$KEY_PASSWORDGenerate a keystore if you don't have one:
keytool -genkey -v -keystore keystore.jks -alias agenthud \
-keyalg RSA -keysize 2048 -validity 10000