Telemetry schema

The exact payload the CLI sends to the ingest API: the envelope, every session and turn field, device facts, and how unknown or malformed values are handled.

Every sync sends one JSON document to POST /api/ingest: an envelope that holds up to 500 sessions and a few optional batch fields. The schema is metadata only. It has no field that can hold prompt text, a model response or code, and the API rejects any session that carries a key it does not know. This page lists every field the API accepts, with its type, whether it is required, its constraints, and the CLI version that added it where that is known.

To see what your own machine sends for a session, run planck inspect <sessionId>; see the CLI reference. For the privacy summary in plain language, see Data we collect. For authentication, rate limits and the response, see the REST API.

How the API treats what it receives

The envelope is validated object by object, and the rule differs by object. Validation is all or nothing: a request with any invalid part is rejected with 400 and a list of the failing fields, and nothing from it is stored.

ObjectA key the schema does not listA malformed value
A session (each item of sessions)Rejected. The whole request fails with 400.Rejected with 400.
A turn (each item of turns)Dropped. The rest of the turn is kept.Rejected with 400, except for the optional per-turn fields marked below, which are dropped.
A tool call (each item of toolCalls)Dropped.Rejected with 400.
The envelope itself, the items of workspaceSubscriptions, insights, anomalies and budgets, and productivityMetricDropped.Rejected with 400.
claudeBilling, agentPolicyStateTreated as malformed, so the whole field is dropped.Dropped. The rest of the request is accepted.
agentConfigRejected at every level of the snapshot.Rejected with 400.

Two fields are built to be forgiving on purpose. claudeBilling and agentPolicyState describe the device, not the batch, so a malformed value never costs you a sync. The optional per-turn fields are dropped for the same reason: a CLI that learns a new value must not break against an older backend.

What the schema enforces, and what the CLI does

No schema field can carry prompt text, a model response or code. Two areas hold free-form values by design. File paths in filesTouched and reReadPatterns are strings the API does not inspect, and the CLI sends them relative to the repository root. On a local detector result, evidence accepts any JSON object and titleShort and manualFix are free text, so for those fields the guarantee comes from the CLI, which builds them from counts, session ids and file names, and not from the schema.

Envelope

The body of POST /api/ingest is an envelope object. A bare array of session objects, between 1 and 500 items, is still accepted from older CLIs; an empty array is rejected, while an envelope with sessions: [] is valid. The body can be up to 10 MB. The CLI sends 100 sessions per request.

FieldTypeRequiredDescription
sessionsArray of session objects, 0 to 500 itemsYesSessions to create or update. An empty array is how a device sends batch-level fields on their own.
workspaceSubscriptionsArray of subscription declarations, default []NoSeat declarations from the device.
insightsArray of local detector results, default []NoResults of the CLI's local detectors.
anomaliesArray of spend jumps, default []NoSpend jumps the CLI flagged.
budgetsArray of budgets, or null, default nullNoBudgets declared on the device.
productivityMetricMetric object or null, default nullNoAccepted. The current CLI sends null.
cliVersionString shaped like 0.5.2, with an optional suffix such as -beta.1NoVersion of @planckspace/cli that produced the batch. Older CLIs omit it.
routingInstalledBooleanNoWhether model routing is installed on the device. CLI 0.4.0 and later.
claudeBillingObjectNoHow Claude Code on the device is billed. Arrives with an upcoming CLI release; not sent by 0.5.2.
agentPolicyStateObjectNoWhat the device did with the workspace's agent policy. Arrives with an upcoming CLI release; not sent by 0.5.2.
agentConfigSnapshotNoMetadata-only snapshot of agent configuration. CLI 0.5.1 and later.

Session object

One object per session. Any key not listed here rejects the whole request.

