How usage gets from a computer to a private account and a team. The simple path comes first; everything after the export section is advanced guidance that the simple path never needs. Status markers: [shipped] works in the current build, [planned] is designed and agreed but not yet implemented.
On this page
- The simple path
- Live activity and saved reports
- Worked examples
- Exporting a usage report [shipped]
- Server status reports
- API keys
- Legacy reporting integration (advanced)
- The two commands [shipped]
- Fields [shipped]
- Attributing a project: the .tmatic file (advanced)
- Custom sharing rules (advanced)
- Manual sync: tmatic push and tmatic pull (advanced) [shipped]
- The team registry [planned]
- Privacy line [shipped]
- Session reference links
No sections match. Try another word.
The simple path
One setup, once per computer:
- Install the app and sign in. Use the account's email and password. From then on the computer syncs the person's own usage to their own devices and the web Usage and Sessions pages. Free needs no checkout, subscription, trial or team membership. [shipped]
- Join the team. Open the team's invitation link and accept it. Joining makes the person a member; it publishes nothing by itself.
- Choose Everything once. Each computer holds one sharing choice per team: Everything, Nothing or Custom. On the web it lives under Settings, Sharing, Rules, Team sharing: the dialog names the team and the scope, starts with no mode picked and the agreement box unticked and sends the choice only when the person picks a mode and ticks the box. The person never handles a grant record or an encryption key. [shipped]
What a recorded choice does:
- The server stores it durably with a revision and an immutable event log and enforces it on every Team write path: Nothing refuses publication from that computer, Custom narrows it and Everything leaves the existing permission checks unchanged. A withdrawal takes effect inside the database write itself, so work queued before it is refused, not sent. [shipped]
- Sending under these choices is not switched on yet. Every sharing-choice
response carries
publication: { available: false }and the Team project routes sit behind a rollout flag that answers503 service_unavailablewhere it is off. Nothing publishes until the server activates publication. [planned] - Personal sync never depends on the choice. A Nothing choice for a team leaves the person's own Solo sync, authorized reads and local recording untouched. [shipped]
The person keeps control after the choice. Changing or withdrawing it is the same dialog. Pausing their own hosted publication across every installation they own and leaving the team entirely are one API call each (see the API reference). The web controls live in Settings: the pause under Account, Security and leaving under Workspace, Organizations. The native controls are still being built against the same routes. [shipped API and web controls, planned native controls]
Live activity and saved reports
Live Pulse shows current activity from connected Macs. Combined adds those sources into a fleet view. Separate shows one source. Remote Live Pulse is a Pro benefit for a person's own fully paired devices. It sends encrypted live readings through the relay and does not store Pulse history there.
Saved sessions, usage exports and reports use recorded history. They remain separate from the live connection and its remote entitlement. See the Live Pulse guide for setup and the API reference for endpoint auth.
Worked examples
A Git repository
Sam works in ~/work/platform-api, a clone of the team's Git repository.
- Sam installs Tokematic and signs in with the account email and password. The day's usage appears on Sam's own web dashboard. No checkout: Solo is free.
- Sam opens the invitation link from the team's administrator and accepts. Sam is now a member and nothing has been published.
- On the web under Settings, Sharing, Rules, Team sharing, Sam picks this computer, reads the named scope, ticks the agreement box and chooses Everything.
There is nothing to put in the repository. Sessions Sam runs in
~/work/platform-api are attributed to the platform-api project
automatically. A repository under NDA can add a .tmatic file with
"private": true so its name and titles never leave the device; the file
restricts and never grants (see the advanced section below). When the
server activates publication, this computer's permitted work flows to the
team under the recorded choice; until then it stays local and private to
Sam.
Another source control system
Sam's third project is ~/work/legacy-tools, a working copy kept under a
source control system that is not Git.
Tokematic reads no other system's metadata, so the same three steps cover
it and attribution follows the plain-folder rule: sessions run there are
filed under the folder, never under a repository name. Nothing in the
working copy needs to change and a .tmatic file restricts or attributes
exactly as it does anywhere else.
A plain folder
Sam also works in ~/Documents/client-notes, a folder with no source
control at all.
The same three steps cover it: the folder needs no metadata of any kind.
If Sam wants harness runs there attributed to a team, a .tmatic file
with "team": "platform" does it; without a file the folder follows the
sharing choice like everything else.
Exporting a usage report [shipped]
Dashboard's Export usage button downloads the usage report for the workspace, period and filters on screen. It works on free Solo and for every Team member. The report is built in the browser from the sessions the Dashboard already selected for this reader; it never fetches, so it can hold nothing the page did not already show, and exporting publishes nothing of the reader's own.
- CSV and JSON (
tokematic-usage-report/1): one row per local day, project, vendor, model and ticket, with token counts and a list-price cost estimate. - Google Sheets: a one-way copy to a spreadsheet the person chooses, behind an operator setup gate; without that setup the button reads "not set up" and the other exports work.
- Finout files: a ZIP of one CSV per day, which the person uploads to the bucket their cost tool reads.
Titles, summaries, comments, vendor session ids, Session IDs, device ids,
credentials and keys never appear in any format. The full format,
authorization rules and setup steps are in
USAGE-REPORT-EXPORT.md. The separate personal
account export (GET /v2/account/export) pages the account's own stored
records and is documented in ACCOUNT-EXPORT.md.
When earlier local session logs have multi-week gaps from agent retention
cleanup before continuous history begins, Dashboard and Sessions detect the
oldest complete date (completeFrom) alongside the earliest recorded
session (firstSessionDate). Selecting All time starts at
completeFrom and shows a status note with a one-click button to include
earlier partial logs; viewing a range that starts before completeFrom
alerts the reader that earlier logs are incomplete and offers a one-click
button to narrow the window to completeFrom. [shipped]
Server status reports
Reporting stores report settings separately from source access. A user can save the processor, recipients and daily, weekly or monthly schedule while generation is blocked. The reader keeps showing saved reports.
The source-access design is awaiting a product decision (#657). The production
source adapter always returns source_data_unavailable. There is no API input,
environment switch or API key that can bypass this gate. The generation path
does not decrypt synced records, upload source copies or call a model while
the gate is closed.
The server pipeline uses the same calendar and time-zone rules as existing reports. It records due jobs without creating empty reports or mail. It does not dispatch report-generation or mail-render commands to Macs. Blocked jobs stay distinct from missing activity, failed generation and completed reports. Opening source access later will require an explicit migration and backfill plan. Saved blocked jobs do not grant approval to email a backlog.
Behind the gate, the engine composes Full, Medium and Light together. AI work stays separate by vendor and project. Prior contributions must match the vendor, project, scope and cadence. Measured facts remain separate from model text. Source snapshots must carry their period and revision. Changed settings or revoked access stop publication. Usage receipts survive canceled output.
The report's time measure (time.human_seconds, shown as "Hours at keyboard"
on a daily report and "Time" on a weekly or monthly one) is the Dashboard's
active hours for the same period, in seconds. It counts every session the
store holds for the window, on every device and from every vendor. Each
session's span is clipped to the period and capped at 15 seconds per recorded
call (one minute at least, one hour when the call count is unknown), helper
sessions are left out and overlapping spans merge, so parallel sessions never
multiply elapsed time. The presence breakdown beside it (attended_seconds,
unattended_seconds and unknown_seconds) comes from this Mac's recorded
presence and never adds to the hours figure.
time.hour_seconds splits the same merged spans by the report's local date
and hour, as {date, hour, seconds} entries, so they add up to
human_seconds exactly. Working Patterns (the weekly timeline and the
monthly week totals and rhythm) draws these entries, so its total always
equals Time. Hours are computed once, in ThreadsDomain.activeIntervals;
the Dashboard, human_seconds and hour_seconds all read it. The cases in
fixtures/hours/active-hours.json are worked by hand and checked by the
Swift, Rust and web suites. A report without hour_seconds (made before the
field existed, or by the server) falls back to usage stamps clustered five
minutes apart, which undercounts: an hourly usage row stands for one minute.
A Mac posts each personal report it finishes to POST /v2/summary-jobs/personal-complete and keeps a delivery receipt per
period, source revision, content revision (a digest of the stored body)
and destination (server, account and group) in delivery-receipts.json
beside the scheduler state. A failed upload is retried at the next report
check, at 04:00 local and at wake; a report stored before receipts existed
is sent the same way. The pass posts newest period first (for one period
start, monthly before weekly before daily), so a backlog drains in one
check and the recent weeklies and monthlies reach the web first. A report
the server refuses on its own account (a 4xx other than 401, 403 and
429, or a body that will not seal) is held back for a day while the pass
carries on to the reports behind it; a connection error, a 5xx, 401,
403 or 429 ends the pass until the next check. A delivered report is
never posted to the same destination again; a Regenerate that writes a
different report over the same sources is delivered again, and a switch of
account or group delivers to the new destination. Deliveries of one period
run one at a time and each posts the newest stored revision, so a retry
never lands an older revision after a Regenerate. The person gets one
email per cadence when a period closes: yesterday's daily, last week's
weekly and last month's monthly. That email belongs to the period, not to
one version of the report. Just before the scheduler runs the latest
closed period of a cadence, it notes that the period owes its email
(email_intents in delivery-receipts.json), before the report is
written. Nothing else ever does: Generate now, Regenerate, backlog
catch-ups and "so far" previews of the week or month never note it. While
the email is owed, any delivery of that period asks for it
(send_email: true): the first scheduled upload, its retry or a later
Regenerate when the scheduled upload failed or the Mac signed in later.
Each delivery checks again, when its turn comes, that the period is still
the latest closed one. The email is paid, and the period never asks again,
once the server answers that it sent the email or will never send it for
this period (the period is no longer the latest, or it was already
emailed). When the server stores the report but cannot email yet (an
unconfirmed or bounced address, a refusal by the mail service, a paused
schedule), the email stays owed: the next check posts the same report
again to ask, even though the report itself was delivered, and the server
takes that repeat as an email retry without storing a second copy. When
the mail service refuses the report itself for good (it answers a 4xx
other than 429), that content never asks again; the email stays owed,
so a Regenerate that writes different content asks once more. A
period with no note never asks. A delivery-receipts.json from the
earlier format (send_email and claimed_at per period) keeps its
meaning: a scheduled claim is owed until a delivered receipt carries its
body digest, and a manual claim stays email-free. The server emails only the latest closed period of the
cadence in the report's time zone at receive time, once per period, so a
late upload from a Mac that was asleep or offline still emails. It counts
one email per period by its dates, so two Macs with different first
weekdays or time zones never email the same day twice, and a Mac upload
and the server's own scheduled delivery of the same period send one email
between them. It skips email when
a newer period of the same cadence, time zone and first weekday is already
stored. Without a hosted account
nothing is attempted. The body is deflated (a zlib stream) inside the
seal, so most monthlies fit the route's 1,900,000-character ceiling; email
text goes up to 1,000,000 characters. A sealed body
over 1,800,000 characters goes in parts of at most 1,500,000: the Mac
uploads parts 1 onward under an upload id made for that attempt, then
posts part 0 with the part count and the whole string's SHA-256. A part
the server refuses counts like a refused post (a 4xx other than 401,
403 and 429 holds the report back a day, anything else ends the
pass), and the next attempt uploads its parts again under a new id. The
web fetches the remaining parts, joins them and checks the digest before
it opens the report; a report whose parts do not match reads as one that
could not be read.
The owner can delete a report from the Mac's Reports window. After a
confirmation the Mac removes its copy with the period's receipts and
email note and writes a marker in deletions.json beside the scheduler
state, so the scheduler leaves that period alone, "so far" previews
included. It then calls DELETE /v2/summary-jobs/personal/{cadence}/{start}?op_id=, which raises the
period's generation, marks it deleted, removes the owner's stored results
for those dates in every time zone and first weekday and cancels an email
that has not gone yet. When the Mac is offline, signed out or the server
answers 503, every scheduler check retries with the same operation id,
and only while the same account is signed in; only that account's uploads
of the period wait for it. Every report keeps the generation it was made
from: a run reads the period's current generation first (offline, the
last one the server named), and an automatic run skips a period the
server shows deleted. The server stores a report only at the current
generation, and a deleted period's only from Generate now or Regenerate,
which restores it. A copy made before a delete is refused
(409 report_stale) and the Mac removes it if it is still the stored
copy; when that copy was the owner's Generate now, the page says "This
report was deleted on another device. Generate it again." Each check
also reads GET /v2/summary-jobs/personal/deletions?after= (the cursor
is kept per account, whatever group) and removes copies made from an older generation. A report's generation belongs to the account it was read for, and a run that was composing when the owner deleted the period does not save.
No device clock is compared.
Scheduled mail uses the existing email service and a stable per-recipient delivery key. Each send requires fresh source and recipient authorization. Uncertain delivery outcomes are held for review rather than retried. The production mail authorization gate is also closed. Tests use invented source snapshots and fake provider replies. They do not authorize real source access.
Personal reports are free. A free user opens Reporting and works with their own personal reports, optionally narrowed to one project. Team, group and organization reports need an active Pro seat, trial or approved grant. One Pro plan unlocks the same features for one seat or many. In the report editor the Scope choices that need Pro read "(Pro)" on Free, and choosing one shows "Team and project reports need Pro." with Get Pro and See a sample. The server checks access again when a job runs or sends mail.
A per-person report is never shared unless that person sets up automatic emailing of it. No role, view, filter, schedule, export or API read exposes another person's report. Team and organization reports describe the team.
Configuration access also uses existing roles. Personal reports are self-only. Team settings require an active organization administrator and group settings require an active team administrator. These checks grant no right to read another person's work. Organization reporting remains unavailable until the existing account policy can prove Enterprise entitlement.
Report routes under /v2:
| Route | Purpose |
|---|---|
GET /reporting-context |
Available configuration scopes, projects and recipients |
GET /reports |
Owned settings and current capabilities |
PUT /reports |
Revision-checked settings and schedules |
POST /reports/:id/generate |
Request a report; returns a recorded blocked state while source access is closed |
GET /reports/:id/runs |
Owned run states without source text |
GET /reports/:id/results |
Saved report bodies or calendar metadata |
GET /reports/:id/index |
Which periods have a report, for every cadence, plus one report to open |
GET /reports/:id/index is what the web Reports page reads. Its query takes
tz and week_start (the reader's calendar), optional project and
member, since (the last version the reader holds) and, to open a report,
cadence and open (the period's start date). The reply is
{version, periods, open}:
periodslists, fordaily,weeklyandmonthly, each period'sstart,end,state,generatedAt,sourceandresultId. It holds no report text. Whensincematchesversion, the reply carriesunchanged: trueinstead ofperiods.- A personal report can have two copies of a period: the server's generated
result and the sealed copy a device made. The newer copy is listed, with
sourceset toserverorarchive. openis the requested report: a serverbody, or a device's sealedresultthat the browser opens with the unlocked key. It isnullwhen that period has no report.- The id
saved-personalreads the device copies of a user with no saved personal report. Ownership and the Pro rule are checked on every read.
The page keeps the index and sealed results in this browser, so a return visit paints at once and the server's answer then confirms it. Server bodies are never stored in the browser. Sign-out clears the copy.
Sessions that run past midnight
A daily report describes only that day's turns of a session. A session
that started one evening and ran past midnight is in both days' reports,
and each day reads a summary of the turns inside its own window, never
the whole-session summary. That summary is put together by code from the
one-line turn summaries saved as each turn finished, with no engine asked.
Only a session with no saved turn line inside the window is summarized by
its own engine (or on this device, when the person chose on-device only). The session row's
start, end, turns and tokens stop at the window's edge too. When no
bounded summary can be made (summaries off for that vendor, the vendor
out of quota, a transcript that cannot be read), the session contributes
its facts line alone. A helper with no turns inside the window is left out
of that day's summary with its brief, so a helper spawned the next morning
never reaches the evening's report, and a helper that started the day
before keeps only its turns inside the window, without the brief it was
given before the window opened. A whole saved summary is read only when
the span it recorded lies inside the period too; one rewritten after the
session ran on past midnight is replaced by a bounded summary. A weekly or monthly report reads the whole saved
summary of the same session, because the session lies inside that
period. Bounded summaries are kept under summaries/bounded, keyed by
session, window, detail level and the session's last change, so Generate
now and the weekly and monthly runs do not pay the engine again, and a
session that grows after it was summarized gets a fresh one. Remove
content and forget take every window's summary of the session with the
whole one, including one that another process is saving at that moment. Progress on
the Reports settings page shows "Summarizing N sessions" while they are
made.
Report title and key achievements
Every personal report opens with a crisp title and a short list of key achievements. The Mac writes them after the period's session summaries exist: the period's sessions are grouped by the engine that wrote each summary, one group per vendor and one for this Mac, and each group is condensed by that same engine from its own summaries alone. Code merges the answers, ranks them by the weight of the sessions behind them, drops repeats and caps the list at 5 for a day, 8 for a week and 10 for a month. Achievements rank by the commits then the tokens of the sessions behind them, within and across groups. A session whose summary no model wrote, or whose goal is still the brief's role prompt ("You are the implementer..."), ranks last and never leads the title.
The title is at most 12 words and names the main project and its
concrete outcome; each achievement is one clause of at most 14 words.
When one engine condensed every session, its headline is the title. With
Each vendor's AI and several vendors, the title is the headline of the
vendor that wrote the lead achievement, written over its own sessions
only; when code wrote the lead, the title is the top project and its top
achievement. With Apple Intelligence and a group code wrote as well, this
Mac's on-device engine writes the title over the merged achievement list
(project and outcome per line, never session text); that request is
receipted in the ledger at no cost. When the device engine is unavailable
or fails, the title is the top project and its top achievement. When no
engine can answer at all, the Mac derives the block from the session
headlines instead and marks it fallback: true. The report is always
written.
Who writes the title (Mac)
On the Mac, the person chooses who writes the title and key achievements
of every report, scheduled or made with Generate now. The Reports
window's generation settings (the cog in the title row) and
Settings > Reports > Write reports with set the same preference,
reports.engine:
- Apple Intelligence (
appleIntelligence): this Mac's on-device engine condenses every session's saved summary, whoever wrote it, and writes the title. A session that crosses the period's edge is summarized over the period on this device only. No vendor gets a request for the report; when the device engine fails, that session gives its facts alone. - Each vendor's AI (
vendor, the default): one request per vendor, all asked at the same time. A session whose saved summary this Mac wrote goes to the session's own vendor too, and this Mac's engine is never asked. The vendor that wrote the period's lead achievement writes the title from its own sessions. The session summaries a run makes for the report are written by each session's own vendor at every detail level, unless Settings > Sessions keeps every summary on this Mac. - Facts only (
facts): no engine is asked, and no session is summarized over the period: a session that crosses its edge gives its facts alone. Code takes the title and achievements from the session headlines, and the Reports window draws the body with the facts-only processor: facts, counts and the session list without narrative.
The run reads the choice once, at its start, and every report request follows it, including the missing session summaries a run makes first: Facts only makes none, Apple Intelligence makes them on this Mac alone (a session it cannot summarize gives its facts) and Each vendor's AI asks each session's own vendor first. On a Mac where Apple Intelligence is not available, its choice is turned off with a one-line reason, and a saved Apple Intelligence choice makes a Facts only report, never a vendor request. That report says so ("Apple Intelligence is not available on this Mac, so this report uses Facts only.") and offers no Regenerate. Outside a report run, Settings > Sessions decides how a session's own summary is made.
A run spends a fixed time asking engines for session summaries: two
minutes for Generate now or Regenerate, fifteen for the scheduled run.
It makes them one session at a time, and the step line counts them
("Making missing summaries: 3 of 15…"). When the time is spent, each
session still without a summary gives its saved turn lines, or its facts
when it has none, and the report is written. The log records how long
each step took and how many summary requests the run made. The
body records the choice as report_engine (absent on an older report,
which reads as vendor). When it differs from the current choice, the
Reports window shows Report engine changed with Regenerate now,
which applies the new one. The hosted web keeps its own processors.
Session narrative fields
Every per-session summary carries a structured_narrative the reports
read: summary_line, goal, goal_shifts, result, output,
still_open, next_step, blockers and decision_needed. The engine is
told that goal is one sentence in its own words naming what the person
wanted, never a quotation of the request and never a role instruction;
that result and output hold concrete outcomes in past tense, never the
agent's status or plan; and that decision_needed is a question only the
person can answer, stated as the question, or Not recorded, never the
agent's own planned next action. A suggested next_step is labeled
Suggested.
"structured_narrative": {
"summary_line": "Integrations mockup built for #999",
"goal": "Build the Integrations settings mockup for review",
"result": "Built the mockup and linked it from the ticket.",
"output": "Mockup page and ticket comment",
"still_open": "Review on stage",
"next_step": "Suggested: open the mockup on stage",
"decision_needed": "Should the mockup live in the customatic repository?",
"goal_shifts": [],
"blockers": []
}
The web reader's What's next list holds only Decisions, taken from
decision_needed. A session's still_open and next_step are the
agent's own work plan and are not listed, whatever their wording. The
list is grouped by project, each project named once, with at most three
decisions per project and eight per report. A decision line carries no
label: the heading says what it is, and the reader drops the Decision:
label older bodies carry. A body saved before the field existed shows no
What's next list.
A session with no project of its own is filed under its parent's project
first, then under where it ran: Codex chat for a Codex chat given no
project (its folder under ~/Documents/Codex/), Antigravity (no folder)
for an Antigravity conversation opened without a workspace, Home for a
home folder, Temporary folder for a temporary folder and otherwise the
folder's own name. Only a session with no folder and no client known stays
Unassigned (unassigned_attribution in reports.rs).
The condensed block's usage lists each engine's requests and tokens for
the title and key achievements (engine is device for this Mac or a
vendor id; input and output are absent when the engine reports no
counts). The Generation section shows these rows in a table. A report
without them has nothing to open, so Generation is one line under Commits
naming the engine.
Antigravity writes its group's title and key achievements with
gemini-3.8-flash-low and is told to answer through agy's finish tool.
Asked for plain JSON, the model answered in text and agy asked a second
time, sending the prompt and the first answer again; with the medium model
most of its output was reasoning. Session summaries keep
gemini-3.8-flash-medium and the same finish instruction.
Full detail lists one entry per session. A daily or weekly report lists them in date order, oldest first; a monthly report leads with the most significant work. Summary boxes are plain text under their project and section headings.
A Generate now for a period with no work inside it (sessions open across the period but idle in it) is no error: the Mac lists the period as No data until a report is saved for it or the app restarts.
The body carries the block as condensed:
"condensed": {
"headline": "tokematic: Landed the Rust report engine",
"achievements": [
{ "text": "Landed the Rust report engine", "project": "tokematic", "session_ids": ["..."] }
],
"engines": ["claude", "device"],
"generated_at": "2026-10-21T04:00:00Z",
"fallback": false
},
"report_engine": "vendor"
engines names each vendor that condensed its own group and device for
this Mac. work_items and the per-session material stay on the body for
Full detail. A report saved before the block existed has no condensed
and the reader shows its first lead as the title instead. When any session
of the report has its content removed, every reader drops the whole block
and shows the report without it, because the title may draw on any of the
report's sessions.
The Reports settings page has Extra instructions for every report. They go to each condensing engine ahead of Tokematic's own instructions, the way the Sessions instructions reach every summary. Generate now condenses again, so a changed instruction shows on the next report.
API keys
Sign in with your account email and password, then open Account > Credentials in web Settings. Create, inspect, copy connection details for or revoke API keys from that page. It lists your personal keys alongside the keys of every organization you administer. In the desktop app, Settings opens that web page directly.
Choose Personal or an organization and give the key a descriptive label. Enable Read usage records (records:read). Enable Add tags to sessions (annotations:write) as well when the script updates session tags. Save the secret in a secure store as soon as it appears because the list displays it once. Send it in the HTTP header Authorization: Bearer <secret>. Revoking a credential stops future requests immediately.
Scopes and access rules
External v2 credentials carry two independent permissions:
records:read(Read usage records): reads synced group usage records (GETorQUERY /v2/groups/{prefix}/records), tagged session rows (GET /v2/groups/{prefix}/session-tags), approved tag values (GET /v2/groups/{prefix}/tags/approved) and session content removals (GET /v2/groups/{prefix}/session-removals).annotations:write(Add tags to sessions): updates session work tags (PUT /v2/groups/{prefix}/sessions/{provider}/{sessionId}/tags) and record labels (PUT /v2/groups/{prefix}/annotations/{recordId}).
API keys never overwrite or delete source usage records. Account management endpoints (GET /v2/account and GET /v2/api-keys) require a signed-in account session.
Personal API access is free on Solo with no subscription or trial. Organization keys require an active Pro plan (payment_required when unpaid) and active membership in that organization (membership_required otherwise). Only an organization administrator can create or revoke an organization key. Choose Connection details on the credential's row to copy its Group prefix and API base URL. When a Pro organization uses project-scoped transport (record_transport: "project"), the group record and tag routes return 409 migration_required because access follows per-project grants.
Rate limits and shared budgets
Credentials belonging to the same owner share durable hourly and daily counters plus a calendar-month budget. Rotating a secret or creating an extra key uses those same shared counters. Accepted reads and retries count toward the budget; requests rejected by a budget check do not.
When a budget window fills up, the server responds with 429 (api_budget_exhausted or rate_limited), Retry-After, retry_after_seconds and the affected windows. Wait for the Retry-After duration (defaulting to 60 seconds if omitted) before sending the next request. Do not erase local data or encryption keys when a budget error arrives.
Cursor pagination for UsageReport records
Fetch usage records a page at a time with records:read using GET query parameters or RFC 10008 QUERY with a JSON filter body:
GET /v2/groups/{prefix}/records?type=UsageReport&limit=100
QUERY /v2/groups/{prefix}/records
Content-Type: application/json
{"type":"UsageReport","limit":100}
QUERY requests carry all filter fields in the JSON body and reject URL query parameters (400 no_query_parameters_accepted). Both GET and QUERY remain active and undeprecated. Each 200 response returns { "records": [{ "name", "version", "fields", "updated_at" }], "next_cursor": "..." }:
limit: optional integer from1to1000(default100). A page stops before a record would push storedfieldspast4 MiB, always returning at least one record when data remains.cursor: passcursor(&cursor=<next_cursor>onGETor"cursor": "<next_cursor>"onQUERY) on the next request with the same query filters untilnext_cursorisnull. Always checknext_cursorfornullto detect the last page.fieldandequals, orfromandto: filter on an exact plaintext column (field=team&equals=platformor{"field":"provider","equals":"claude"}) or an inclusive-lower, exclusive-upper range (fromandtopaired withfield).since_version: non-negative integer returning records whose per-recordversionis strictly above that number. Keepsince_versionconstant across every page of a walk.select=index(or"mode": "index"onQUERY): returns{ "name", "version" }rows (limitup to5000, with no4 MiBbyte cap) so a cached reader can compare versions and fetch changed records individually withGET /v2/groups/{prefix}/records/UsageReport/{name}.
Readable UsageReport fields include provider, model, input, output, cacheRead, cacheWrite, cost, durationMs, job, team and tags. Protected identity fields (account, description, host and keyLast4) stay $enc-encrypted when sealed under the group key.
Session work-tag payloads
Session work tags store five camelCase fields keyed by (group, provider, sessionId): customer, costCenter, workType, ticket and comment.
Here sessionId is the vendor's session ID paired with provider. Note that UsageReport record names and the short IDs accepted by tmatic --session use separate identifiers. Call GET /v2/groups/{prefix}/session-tags (records:read) to list tagged sessions along with each row's provider and sessionId.
With annotations:write, send PUT /v2/groups/{prefix}/sessions/{provider}/{sessionId}/tags:
{"customer":"Acme","workType":"Research"}
Omitted keys keep their existing values. Passing null ({"workType":null}) clears that single field. When an organization restricts allowed values for a tag field, inspect GET /v2/groups/{prefix}/tags/approved first; an unapproved value returns 422 unapproved_value with unapproved: [{"field","value","approved"}].
The legacy PUT /v2/groups/{prefix}/annotations/{recordId} endpoint accepts {"tag":"reviewed"} or {"tag":null} for a separate plain label on one UsageReport record. See Use the Tokematic API and the API reference for interactive endpoint schemas.
Legacy reporting integration (advanced)
The harness author's guide to telling a Tokematic group what a run spent.
Each run writes UsageReport records; the sections below cover the CLI flags, which fields travel sealed or readable, how retries stay idempotent and how runs map to a team.
The two commands [shipped]
One batch job, one command:
tmatic usage record --provider <name> --input <n> --output <n> \
[--key-last4 <abcd>] [--cache-read <n>] [--cache-write <n>] \
[--cost <usd>] [--desc "<text>"] [--tags <a,b>] [--duration-ms <n>] \
[--job <name>] [--team <id>] [--model <name>] [--id <token>]
Wrap a whole run and let it speak for itself:
tokematic run [--desc "<text>"] [--tags <a,b>] [--team <id>] -- <command> [args...]
run passes the child's output and exit code through untouched. A child
that prints TOKEMATIC: lines on stdout reports per model (one line per
model, never one per job: a big-model row and its cheap sub-agent row
price correctly only as separate rows tied by one job value):
TOKEMATIC: {"job":"nightly-etl","provider":"claude","model":"...",\
"input":1200,"output":340,"team":"platform"}
A wrapped claude -p --output-format json run needs no protocol lines:
its result blob is read as a fallback.
Both commands are fire-and-forget: exit 0 and silent on success, exit 1 with usage on stderr for a mistyped command, exit 2 with one line when the report could not be delivered. A CI step keys its retry on 2.
Legacy CLI credentials use TOKEMATIC_API_TOKEN and TOKEMATIC_GROUP with an optional TOKEMATIC_API_BASE. The legacy commands below retain their v1 wire behavior and do not imply v2 source-write permission. New API access is managed on the web; native settings open that management page.
Fields [shipped]
Required: --provider, --input, --output. Everything else is
optional and omitted rather than zeroed when absent.
--job <name>: the harness's own name for the unit of work. Rows sharing a job are the same run priced per model.--team <id>: the team this spend belongs to. A slug: lowercase ASCII letters, digits and dashes, at most 40 characters, validated at parse time because a typo silently splits a team in two on every dashboard. Example:platform,client-x.--tags <a,b>: free-form labels, comma-joined on the wire. Empty entries and surrounding space are dropped.--desc "<text>": human description. Sealed when the group key is held, plaintext only because the user typed it into the command.--cost <usd>: what the run cost. When absent, the client prices the counts from its own model table, so most callers never send it.--key-last4 <abcd>: ties the row to a managed account when the key is one the app knows. Reports without it name no account and still count.--id <token>: the event's identity. The record is named after it, so a step that retries on exit 2 and passes the same id is one event to the server however many attempts it took: a create the server already holds is acknowledged, never counted twice. Letters, digits, dots, underscores and dashes, at most 64. Omitted, the client mints a UUID per attempt, which is right for a caller that never retries.runneeds no flag: each of its rows carries an id from the moment it is first sent, through the spool and every replay.
job, team, model and tags travel readable: they are the
rollup's grouping columns and none of them names a person. account
always travels sealed or not at all. A group whose team names are
themselves sensitive should use opaque ids (team-a) and keep the
display names in the team registry below.
Attributing a project: the .tmatic file (advanced)
A JSON file at the project root. .tmatic is the default name. Existing
.tokematic and .tokenmatic files remain supported. The folder does not
need source control metadata.
{
"schema_version": 1,
"team": "platform",
"tags": ["client-x"],
"private": true,
"project_id": "project:alpha-1",
"sync": { "mode": "manual" }
}
Anything Tokematic reads from inside that repo inherits the file:
tmatic usage record and tmatic run walk up from the working
directory when --team is not passed, and the thread harvester
(docs/THREADS.md) applies it to every conversation whose transcript
records a matching cwd. Version-controlled, shared by everyone who
clones and zero per-session effort.
Precedence, highest first: an explicit flag or protocol line, the project file, an app-level rule (Preferences: path, glob or git remote to team and tags), the vendor account's default tags.
The search walks up from the working directory and stops at the nearest
configured folder, whether or not the files there read cleanly. Within that
folder, the first supported file that reads without a publication-blocking
problem supplies the attribution, in the order .tmatic, then .tokematic
and then .tokenmatic. Restrictions never drop: the privacy flag and the
summary omissions of every supported file present stay effective, including a
valid alias beside an invalid .tmatic. Conflicting team, tags, work tags or
project IDs across files mark publication blocked; conflicting publishing
modes also block and resolve to manual, the safer side. Invalid JSON stops
the parent search and also marks publication blocked. No client renames or
deletes a legacy file.
Files must be regular files of at most 64 KiB. Symbolic links, unreadable files and protected locations block publication. The JavaScript reader also accepts a permitted root boundary. It resolves folder links before enforcing that boundary and reads no configuration beyond it.
schema_version is optional for legacy files. When present it must be the
number 1. Unsupported versions block publication. Unknown fields are
ignored, but invalid privacy fields and unknown summary omission names block
publication because the reader cannot safely apply those restrictions.
project_id binds to an existing server project. It accepts 1 to 128 ASCII
letters, digits, underscores, hyphens or colons. It does not create a project
or grant sharing rights. sync.mode accepts automatic or manual, with
automatic as the default. A manual setting applies only when selective sync
is enabled for that installation. Server selection and current policy
agreement still limit publication.
The file can also set folder defaults for the five session work tags:
customer, costCenter, workType, ticket and comment, spelled as the
server spells them. Values are trimmed and an empty one is dropped; comment
keeps at most 500 graphemes and the others 200.
Checking a folder: tmatic project [shipped]
tmatic project [DIR] [--json] reads the project file for a folder
without writing anything. It names the file or files found, the team, the
privacy bit, the server project binding the file restricts to, the
publishing mode in force and its source (the file or the default) and
prints each reason when a file is invalid or two files disagree. With no
file it says publishing follows the person's sharing choice; no file is
needed. It exits 1 when the file pauses publication, so a script can stop
on it. The Mac's tmatic forwards project to the bundled helper.
Server-selected scope, automatic sync by default
Publication scope is selected on the server, never by a file or a command.
GET /v3/sharing-state answers the projects, grants and organization
policies in effect for one installation, plus that installation's
preference. A .tmatic file can bind a folder to an existing project,
restrict what leaves it and ask for manual publishing; it cannot create a
project, select a scope or grant access, and neither can a command-line
flag.
Sync is automatic by default. An installation can turn on selective sync in
the web device settings (Sync selected projects only, stored through
PUT /v3/installations/{id}/sync-preferences). With selective sync on, a
folder whose file says "sync": { "mode": "manual" } waits for an explicit
push: automatic cycles skip it. With selective sync off, everything the
server selected syncs automatically and the manual mark has no effect.
An organization policy can require automatic publishing for a scope
(require_automatic in the sharing state). Publication then waits until the
person holds a current agreement to that policy (policy_allows_publication
in the same response). A manual preference never overrides an agreed
require-automatic policy.
The local decision helper maps these facts to one outcome per folder and
trigger: notSelected (the server did not select the project),
invalidConfiguration (a file blocks publication),
policyAgreementRequired, manualOnly (an automatic trigger met a manual
folder under selective sync) or allowed. An allowed result neither
authorizes nor sends an upload by itself: privacy redaction still applies
and pull access is a separate decision.
These fields and local decision helpers are implemented in the readers. Collector dispatch integration is still pending. Saving this file does not prove that a client applied the publishing preference or sent data. See the project configuration guide for validation, runtime coverage and remaining integration work.
private: count my tokens, never name me
A repo under NDA sets "private": true. From then on, every thread
whose working directory sits under that root is unnamed off the
device:
- The project name (normally the working directory's basename) is not carried. The team id stands in when the file names one, otherwise a short opaque id derived from the repo root by a keyed hash. The id is the same on every machine that clones the repo, so the spend stays one row, and there is no way back from it to the directory name.
- No title travels at all, and no derived label either, whatever the group's sharing level is. This is stricter than the solo-group rule titles normally follow.
- Tokens, models, timestamps and costs still count in every total, every graph and every report. Private means unnamed, never uncounted.
The substitution happens where the transcripts are folded, so the name never enters the roll rather than being stripped from it on the way out. Nothing about the file changes what is stored on the device: the local thread list still shows the real project and title to the person whose machine it is.
summary.omit: absent, never redacted
A repo can omit specific categories from session summaries by declaring
a summary object with an omit list:
{
"team": "platform",
"summary": {
"omit": ["people", "customers"]
}
}
The omit value can be an array of strings or a comma-joined string.
The category names are:
paths: file paths and directory namesbranches: git branch namestickets: issue and ticket numbers or titlespullRequests: PR numbers, titles and URLscommits: commit SHAs, subjects and descriptionspeople: names or usernames of collaboratorscustomers: client or customer names
Omitted categories are never mentioned in a summary, not redacted, simply absent. Unknown category names in the file are ignored.
tokematic summary
The command line tool provides verbs to generate, view and manage session summaries:
tokematic summary run [--provider <id>] [--session <id> | --latest --cwd <dir>] [--note <text>] [--level short|medium|detailed] [--engine appleIntelligence|sessionVendor]
tokematic summary show [--provider <id>] [--session <id> | --latest --cwd <dir>] [--level short|medium|detailed]
tokematic summary goal [--provider <id>] [--session <id> | --latest --cwd <dir>] [<text> | --clear]
run: summarizes the specified session (or newest in directory with--latest --cwd), enqueues the record into the inbox and outputs the rendered text.show: loads and prints the existing summary at the requested detail level without running another model pass.goal: displays the current session goal when called with no text, sets a new goal when given text or clears it with--clear.
--session takes Tokematic's stored Session ID or a unique prefix across providers.
No provider is needed. An optional --provider filters the matches.
For example, tmatic tag --session <id> --customer Acme uses the selected
session's provider. --latest and summary --hook still need --provider.
Use --provider <id> --vendor-session-id <id> for a vendor's original ID.
This explicit vendor path also applies to show, turns, transcript, hide,
unhide and summary remove. Resume keeps its syntax:
tmatic resume --vendor-session-id <provider> <id>.
Stored Session IDs and their formula do not change.
tmatic log --vendor-ids and tmatic show <id> --vendor-ids add a separate
vendor ID field. They keep the Tokematic ID as the primary ID.
tmatic show <id> --json includes the saved structured summary, verified
work, time, costs and source coverage. Missing measures remain unknown.
tmatic version --json identifies the executable, bundle and stamped build.
tmatic install-cli --source <executable> --target <symlink> selects a
specific build and link location. It does not fall back to another location.
Use tmatic usage record for token submission. tmatic report remains a
compatibility alias. Daily, weekly and monthly status reports are a
separate feature. tmatic run wraps usage collection; tmatic core run
attaches a parent session to a command.
Turn history and transcripts
These commands give the session page's turn history, transcript, download and sharing on the command line (#648). They call the same services as the app.
tmatic turns <session-id> [--turn <n>] [--json]
tmatic transcript show <session-id> [--grep <text>] [--json]
tmatic transcript download <session-id> [-o <file.zip>] [--force] [--json]
tmatic transcript share <session-id> [--on | --off] [--json]
turnsprints one line for each completed turn of a main session.--turn <n>prints the transcript of that turn. A helper has no turn history.transcript showprints the transcript of a main session or a helper. A helper is titled from its own transcript.transcript downloadwrites a zip, by defaultSession-<id>.ziporHelper-<id>.zipin the current folder. It does not turn on saving or sharing. A helper downloads its own transcript only.transcript shareshows the "Share full transcripts with" setting for the main session.--onand--offchange it with the app's destination, solo-group, privacy, encryption and revocation checks. A helper uses its main session's setting. tmatic runs no sync of its own: the app uploads or removes the shared copy at its next sync.
Each command takes the stored Session ID or a unique prefix, or
--provider <id> --vendor-session-id <id> for a vendor ID. --vendor-ids adds a separate
vendor ID field. tmatic never raises a Keychain dialog. When it cannot read
the Tokematic account, share changes nothing and says so.
Off behavior
When session summaries are off in Preferences (Detail set to Off, so summariesEnabled is false), tokematic summary run prints "session summaries are off in Tokematic" and exits cleanly with code 0. This ensures agent exit hooks and slash commands complete without error or disruption. When summaries are disabled for a specific provider, it prints an instructional notice and exits with code 2. The goal verb continues to operate while summaries are disabled.
Agent skills and hooks
Tokematic installs no agent skills. The /bye and /goal skills earlier
versions offered are withdrawn: on launch Tokematic removes any of their
files that carry the managed by Tokematic marker (Claude
~/.claude/skills/<name>/SKILL.md, Codex ~/.codex/prompts/<name>.md,
Antigravity ~/.gemini/config/skills/<name>/SKILL.md) and leaves a file
without the marker untouched. The goal field itself stays, set with
tokematic summary goal.
The SessionEnd hook flow (InstallSessionHook, tokematic summary run --hook) is present but not offered in the UI and nothing installs it.
While Detail is any level but Off, the app's own watcher files the summary
for each session it sees finish; with Off the session is still recorded
and only the written summary is skipped.
Codex sandbox note
Codex custom prompt skills execute inside its sandbox. The sandbox environment must permit spawning tokematic, codex exec and gh to extract transcripts, run summaries and read git facts. When sandbox isolation prevents tool execution, the skill instructions explain how to run the command outside the sandbox.
Custom sharing rules (advanced)
Custom narrows one computer's sharing with one team to named publishing
permissions the person holds for that team: one to 100 grant id and
revision pairs, with a category ceiling (usage, session_summary,
session_detail) and a detail ceiling (summary or full;
session_detail requires full). Nothing publishes nothing from that
computer to that team and names no grant. Everything is the simple path
above. The request and response contract is
INSTALLATION-SHARING-CHOICE-API.md
and the per-mode field contract is
SHARING-MODE-DATA.md. Recording and enforcement
are shipped; sending under a choice stays gated exactly as the simple
path describes.
Manual sync: tmatic push and tmatic pull (advanced) [shipped]
The tmatic command line (the tokematic command name is also supported)
syncs this device's private account on demand. Automatic collection
(tmatic daemon, or one cycle now with tmatic sweep) pushes then pulls on
its own schedule. The two commands below are the manual form and follow the
same privacy and organization policy checks as automatic sync.
tmatic push [--json] [--sync-dry]
tmatic pull [--cursor <revision>] [--json]
pushmints only what changed since the last push and sends it, then printsPushed N records (T threads, S snapshots, I indexes, M meta)orNothing to push.Evicted history weeks are deleted from the server first, each once.--sync-drymints and counts what a push would send, sends nothing and moves no sync state.--jsonprints the counts as JSON.- A record the server refuses for a version conflict is named on stderr, one
line per record (
tmatic: push refused ThreadIndex thread-index-…: version conflict); what landed stays landed, the exit code is 1 and the next push retries only what was refused. - Weeks the rail already holds in a newer form are held back, one stderr
line each (
push held <type> <name>: thinner_than_rail,landed_firstornewer_window_on_rail): a push never thins or rewrites the history another device published. pullreads the private account's records into the local store and never uploads. Records this device wrote itself are left alone; another device's sessions land with the Session ID they carry. Without--cursorthe pull walks every record and skips what has not changed, since the server keeps a version per record rather than one for the account. Output:Pulled N records: T threads, S snapshots, K skipped, U unchanged.
Both commands exit 0 on success and 1 with one line on failure. With no
login the line is not signed in. Run "tmatic pair <share-code>" to sign in first. (see the login note below). A server refusal carries the server's
own words, never a token or a sealed field.
Accepted organization overrides
The legacy collector scoped a sync to one project, recipient or history
scope. This build syncs the whole private account. It still accepts those
flags for compatibility (--project <id> on push and pull,
--recipient <id> and --history-scope <id> on pull) and answers each
use with one stderr note:
tmatic: note: this build syncs the whole private account; project, recipient and history scope flags are ignored
Project, recipient and history scope selection lives in the web client. The flags never narrow or widen the scope the server selected.
Desktop login for the command line
The normal login needs no separate command-line sign-in: sign in to the
account on a desktop app that syncs and the app hands this device's sync
login to the command line (and takes it back when sync turns off). On a
headless machine with no app, tmatic pair <share-code> is the legacy
compatibility path: it joins a sync group with a shared code exactly as the
legacy collector did and is not the normal account login. tmatic unpair
removes the local credentials.
On Windows, pairing's Credential Manager check requires a secret that lasts
after sign-out. A logon that supports only session storage cannot pass this
check. Choose tmatic pair --secrets file <share-code> to save in sync.json
instead. A failed native check does not admit the device or choose file
storage automatically. Provider API keys can use session storage, which lasts
until sign-out. The sync pointer and secret JSON shapes do not change.
The team registry [planned]
One synced preference record per group lists the teams: readable ids (the slugs reports carry) plus a display name per id, sealed under the group key. The registry is what the dashboard enumerates when it splits spend by team, so "platform" cannot drift into "Platform" across dashboards. A group with one person's accounts never creates the registry and every per-team split stays out of that UI entirely.
Privacy line [shipped]
Token counts, cost, model, job, team, tags and duration may sync when reporting is on. Host and keyLast4 go sealed under the group key, and a record name carries a group-keyed token of the host, never its slug. Prompt text never does. The full inventory is docs/PRIVACY-LEGAL-FINDINGS.md section 2.
Session reference links
Web session reports link tickets, pull requests and commits using the session's readable repository details, recognized URLs and configured defaults. Missing destinations have a dotted underline with a setup link. Multiple matching destinations open a choice. Configure named instances and organization, project or personal defaults in Preferences > Integrations. See the integrations guide.