AgentCollision AgentCollision Docs

CLI reference

Every agc command at a glance. Run agc help <command> for detailed help on any one.

Setup

agc login

Connect this machine to your AgentCollision account. Opens your browser to dashboard.agentcollision.com/device for a one-click approval, then writes ~/.agentcollision/team.toml. Run once per machine. Replaces the older agc team join <code> flow as the canonical way to link a machine to a team.

agc init

Idempotent one-time setup. Installs hooks into detected AI tools (Claude Code, Cursor, Cline, Windsurf, Codex CLI, Gemini CLI), creates local state directory, configures file leasing. Safe to run multiple times.

agc doctor

Runs a battery of health checks: daemon reachable, hooks installed correctly, file permissions, team connectivity. Usually diagnoses problems with a one-line fix.

agc status

Quick snapshot: daemon state, version match, active lease count, hook failures, file leasing enabled.

agc verify (v0.48.0)

Proves each enforcement/coordination layer is actually active, not just configured. Reports the effective setting + whether the mechanism is in place, and tags each layer [enforcement] (blocks), [detection] (records after the fact), or [coordination] — the difference between “blocks it” and “just logs it.” agc verify --deep runs a live self-test that a conflict is denied.

agc publish-guard -- <command> (v0.48.0)

Coordinate an outbound publish (git tag, gh release, git push --tags/--force, npm/pnpm/yarn/cargo publish, docker push, wrangler deploy, kubectl apply, terraform apply) across agents and machines before it runs: leases the logical resource (e.g. tag:owner/repo@v1.2.3) so two sessions racing the same release coordinate, and checks whether the version already exists remotely before doing the work. Modes --mode warn|refuse|off (or AC_PUBLISH_GUARD_MODE); defers to CI concurrency groups for deploys. With the git wrapper installed (agc arc-claim install-git-hook), git tag/push --tags/push --force route through it automatically.

agc savings (v0.47.0)

Estimate the tokens, dollars, and developer time AgentCollision saved you by preventing collisions, over a window. Conservative, fully-tunable defaults; shows the math; --json for scripting. Uses your real measured cost-per-call when agents route through the spend proxy, else a conservative heuristic. Aliases: agc value, agc roi.

agc --version

Print the installed version. Also shown in agc status.

agc disable (v0.12.1)

Opt the current git repo out of AgentCollision lease management. Edits in this repo will fail-open — nothing breaks, nothing is coordinated. Run agc disable --list to see every disabled repo on this machine.

cd ~/Desktop/playground
agc disable
# AgentCollision disabled for /Users/you/Desktop/playground
agc disable --list

agc enable (v0.12.1)

Re-enables a repo that was previously disabled with agc disable. Run from inside the repo.

agc enable

agc rewrite-hooks (v0.11.7)

Rewrites Claude Code's settings.json hook command paths to point at the current agc binary. Idempotent. Used by the brew post_install step so hooks keep working after an upgrade moves the binary.

agc rewrite-hooks

Daemon

agc daemon

Run the daemon in the foreground. Logs to stdout. Use this for development / debugging. For normal use, prefer agc daemon start.

agc daemon start

Start the daemon in the background. Detaches from the terminal.

agc daemon stop

Stop the daemon gracefully. Held leases are preserved in the database; heartbeats resume when you restart.

agc autostart enable

Install an OS-level autostart hook so the daemon starts on login (launchd on macOS, systemd on Linux, Task Scheduler on Windows).

agc autostart disable

Remove the autostart hook.

Team

agc team create [name]

Create a new team and connect this machine as admin. Default name is "My Team". Returns an invite code to share with teammates.

agc team join <code>

Join an existing team using a 6-character invite code.

agc team status

Show current team connection: name, ID, coordinator URL, reachability.

agc team members

List all team members with their online status, role, and laptop ID.

agc team invite (admin)

Generate a new invite code. Each code is valid for 30 days. Multiple codes can be active simultaneously.

agc team revoke-invites (admin)

Revoke all pending invite codes. Anyone who hasn't redeemed yet will need a new code.

agc team promote <laptop_id> (admin)

Make a member an admin. Admins can invite, remove, change roles, edit policy, and delete the team.

agc team demote <laptop_id> (admin)

Remove admin role from a member.

agc team remove <laptop_id> (admin)

Kick a member from the team. Their token is revoked; their daemon will get 401 on next sync and fall back to local-only mode.

agc team audit

Show recent audit log entries: joins, removals, role changes, invites, policy updates.

agc team dashboard

Open the hosted dashboard at dashboard.agentcollision.com in your browser with your credentials pre-filled. No token copy-pasting.

agc team leave

Disconnect this machine from the team. Removes local team config. Local coordination keeps working.

agc team ls (v0.14.0)

List every team this laptop knows about. The currently-bound team is marked with a *. Useful when you've run agc login for more than one account.

agc team ls
# * merkle      team_a1b2c3d4   admin
#   acme-corp   team_e5f6g7h8   member

agc team switch <name> (v0.14.0)

Switch the daemon's active team. Accepts the short team name (merkle), the full team_id, or any unique ID prefix. The daemon must be running — if it isn't, start it with agc daemon.

agc team switch merkle
agc team switch team_a1b2c3d4

agc team forget <name> (v0.14.0)

Remove a team from this laptop's local config. Doesn't touch the team server-side — you remain a member there until an admin removes you. Use this to clean up old logins.

