Roo Code
Local-data provider for the Roo Code VS Code extension. Reads per-task event logs the extension writes under VS Code's globalStorage and aggregates tasks, tokens, and cost. No network calls, no auth.
Roo Code shares its on-disk schema with Kilo Code; the same parser handles both. This page covers only the Roo Code extension (rooveterinaryinc.roo-cline).
At a glance
- Provider ID —
roocode - Detection —
rooveterinaryinc.roo-clineglobalStorage subdirectory present under any known VS Code variant - Auth — none (local files only)
- Type — coding agent
- Tracks:
- All-time tasks, plus tasks today and tasks in the last 7 days
- Total API requests
- Input / output / cache-read / cache-write tokens
- All-time and today cost in USD (when the extension recorded it)
- Per-model breakdown with token totals and request counts
- Daily series for tasks, tokens, and cost
Setup
Auto-detection
OpenUsage walks every VS Code-family install root and registers the provider as soon as <root>/User/globalStorage/rooveterinaryinc.roo-cline/ exists. The "extension dir exists but no tasks yet" case still counts; the tile renders a quiet "No Roo Code usage recorded yet" message until the first task is parsed.
The probed variants are: VS Code, VS Code Insiders, VSCodium, VSCodium Insiders, Cursor, and Windsurf. On Linux, OpenUsage also probes Windows-side AppData under /mnt/c/Users/<user>/AppData/Roaming/ when running inside WSL. XDG_CONFIG_HOME is honoured for the Linux config root.
VS Code Server (Remote / Codespaces / dev containers) writes globalStorage under ~/.vscode-server/data/User/globalStorage/, which is not currently in the auto-probe list. Use the manual override below to point at it directly.
Manual configuration
{
"accounts": [
{
"id": "roocode",
"provider": "roocode",
"extra": {
"tasks_dir": "/absolute/path/to/User/globalStorage/rooveterinaryinc.roo-cline/tasks"
}
}
]
}
The only path hint the provider honours is tasks_dir. Point it at the tasks/ directory under the extension's globalStorage (not at the extension dir itself). When set, the provider reads only that directory and skips cross-variant discovery.
Data sources & how each metric is computed
Each Roo Code task is one subdirectory under tasks/. The provider reads two files per task:
ui_messages.json— JSON array of UI events. Entries whosesayfield equalsapi_req_startedcarry a nested JSON blob intextwithcost,tokensIn,tokensOut,cacheReads,cacheWrites, andapiProtocol. The discriminator is tolerated underentry_typeortypefor older schema versions.api_conversation_history.json— full conversation transcript. The provider extracts the last<model>...</model>tag from embedded environment metadata to attribute the task to a model.<slug>and<name>tags are used as fallbacks.
Tasks without a ui_messages.json are silently skipped (treated as "not ready"). Malformed event rows are skipped per-row rather than failing the whole task. UTF-8 BOMs at the start of either file are stripped before parsing. The result is a flat list of API calls deduplicated across VS Code variants (the same task may appear in multiple variants if the user copied state across them).
Timestamps may be Unix milliseconds, Unix seconds, or RFC3339 strings; the parser accepts all three. Negative token counts and cost values are clamped to zero so a corrupt row cannot pull the totals backwards.
Tasks and requests
total_tasks— distinct task IDs that produced at least one parsed call.tasks_today— distinct task IDs with at least one call timestamped today (UTC).tasks_7d— distinct task IDs with calls in the last 7 days (UTC).total_requests— count of every parsedapi_req_startedevent after dedup.
Tokens
total_input_tokens/total_output_tokens— sum oftokensIn/tokensOutacross calls.total_cache_read_tokens/total_cache_write_tokens— sum ofcacheReads/cacheWrites.total_tokens— input + output + cache-read + cache-write.
Cost
total_cost_usd— sum of thecostfield across calls.today_cost_usd— same sum, restricted to calls timestamped today (UTC).
Cost only appears when the extension recorded a non-zero cost value, which depends on the upstream provider Roo Code is calling.
Per-model breakdown
- Each model becomes one
ModelUsageRecordwith input/output/cached/total tokens and request count. The first non-emptyapiProtocolleading segment (split on/or:) is attached as theupstream_providerdimension, sobedrock/anthropicbecomesbedrock.
How fresh is the data?
- Polling: every 30 s by default. The provider stat()s every probed extension dir and short-circuits when no globalStorage entry has changed since the last poll.
Caveats
- Cost numbers come from whatever Roo Code chose to record. If the upstream provider doesn't return per-call pricing,
total_cost_usdwill be zero even though tokens are accurate. - Tasks copied across multiple VS Code variants are deduplicated by task ID, but the dedup is best-effort and assumes task IDs are stable across copies.
- VS Code Server installs are not auto-detected. Use
tasks_dirto point at the remote globalStorage path explicitly. - The Roo Code provider is independent from the Kilo Code provider even though they share parser code; install one, the other, or both and openusage will surface each as its own tile.
Troubleshooting
- Tile shows "extension data not found" — confirm
<root>/User/globalStorage/rooveterinaryinc.roo-cline/exists. Check the variant list above; if you use VS Code Server, settasks_dirmanually. - Tile reports 0 tasks despite usage — open one of the task directories and check that
ui_messages.jsonis present and non-empty. The provider silently skips tasks where the file is missing. roocode_task_parse_errorsdiagnostic — at least one task file failed to decode. The provider counts the failures but continues; inspect the offendingui_messages.jsonfor corruption.
Related
- Kilo Code — sibling VS Code extension that shares the same on-disk schema