Skip to content

Contribution proposal: cline.bot #1871

Closed

Description

@Random-Coding-Lab

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 via CLINE_DATA_DIR environment 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

  • shouldZeroClineFreeModelCost zeroes totalCost to 0 for free models like cline-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 in task.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 ⚠️ Costs present but zeroed for free models

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

  1. pullfrog commented on Oct 12, 2026

    @pullfrog
    Contributor
  2. added
    enhancementNew feature or request
    priority:mediumA normal bug or meaningful improvement.
    triage:maintainableFits the repository's maintainable scope and needs review.
    on Oct 12, 2026
  3. added
    priority:lowMinor polish, documentation, or a low-impact edge case.
    triage:excludedExcluded from the current maintenance scope.
    and removed
    priority:mediumA normal bug or meaningful improvement.
    triage:maintainableFits the repository's maintainable scope and needs review.
    on Oct 12, 2026
  4. github-actions commented on Oct 12, 2026

    @github-actions
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority:lowMinor polish, documentation, or a low-impact edge case.triage:excludedExcluded from the current maintenance scope.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions