cc-lens: The Dashboard That Turns Claude Code Into a Readable Ledger

A local-first analytics tool that reconstructs cost, context, and session history from Claude Code’s raw logs, then presents the hidden shape of agent work without cloud telemetry.

6 to 8 min read • View on GitHub • More from arindam200

A forensic workbench with a laptop at the center, surrounded by paper logs, a token counter, and a cash ledger. A funnel pulls raw JSONL lines from a folder labeled ~/.claude/ into a clean dashboard, while a loopback line points to 127.0.0.1 instead of the cloud. The image explains that cc-lens turns local logs into private observability.
cc-lens treats Claude Code’s local files as the source of truth, then turns them into a readable account of cost, behavior, and session history.
Key Takeaways

Why a Claude Code dashboard needed to stay local

Claude Code already leaves useful evidence behind. The problem is that the evidence lives in local JSONL logs that are accurate, verbose, and miserable to read. cc-lens starts from a simple reversal: keep the data on the machine, bind to 127.0.0.1, and treat the filesystem as the source of truth.

Claude Code Lens (cc-lens) A real-time monitoring dashboard for Claude Code analytics.

Project README, Repository documentation · arindam200/cc-lens README

That choice matters because it changes the product category. This is not cloud observability with an agent-shaped logo. It is a forensic tool for a local workflow, built for people who want answers without uploading their working habits somewhere else.

OptionWhat you getWhat you give up
Raw Claude Code logsExact data from the sourceReadability, speed, and any sense of pattern
Cloud dashboardsPolished charts and central reportingPrivacy, local control, and often the raw context
cc-lensReadable reconstruction from local logsNothing leaves the machine unless you choose Team Mode

The hidden ledger inside ~/.claude/

The first real aha is that cc-lens does not merely summarize activity. It reconstructs an operational history from files that were never designed to be pleasant to inspect. Sessions, tokens, cache reads, cache writes, replayable turns, and cost estimates all come out of the same local trail.

cc-lens behaves like a pipeline, not a static report. It turns raw local files into multiple views of the same agent history.

A close-up of a dense session scroll being pressed through a compaction mechanism. On the left, many small chat turns, timestamps, and side branches are stacked tightly together. In the center, a folding press compresses them into a shorter summary block. On the right, the simplified session continues into a replay panel with a latency bar and a cache indicator. The image explains how cc-lens makes compaction and replay visible.
Compaction is where long AI sessions stop being linear. cc-lens exposes the boundary instead of hiding it.

How cc-lens reads thousands of sessions without choking

The technical heart of the project is in lib/claude-reader.ts. It uses a concurrency-capped map pool to scan a lot of files without running into file descriptor limits, then skips re-parsing sessions whose modification time has not changed. That is a practical design, not a clever one for its own sake. The data is local, but the log volume can still be brutal.

// The shape of the approach, simplified
for (const file of files) {
  if (!mtimeChanged(file, sessionCache)) continue

  const stream = createReadStream(file)
  const rl = readline.createInterface({ input: stream })

  for await (const line of rl) {
    processJSONL(line)
  }
}

The important detail is streaming. Instead of loading large session files into memory, cc-lens reads them line by line. That keeps the app responsive even when a session grows into something much larger than a normal CLI transcript.

Cost is the feature people will actually use

The project gets practical fast because it turns token activity into something closer to a bill. cc-lens combines Claude’s own stats-cache.json with session-derived calculations, then maps model identifiers to pricing tiers and accounts for cache reads and writes. The result is not exact accounting, but it is a useful approximation of where the money goes.

SignalWhat cc-lens addsWhy it matters
Prompt and completion tokensSession-level reconstructionYou can see which work was expensive
Cache reads and writesSeparate cost treatmentPrompt caching becomes visible instead of implied
Session totalsMerged with Claude’s stats cacheThe dashboard stays fresher than a plain log viewer

That is why the product feels less like analytics theater and more like a utility bill. Most users do not wake up wanting token archaeology. They want to know whether the last stretch of agent work was efficient, wasteful, or just unusually busy.

Replay changes the product from dashboard to microscope

Replay is where cc-lens stops being a summary layer and becomes a diagnostic tool. The parser tracks compaction events, sidechains, parent UUIDs, and turn duration, then rebuilds a chat-like sequence that makes long-running agent behavior easier to inspect. You do not just see what happened. You see where the session bent under its own length.

That is the deeper product idea. Once you can replay the session, you can ask better questions about memory pressure, turn latency, and the real shape of the work.

Team Mode extends the same idea to shared reporting

The team update keeps the original philosophy intact. It still favors local data, redaction, and minimal infrastructure, but now it can aggregate snapshots through a shared folder or a hub. The point is not to become a surveillance layer for a company. The point is to let a team compare usage without forcing everything into a SaaS account.

That makes cc-lens feel like a second-act product. The solo developer gets personal observability first. The team gets a controlled way to share only what they need.

Where cc-lens fits in the broader toolchain

cc-lens occupies a narrow but useful middle ground. Raw logs are faithful but unreadable. Cloud dashboards are readable but external. Generic CLI wrappers can tell you whether something is happening, but not how the session is evolving. cc-lens sits between them: private, reconstruction-heavy, and much closer to the behavior of the agent than a simple status line.

Tool typeStrengthBlind spot
Raw logsExact source dataNo narrative or structure
Cloud analyticsPolished reportingOff-machine by default
Generic CLI trackersFast status checksLittle historical depth
cc-lensLocal reconstruction and replayRequires local log access

It is not trying to replace Claude Code. It is trying to make Claude Code inspectable.

The bigger idea: local-first observability for AI agents

cc-lens matters because it points to a category. If AI coding agents are going to live in daily workflows, then the best tools around them may be the ones that sit next to the work, not above it. That is the real lesson here. The future of agent observability may look less like a cloud platform and more like a private rear-view mirror.