Repository navigation
Description
What do you want to change?
Contribution proposal: cline.bot
Source: Cline CLI & Desktop App
Cline CLI and desktop app emit structured JSON logs that can be converted to NDJSON for ccusage Inspect consumption.
Sample Redacted Log File
Attached: cline-redacted.log. This file is in pino JSON format with level, time, pid, hostname, name, message, and structured properties fields.
Default Data Directory
- CLI:
~/.cline/data/(default), overridable viaCLINE_DATA_DIRenvironment variable - Desktop app: Same as CLI (
~/.cline/data/) - shares the same storage backend - Log file:
<CLINE_DATA_DIR>/logs/cline.log(pino JSON format)
On Windows, the default resolves to %USERPROFILE%\.cline\data\ (or %USERPROFILE%\Documents\... on some setups, falling back to homedir/Documents if PowerShell fails).
Key Data Source: task.tokens Event
The critical information for ccusage is in the task.tokens event (with telemetrySink: "TelemetryLoggerSink"). This event contains the actual token counts and cache token data that ccusage needs for reporting:
| ccusage Field | Cline CLI JSON Field | Example Values in Log |
|---|---|---|
| Input tokens | properties.tokensIn |
30344, 892 |
| Output tokens | properties.tokensOut |
1076, others |
| Cache tokens (write) | properties.cacheWriteTokens |
0 |
| Model | properties.model / properties.modelId |
cline-free/deepseek-v4.1-flash |
Full Field Reference
| ccusage Field | Cline CLI JSON Field | Event Type | Example Values in Log |
|---|---|---|---|
| Timestamp | time (ISO 8601 UTC) |
All events | Present on every line |
| Session ID | properties.sessionId |
All events | Unique per session |
| Input tokens | properties.tokensIn |
task.tokens |
Key field for ccusage |
| Output tokens | properties.tokensOut |
task.tokens |
Key field for ccusage |
| Cache tokens (write) | properties.cacheWriteTokens |
task.tokens |
Key field for ccusage |
| Reasoning tokens | N/A | task.first_chunk_received |
eventType: "reasoning-delta" |
| Cost | usage.totalCost |
N/A (not in log) | 0 for free models |
Cost Notes
shouldZeroClineFreeModelCostzeroestotalCostto 0 for free models likecline-free/deepseek-v4.1-flash. Appropiate cost calculation from external source is required for accuracy- The token counts (
tokensIn,tokensOut) and reasoning events (eventType: "reasoning-delta") are still recorded intask.tokens
Compliance Summary
| ccusage Requirement | Cline Status |
|---|---|
| Local timestamps | ✅ time (ISO 8601, UTC) |
| Session identity | ✅ sessionId via session.started |
| Model identity | ✅ modelId via session.started |
| Input tokens | ✅ task.tokens.properties.tokensIn |
| Output tokens | ✅ task.tokens.properties.tokensOut |
| Cache tokens | ✅ task.tokens.properties.cacheWriteTokens |
| Reasoning tokens | ✅ task.first_chunk_received.eventType: "reasoning-delta" |
| Recorded costs |
Cline CLI (--json output) fully complies with the minimum requirements for ccusage Inspect source support. The task.tokens event is the primary data source for ccusage usage reporting.
Why?
Cline CLI and Desktop App are local coding agents that execute real LLM API calls and track token usage. Unlike transcript-only tools.
How? (optional)
No response
Activity
pullfrog commentedon Oct 12, 2026
github-actions commentedon Oct 12, 2026
Pullfrog triage: priority:low
Kind: feature request
Maintenance fit: excluded
Confidence: high
Requests new Cline CLI and desktop agent support with token field mapping. This is a new integration surface without maintainer endorsement, so it is an excluded feature request with low priority.
Decision: closed by the contribution gate.