agc team forget acme-corp

Dashboard

agc dashboard

Open the local dashboard at localhost:7777/ui/. Shows activity on this machine only.

agc ui

Alias for agc dashboard.

Hooks

agc install-hooks

Install PreToolUse hooks into detected AI coding tools. Run after agc init or when you install a new tool.

agc uninstall-hooks

Remove hooks from all AI tools. The daemon keeps running, but tools no longer ask for leases before editing.

agc install-etiquette (v0.27.6+)

Append a multi-chat coordination block to the current repo's CLAUDE.md (or --file AGENTS.md for other tools). Tells AI agents in the repo when to broadcast scope checks, when not to, and how to drain inbox on task exit. Idempotent — re-running updates the block in place.

Cross-chat messaging (v0.24+)

Agents talk to each other directly. Same-machine via SQLite mailbox, same-team via teamsync push, cross-org via JWS-signed federation — all under one CLI.

Identity auto-resolves from $AGENTCOLLISION_AGENT_ID, then <repo>/.agentcollision/last-agent-id (written by the daemon's PreToolUse hook on every file edit). After your first edit in a repo, no --from flag needed.

agc msg send <recipient>

Send a message to one agent. Flags: --body (or stdin), --subject, --from, --related-lease.

agc msg send --broadcast (v0.27.0+)

Send to every agent reachable from this daemon (same-machine + team-cloud).

agc msg broadcast (v0.27.8+)

Convenience verb: send + wait + return replies in one call. Returns JSON shaped {"sent": ..., "replies": [...], "wait_ms": N}. Tune the wait window with --wait=<ms> (default 10000, max 5min); --wait=0 sends and returns immediately.

agc msg inbox

List messages addressed to you. --unread filters to unread (default). --limit caps results.

agc msg show <task_id>

Show one message thread with the full body.

agc msg reply <parent_id>

Respond to a message. Identity resolution same as send. --agent is an alias for --from.

agc msg ack <task_id>

Mark a message as seen without replying.

Webhooks (v0.27.14+)

External systems subscribe to AgentCollision events with HMAC-signed deliveries. Auto-formats Slack-shaped payloads when URL matches hooks.slack.com.

POST /v1/webhooks

Body: { "url": "https://...", "events": ["lease.acquired", "policy.fired", ...] }. Returns the subscription's HMAC secret — only shown on create. Wildcard event "*" accepts everything.

GET /v1/webhooks

List subscriptions (secrets elided). Per-subscription drop counter included so an operator can spot slow subscribers.

DELETE /v1/webhooks/{id}

Unsubscribe.

POST /v1/webhooks/{id}/test

Fire a synthetic webhook.test delivery so you can verify the wire format end to end.

Event types fired today

Human-presence leases (v0.27.11+)

IDE extensions heartbeat which files the human has open. Any AI agent that tries to write to those files is refused with 409 human_present.

POST /v1/presence/heartbeat

Body: { "file_path": "/abs/path", "ide": "vscode", "ttl_seconds": 30 }. Producer-side wire format for IDE plugins. Default TTL 30s, max 5min.

GET /v1/presence

List active presence records.

DELETE /v1/presence?file_path=<abs>

Drop a record explicitly (extensions call this when the user closes the file).

The VS Code extension ships at ide/vscode/ in the source tree. JetBrains plugin is on the roadmap; the wire format is open so any IDE can produce presence.

Infrastructure resources (v0.27.12)

agc resource ls

List declared resources from .agentcollision/resources.toml.

agc resource init

Generate an example resources.toml stub. With --template <name>, append a ready-to-use resource for one of:

Pair with --host <target> (port number, container name, context, etc.) and --name <display>.

A colored dot in your menu bar showing daemon health: green clean, yellow contention, red trouble, gray daemon-not-running. Click to open the dashboard.

agc menubar install

Builds the menubar binary (go build -tags menubar ./cmd/ac-menubar) to ~/.local/bin/ac-menubar and registers a LaunchAgent plist so it autostarts on login. Requires the agentcollision source at ~/Desktop/agentcollision (or AC_SOURCE_DIR=...).

agc menubar uninstall

Unload the LaunchAgent, remove the plist and binary.

agc menubar status

Check what's installed (binary, plist, launchd unit).

Capability probe

agc capabilities

Human-readable list of features this daemon advertises.

agc capabilities --json

Machine-readable JSON of the same.

agc capabilities has <name>

Exit 0 if the daemon advertises <name>, non-zero otherwise. Useful for scripts that gate behavior on daemon version, e.g. agc capabilities has messaging.broadcast && ....

Spend proxy

agc proxy

Transparent Anthropic API proxy that records per-agent token spend. Point your agent's ANTHROPIC_BASE_URL at this proxy. Flags: --addr (default 127.0.0.1:11434), --upstream, --threshold-usd, --caps-file, --daemon-url (v0.27.18) (default http://127.0.0.1:7777; the proxy posts spend.cap_exceeded events here for webhook fan-out).

Maintenance

agc self-update

Check for a newer release on GitHub and install it. Preserves local state, team config, and hook installations.

agc backup

Export local state (lease history, config) to a tarball. Useful before uninstalling or migrating machines.

agc config

Show current daemon configuration. Use the local dashboard's Settings page to edit.

agc events

Stream recent lease events from the daemon.

Need more detail?

Every command has --help. Example:

agc team create --help