FieldTypeRequiredDescription
sessionIdString, at least 1 characterYesThe session's identifier in the tool that ran it. For Claude Code, the UUID of the session file. Sending the same id again updates the session.
toolclaude_code, cursor, windsurf, antigravity or jetbrainsYesThe tool that ran the session.
modelString, at least 1 characterYesThe session's main model. Subagent turns carry their own model on each turn.
startedAtISO 8601 timestamp with a UTC offsetYesWhen the session started.
endedAtISO 8601 timestamp with a UTC offsetYesWhen the session ended.
inputTokensInteger, 0 or moreYesFresh input tokens across the session.
outputTokensInteger, 0 or moreYesOutput tokens across the session.
cacheReadTokensInteger, 0 or moreYesTokens read from the prompt cache.
cacheWriteTokensInteger, 0 or moreYesTokens written to the prompt cache.
costUsdNumber, 0 or moreYesThe session priced from the price list by the CLI. On a billed session it is the metered charge. On an imputed session it is the value of the work at API rates, not a charge.
costTypebilled or imputedNoWhich ledger the session belongs to. When omitted, the server looks at the tool's declared subscriptions: imputed if any is a seat subscription, billed if all are metered, and imputed when the tool has none. Older CLIs omit it.
subscriptionPlanString or null, default nullNoThe plan a seat session ran under, such as pro, max_5x, max_20x, team_standard, team_premium or enterprise. Older CLIs send the generic max or team.
consumptionValueUsdNumber, 0 or more, default 0NoUsage value of the session. Stored as 0 on a billed session. On an imputed session the server uses it, falling back to costUsd when it is 0.
unmatchedTurnsInteger, 0 or more, default 0NoTurns whose model the CLI could not price. Their cost is left out, not counted as zero.
mergedPrNumberPositive integer or null, default nullNoThe pull request number, when the session shipped through a merge.
mergedAtISO 8601 timestamp or null, default nullNoWhen the work reached the default branch, or was pushed.
repoNameString, at least 1 characterYesRepository name. The CLI sends unknown when it cannot resolve one.
gitBranchString or nullYesThe branch the session ran on. The key must be present; null is allowed.
gitAuthorEmailString or nullYesThe git email that attributes the session to a person. The key must be present; null is allowed. When the device token belongs to a person, the server keeps this value only if it is one of that person's addresses, and otherwise uses the token owner's address.
outcomeshipped, partial, abandoned, errored or unknownYesHow the session ended, decided by the CLI from git history. A settled outcome replaces a stored one, and unknown never replaces a settled one. See sessions.
turnCountInteger, 0 or moreYesNumber of turns.
filesTouchedCountInteger, 0 or moreYesNumber of distinct files touched.
sourcescraper or extensionYesThe CLI sends scraper.
workspaceIdString, at least 1 characterYesIn an envelope request it must equal the workspace of the device token, or the request fails with 400 and workspaceId mismatch. The workspace is always taken from the token.
turnsArray of turn objects, default []NoPer-turn metadata. Send the complete list every time: the server replaces a session's turns as a set.
reReadPatternsArray of objects with path (string) and count (integer, 0 or more), default []NoFiles touched in more than one turn. Validated and then ignored; the server does not store it.

Two ledger fields deserve a note. costType decides which ledger a session's dollars belong to: billed is money that leaves the bank, imputed is usage value. The API never adds the two together.

Turn object

One object per assistant turn. Unknown keys are dropped.

FieldTypeRequiredDescription
sequenceInteger, 0 or moreYesPosition of the turn in the session.
timestampISO 8601 timestamp with a UTC offsetYesWhen the turn happened.
modelString, default ""NoThe model that handled the turn. Subagent turns carry their own model.
inputTokensInteger, 0 or more, default 0NoFresh input tokens.
outputTokensInteger, 0 or more, default 0NoOutput tokens.
cacheReadTokensInteger, 0 or more, default 0NoTokens read from the prompt cache.
cacheCreationInputTokensInteger, 0 or more, default 0NoTokens written to the prompt cache.
toolCallsArray of tool call objects, default []NoTools used in the turn, by name and count.
filesTouchedArray of strings, default []NoPaths touched in the turn. The CLI sends them relative to the repository root with forward slashes, and reduces a path outside the repository to its file name. File contents are never sent.
costUsdNumber, 0 or more, default 0NoThe turn priced at API list rates.

Per-turn telemetry (upcoming)

These fields arrive with an upcoming CLI release. The current release (0.5.2) does not send them yet. Each of these is optional. A CLI that does not send them omits them, and a malformed value is dropped rather than failing the request.

FieldTypeDescription
cacheWrite1hTokensInteger, 0 or moreThe part of the cache writes that used the 1-hour cache.
thinkingTokensInteger, 0 or moreThe part of the output that was thinking.
effortlow, medium, high, xhigh or maxThe effort level of the turn.
agentTypeIdentifier, up to 100 charactersThe subagent type on a subagent turn. Absent on the main session.
cacheMissReasonLowercase identifier, up to 64 characters, such as model_changedWhy the prompt cache missed, from Claude Code's cache diagnostics.
cacheMissedTokensInteger, 0 or moreTokens that missed the cache.
toolResultTokensInteger, 0 or moreTokens of tool output fed back into the context.
speedstandard or fastThe speed mode of the turn.
compactionTriggerauto or manualWhat triggered a context compaction at this turn.
preCompactTokensInteger, 0 or moreThe context size before that compaction.

Since CLI 0.4.0 a session's turns also include its Claude Code subagents' turns, each carrying its own model, so routed work is priced as the model that did it. The session's model stays the main session's model.

Tool call object

FieldTypeRequiredDescription
nameStringYesThe tool's name, such as Read or Edit. Calls to an MCP server appear as mcp__<server>__<tool>. Arguments are never sent.
countInteger, 0 or moreYesHow many times the tool ran in the turn.
skillIdentifier matching [A-Za-z0-9][\w.:@/-]{0,99}NoOn a Skill tool call, the name of the skill that ran. CLI 0.5.1 and later. A value that does not match the pattern rejects the request.

Batch fields

workspaceSubscriptions

Seat declarations from the device, the ones you make with planck subscription add. They bootstrap a workspace's seat inventory and never edit it.

FieldTypeRequiredDescription
toolString, at least 1 characterYesThe tool the seats are for.
planString, at least 1 characterYesThe plan name.
seatCountInteger, 0 or moreYesNumber of seats.
seatCostUsdMonthlyNumber, 0 or moreYesMonthly price per seat.
billingModebilled or imputedNoMetered or flat seat. When omitted, the server infers it from the tool and plan.
currencyString, default USDNoCurrency label.

The backend applies a declaration only when the device token belongs to an owner, leader or admin, only for a tool the workspace has no seats for, and never when the plan is api, usage, metered or payg, or the seat price is 0. Seat counts and prices are set in the console. See subscriptions.

insights

Results of the CLI's local detectors. They are not the findings shown on the Findings page, which come from the server's own detectors. See findings.

FieldTypeRequiredDescription
detectorIdString, at least 1 characterYesWhich detector produced it.
scopeworkspace, repo or developerYesWhat the result is about.
repoNameString or null, default nullNoThe repository, for a repository result.
developerEmailString or null, default nullNoThe developer, for a developer result.
titleShortString, at least 1 characterYesA one-line title.
estimatedMonthlySavingsUsdNumber, 0 or moreYesThe detector's estimate.
confidencehigh, medium or lowYesThe detector's confidence.
evidenceObjectYesDetector-specific counts and session ids. Any JSON object is accepted.
manualFixString, default ""NoA short description of the fix.

The server drops results pinned to a repository the workspace does not track. A result the server has already measured on metered sessions is never overwritten.

anomalies

FieldTypeRequiredDescription
kindrepo-spike or session-outlierYesA repository's day far above its recent median, or one session far above the developer's usual.
scopeString, at least 1 characterYesThe repository name for a spike, or the session id for an outlier.
severitywarn or criticalYesSeverity.
baselineUsdNumber, 0 or moreYesThe baseline the CLI compared against.
observedUsdNumber, 0 or moreYesThe observed value.
dedupeKeyString, at least 1 characterYesSending the same key again updates the row instead of adding one.

