<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 658jjh</title>
    <description>The latest articles on DEV Community by 658jjh (@658jjh).</description>
    <link>https://dev.to/658jjh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4020114%2F2c2d14eb-4abd-4e35-906c-87ff823545f8.jpg</url>
      <title>DEV Community: 658jjh</title>
      <link>https://dev.to/658jjh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/658jjh"/>
    <language>en</language>
    <item>
      <title>Your AI coding tools are keeping detailed logs on your Mac. Here's what's in them.</title>
      <dc:creator>658jjh</dc:creator>
      <pubDate>Tue, 07 Jul 2026 19:46:26 +0000</pubDate>
      <link>https://dev.to/658jjh/your-ai-coding-tools-are-keeping-detailed-logs-on-your-mac-heres-whats-in-them-2kda</link>
      <guid>https://dev.to/658jjh/your-ai-coding-tools-are-keeping-detailed-logs-on-your-mac-heres-whats-in-them-2kda</guid>
      <description>&lt;p&gt;Run this in a terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; ~/.claude/projects/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you use Claude Code, you just found a folder for every project you've ever opened it in. Inside each one: JSONL files logging every session, every message, every token. Codex CLI does the same thing in &lt;code&gt;~/.codex/sessions/&lt;/code&gt;. Cursor, Windsurf, Cline, Aider, Continue: all of them keep local logs like this.&lt;/p&gt;

&lt;p&gt;Most developers have no idea these files exist. I've been digging through them for months, and they're genuinely useful. Here's a tour.&lt;/p&gt;

&lt;h2&gt;
  
  
  What one log entry looks like
&lt;/h2&gt;

&lt;p&gt;Each line in a Claude Code JSONL file is one event. The interesting ones are assistant messages, which carry a &lt;code&gt;usage&lt;/code&gt; block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"assistant"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-07-06T21:14:03.812Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"sessionId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"a1b2c3d4-..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"cwd"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/Users/you/projects/my-app"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"model"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"claude-sonnet-5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"usage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"input_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"output_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;512&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"cache_creation_input_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;12034&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"cache_read_input_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;148220&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Five things worth noticing:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The model is recorded per message.&lt;/strong&gt; Not per session. If Claude Code switched models mid-session, it's in here.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;cwd&lt;/code&gt; is the project directory.&lt;/strong&gt; This is the field that makes per-project cost analysis possible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache tokens dwarf everything else.&lt;/strong&gt; Look at that &lt;code&gt;cache_read_input_tokens&lt;/code&gt; number. In a long agentic session, cache reads are routinely 95%+ of all tokens. This is why agentic coding is affordable at all: cache reads are billed at a tenth of the input price.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;sessionId&lt;/code&gt; lets you resume.&lt;/strong&gt; &lt;code&gt;claude --resume &amp;lt;sessionId&amp;gt;&lt;/code&gt; reopens that exact conversation. Your whole history is addressable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It's all plaintext on your disk.&lt;/strong&gt; More on that at the end.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Total your tokens in one line
&lt;/h2&gt;

&lt;p&gt;Want your lifetime output token count? &lt;code&gt;jq&lt;/code&gt; does it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; ~/.claude/projects/&lt;span class="k"&gt;*&lt;/span&gt;/&lt;span class="k"&gt;*&lt;/span&gt;.jsonl 2&amp;gt;/dev/null &lt;span class="se"&gt;\&lt;/span&gt;
  | jq &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="s1"&gt;'[.[] | .message.usage.output_tokens // 0] | add'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Swap in &lt;code&gt;cache_read_input_tokens&lt;/code&gt; and the number gets absurd. Mine is in the billions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Turning tokens into dollars
&lt;/h2&gt;

&lt;p&gt;Multiply by published API prices and the logs become a cost report. Current Anthropic list prices per million tokens for Sonnet-class models: $3 input, $15 output, $3.75 cache write, $0.30 cache read. So a quick estimate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; ~/.claude/projects/&lt;span class="k"&gt;*&lt;/span&gt;/&lt;span class="k"&gt;*&lt;/span&gt;.jsonl 2&amp;gt;/dev/null | jq &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="s1"&gt;'
  [.[] | .message.usage // empty] |
  (([.[].input_tokens // 0] | add) * 3
   + ([.[].output_tokens // 0] | add) * 15
   + ([.[].cache_creation_input_tokens // 0] | add) * 3.75
   + ([.[].cache_read_input_tokens // 0] | add) * 0.30) / 1000000
'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That prints your all-time Claude Code usage in API-equivalent dollars (roughly, assuming Sonnet pricing for everything). If you're on a Pro or Max subscription, this is a number Anthropic never shows you. &lt;code&gt;/cost&lt;/code&gt; only works for API users. Comparing it against your plan price answers a question a lot of people are currently arguing about without data: whether the subscription is worth it for you.&lt;/p&gt;

&lt;p&gt;Codex logs are shaped differently (rollout files, with reasoning tokens tracked separately inside the usage object) but the same idea applies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where every tool keeps its logs
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Location&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Claude Code&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.claude/projects/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Codex CLI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.codex/sessions/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Claude Desktop&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Library/Application Support/Claude/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cursor&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.cursor/projects/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Windsurf&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.windsurf/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cline&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.cline/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Aider&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.aider/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Continue&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.continue/sessions/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Formats vary (Aider logs through litellm, Continue uses plain JSON) but they all record models and token counts.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part you should actually think about
&lt;/h2&gt;

&lt;p&gt;These logs also contain your conversations: prompts, file paths, project names, fragments of your code. Locally, that's fine, arguably great. But it means two things.&lt;/p&gt;

&lt;p&gt;First, if you back up your home directory to a cloud service, your AI pair-programming history goes with it. Worth knowing.&lt;/p&gt;

&lt;p&gt;Second, be skeptical of any "AI usage analytics" tool that wants to upload these files to give you a dashboard. There is nothing in the analysis that requires a server. It's multiplication.&lt;/p&gt;

&lt;h2&gt;
  
  
  I got tired of running jq, so I built the dashboard
&lt;/h2&gt;

&lt;p&gt;The one-liners above got me hooked, and then annoyed. So I built &lt;a href="https://usages.pro/" rel="noopener noreferrer"&gt;AI Usage Tracker&lt;/a&gt;, an open source (MIT) macOS app that parses all of these log formats, prices every provider correctly per model (including cache and reasoning tokens), and renders it as a local dashboard: daily spend, cost per project, cost per model, a peak-hours heatmap, and a session browser with resume commands. There's a toggle to view Claude and Codex separately, which settles the "which tool am I actually using more" question fast.&lt;/p&gt;

&lt;p&gt;Fully local, no telemetry, no account. Source is here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/658jjh/claude-usage-tracker" rel="noopener noreferrer"&gt;https://github.com/658jjh/claude-usage-tracker&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Free to build from source; there's a $9 signed build if you don't want to. But honestly, even if you never touch my app, go run that &lt;code&gt;ls&lt;/code&gt; command. Your usage history has been sitting there this whole time, and the numbers in it will probably change how you use these tools.&lt;/p&gt;

&lt;p&gt;What's in your logs? I'm curious whether anyone else's cache-read ratio is as lopsided as mine.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>opensource</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
