Answer: You track token usage by subscribing to the agent and checking for the "usage-updated" event, then summing event.usage.inputTokens and event.usage.outputTokens into a running total. Status: Confirmed Entry: tool/cline/features/usage-tracking-pattern Revision: 1 Digest: sha256:0636bea46f84dc70 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:07:34Z Last changed: 2026-11-13T03:07:34Z Last verified: 2026-11-20T12:30:26Z Next check: 2026-11-21T12:30:26Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Event type | usage-updated | [1] | 2026-11-20 Token calculation | event.usage.inputTokens + event.usage.outputTokens | [1] | 2026-11-20 Initial total | 0 | [1] | 2026-11-20 Sources: [1] Cline. "Events". https://docs.cline.bot/sdk/events.md Role: primary. Accessed: 2026-11-20T12:30:26Z Quote: "if (event.type === "usage-updated")" (Supports: Event type) Quote: "totalTokens = event.usage.inputTokens + event.usage.outputTokens" (Supports: Token calculation) Quote: "let totalTokens = 0" (Supports: Initial total) Published: 2026-11-20T00:16:31Z Snapshot SHA-256: b7447d32faf579123e11b6fdcd8be6e25e717f4b0728b0e6ca16e74adfac5776 (captured 2026-11-13T03:07:33Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:07:34Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:30:26Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:30:26Z Last attempt: 2026-11-20T12:30:26Z Notes and limitations: Extracted automatically from a single official source (section "Usage Tracking Pattern"). Related: https://latestn.com/tool/cline/features/view-compare-changes How do I view and compare changes between checkpoints in Cline? https://latestn.com/tool/cline/features/when-to-use-rca-pattern What types of tasks is the Cline GitHub Issue RCA pattern suitable for? https://latestn.com/tool/cline/features/workspace-hints-syntax How do I reference files across workspaces in Cline using workspace hints? https://latestn.com/tool/cline/features/track-per-repository What does Cline track per repository in a multi-root workspace? https://latestn.com/tool/cline/features/tui-vs-headless When should I use Cline's TUI instead of headless mode? https://latestn.com/tool/cline/features/undo-mistakes-checkpoints How do I undo mistakes or restore a checkpoint in Cline? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:07:34Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/cline/features/usage-tracking-pattern/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/cline/features/usage-tracking-pattern POST: https://latestn.com/dispute/tool/cline/features/usage-tracking-pattern with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/cline/features/usage-tracking-pattern?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I track token usage with Cline events? Revision 1, last verified 2026-11-20T12:30:26Z. https://latestn.com/tool/cline/features/usage-tracking-pattern (accessed 2026-11-21T09:52:29Z). @misc{LatestN_tool_cline_features_usage_tracking_pattern_r1, title = {How do I track token usage with Cline events?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/cline/features/usage-tracking-pattern}}, note = {Revision 1; digest sha256:0636bea46f84dc70; last verified 2026-11-20T12:30:26Z; accessed 2026-11-21T09:52:29Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/cline/features/usage-tracking-pattern