Spikes pinned to an untracked repository are dropped.

budgets

FieldTypeRequiredDescription
scopeworkspace, team or repoYesWhat the budget covers. The CLI sends workspace and repo.
scopeNameString or null, default nullNoThe repository or team name.
monthlyUsdNumber, 0 or moreYesThe monthly ceiling.
alertChannelsArray of objects with kind (email or slack) and target (string, at least 1 character)YesWhere alerts go. The CLI sends an empty array.

The backend creates a budget only where none exists yet for that scope and name, and only for a device token that belongs to an owner, leader or admin. An existing budget is never changed from a device. See budgets and alerts.

productivityMetric

Accepted, but the current CLI sends null.

FieldTypeRequiredDescription
periodStart, periodEndISO 8601 timestamp with a UTC offsetYesThe period.
scopeworkspace, repo or developerYesWhat the metric covers.
scopeNameString or null, default nullNoThe repository or developer.
costPerShippedPrNumber, 0 or more, or null; default nullNoCost per shipped pull request.
costPerMergedLineNumber, 0 or more, or null; default nullNoCost per merged line.
timeToMergeMedianSecInteger, 0 or more, or null; default nullNoMedian time to merge, in seconds.
aiAdoptionRateNumber from 0 to 1, or null; default nullNoShare of work done with AI.

Device facts

claudeBilling

Which credential route Claude Code is configured to use on the device. The CLI sends it only where Claude Code exists, and it never contains a key or token. The same detection decides on the device whether a session is filed as billed, and the workspace uses the field to tell which devices run Claude Code on a metered route.

FieldTypeRequiredDescription
modemetered, seat or unknownYesWhether Claude Code bills per token or runs on a flat seat. unknown means the CLI could not tell.
viaLowercase identifier, up to 40 charactersYesThe route. The current CLI sends bedrock, vertex, foundry, auth_token, settings_api_key, env_api_key, api_key_helper, console_login, subscription or none. Any identifier is accepted, so a newer CLI never fails against an older backend.
anthropicOrgIdUUID or nullYesThe Anthropic organization of a Console login. null for every other route.

agentPolicyState

What the device did with the workspace's agent policy. Sent once the device has received a policy.

FieldTypeRequiredDescription
versionInteger, 0 or moreYesThe policy version the device last acted on.
modeoff, suggest or applyYesThe policy mode.
appliedBooleanYesWhether the device wrote the settings.
optedOutBooleanYesWhether the developer ran planck autopilot off.
decisionProvideroff, typesafe, local or heuristicNoThe task-decision provider in use. heuristic means the policy names typesafe but the device has no key for it.

routingInstalled

A boolean, sent only where Claude Code exists. When it is absent the state is unknown: it means an older CLI or no Claude Code, never "not installed".

agentConfig

A snapshot of how Claude Code is set up: which instruction files, hooks, skills, commands and MCP servers exist, and how large and how old they are. It is metadata only and strict at every level. A payload that carries any key not listed here, such as a file's contents, a hook's command, or an MCP server's URL or environment keys, is rejected with 400 rather than stored. Sent by CLI 0.5.1 and later.

FieldTypeRequiredDescription
schemaVersionThe number 1YesSnapshot format version.
collectedAtISO 8601 timestamp with a UTC offsetYesWhen the snapshot was taken.
tokenEstimateMethodThe string chars/4YesHow tokensEst is estimated: characters divided by 4.
hashMethodThe string hmac-sha256YesHow hash is computed.
deviceConfig setYesFacts about the device itself, such as user-level and managed settings.
reposArray of up to 500 objects, each a config set plus repo (string, 1 to 200 characters)YesOne entry per repository the CLI read. The CLI reads only repositories the workspace tracks, and the server drops any other.

Config set

