Skip to main content
Coding agent analytics in Caveman Cloud depend on one thing: each developer’s agent sends its model calls through the gateway on that developer’s personal key. Once it does, every request is attributed to the person, labeled with the agent that made it, and grouped into sessions you can trace back to a repository and branch. This guide covers the two ways to connect each supported agent and how to roll it out across a team.

Choose a connection method

Both methods produce the same attribution in the Developers space. The wrapper also reports per-machine data to Your agents (routing decisions, model mix, measured tokens, and tokens kept out of context).
Cursor connects to Caveman Cloud over MCP so it can read traces and reports, but it is not a supported routed agent, so its own model calls do not appear in coding agent analytics. See Connect your coding agent.

Before you start

  • An owner or admin has connected the provider your agent uses (Anthropic for Claude Code, OpenAI for Codex) under Gateway → Providers in the project. If not, the connect page shows Connect first.
  • You know your gateway origin. Set it once:

Get your personal key

1

Open Connect an agent

In the console, go to Developers → Connect an agent and pick the project you want your usage attributed to.
2

Reveal the key

Click Get my key. The key is shown once, so copy it now. If you already have one, Rotate & reveal issues a new key and revokes the old one.
3

Export it

A personal key belongs to one person in one project. To report on sub-teams separately, create a project per team; each project is a team in the Developers space.

Tag sessions with repository and branch

Set CAVE_TAGS in the shell before starting the agent. The gateway records repo and branch on each request, which is what links sessions to merged pull requests in Repositories and Delivery.
The value is sent in the x-cave-tags header. The gateway drops a repo value that is not in owner/name form. Repository and branch are caller-reported metadata; no prompts or source code are needed to link them.

Connect each agent

Direct connect. Claude Code reads its base URL, token, and extra headers from the environment.
If your project uses a stored Anthropic credential, leave out the x-cave-upstream-key line.Wrapper.

Install and sign in to the wrapper

caveman login registers the machine. After that, caveman <agent> (or caveman run -- <agent>) starts any of the seven profiles. Each machine and agent then appears under Developers → Your agents, and a person’s device count and last login show in team views. For profile details, see Route agent traffic through the gateway.

Verify it worked

  1. Keep Developers → Connect an agent open while you send your first prompt. It switches from “Waiting for your first agent session…” to a connected message such as “Claude Code connected: your session activity is arriving.”
  2. Click Inspect sessions to open Developers → Sessions and find your session.
  3. Open My usage to see your requests and catalog spend by coding tool and model.

Roll out to your team

1

Create one project per team

Each project is a team in the Developers space. Create more projects for sub-teams.
2

Connect providers once

Add Anthropic and OpenAI connections in Gateway → Providers so developers can omit their own upstream keys.
3

Share the setup

Ask each developer to get a personal key and add the exports above (including CAVE_TAGS) to their shell profile, or install the caveman CLI.
4

Connect GitHub

Have an owner or admin connect GitHub to the project so sessions link to merged changes.
5

Check attribution

In Developers → Team, the Attribution panel shows how much project spend is linked to people. A low share means traffic is running on shared keys or is app traffic.

Agent labels

The agent label comes from the x-cave-agent header that each profile or direct-connect path sets. Unknown labels display as sent. Traffic with no label shows as Unlabeled, and wrapper traffic without a specific profile shows as Caveman CLI. Charts show the top five agents and group the rest as “other”.

Next steps