A config set has six arrays, each limited to 500 items. A scope is managed, user, project or local.

ArrayItem fields
instructionFilespath: string up to 300 characters, relative or symbolic such as ~/.claude/CLAUDE.md or <managed>/CLAUDE.md, never absolute and never containing ... scope. tool: claude-code, cursor or shared. bytes, lines, tokensEst: integers, 0 or more. hash: 64 lowercase hex characters. hashKey: repo or device. mtime: ISO 8601 timestamp. lastCommitAt: ISO 8601 timestamp or null. commitsSince: integer or null.
hooksevent: one of PreToolUse, PostToolUse, Notification, UserPromptSubmit, Stop, SubagentStop, PreCompact, SessionStart, SessionEnd or other. scope. source: string up to 120 characters. count: positive integer.
skillsname: identifier of 1 to 100 characters. scope.
commandsname: identifier of 1 to 100 characters. scope.
mcpServersname: identifier of 1 to 100 characters. transport: stdio, http, sse or unknown. scope. source: string up to 120 characters.
modelSettingsscope. source: string up to 120 characters. model: a model identifier of up to 64 characters.

A hook is recorded as an event name and a count, never as the command it runs. An MCP server is recorded by name and transport, never by address or credentials. An instruction file is recorded by size, age and a keyed hash, never by content. For a project file the hash is keyed by the repository's root commit, so every clone agrees; for any other scope it uses a salt that exists only on the device.

Example

An envelope with one metered session of two turns. The session totals are the sums of its turns.

{
  "sessions": [
    {
      "sessionId": "5f0c2a6e-8d0b-4b9e-9a3e-2c1d7e4b6a10",
      "tool": "claude_code",
      "model": "claude-sonnet-5-5",
      "startedAt": "2026-10-27T09:12:04.000Z",
      "endedAt": "2026-10-27T09:48:51.000Z",
      "inputTokens": 18240,
      "outputTokens": 9310,
      "cacheReadTokens": 412800,
      "cacheWriteTokens": 36200,
      "costUsd": 0.45,
      "costType": "billed",
      "subscriptionPlan": null,
      "consumptionValueUsd": 0,
      "unmatchedTurns": 0,
      "mergedPrNumber": 412,
      "mergedAt": "2026-10-27T14:03:19.000Z",
      "repoName": "billing-service",
      "gitBranch": "fix/invoice-rounding",
      "gitAuthorEmail": "dev@example.com",
      "outcome": "shipped",
      "turnCount": 2,
      "filesTouchedCount": 1,
      "source": "scraper",
      "workspaceId": "your-workspace-id",
      "turns": [
        {
          "sequence": 0,
          "timestamp": "2026-10-27T09:12:40.000Z",
          "model": "claude-sonnet-5-5",
          "inputTokens": 9000,
          "outputTokens": 4100,
          "cacheReadTokens": 200000,
          "cacheCreationInputTokens": 20000,
          "toolCalls": [
            { "name": "Read", "count": 2 },
            { "name": "Edit", "count": 1 }
          ],
          "filesTouched": ["src/invoice/round.ts"],
          "costUsd": 0.22,
          "effort": "medium",
          "speed": "standard"
        },
        {
          "sequence": 1,
          "timestamp": "2026-10-27T09:31:07.000Z",
          "model": "claude-sonnet-5-5",
          "inputTokens": 9240,
          "outputTokens": 5210,
          "cacheReadTokens": 212800,
          "cacheCreationInputTokens": 16200,
          "toolCalls": [{ "name": "Bash", "count": 1 }],
          "filesTouched": ["src/invoice/round.ts"],
          "costUsd": 0.23,
          "effort": "medium",
          "speed": "standard"
        }
      ],
      "reReadPatterns": [{ "path": "src/invoice/round.ts", "count": 2 }]
    }
  ],
  "cliVersion": "0.5.2",
  "routingInstalled": false,
  "claudeBilling": { "mode": "metered", "via": "env_api_key", "anthropicOrgId": null }
}