PromptHub
Developer Tools AI/ML Infrastructure

Stop Flying Blind: agentsview Exposes Your AI Coding Costs

B

Bright Coding

Author

13 min read
12 views
Stop Flying Blind: agentsview Exposes Your AI Coding Costs

Stop Flying Blind: agentsview Exposes Your AI Coding Costs

Your AI coding agent just burned through $47 in tokens while you grabbed coffee. And you had no idea until the bill arrived.

Sound familiar? If you're using Claude Code, Codex, Cursor, or any of the twenty-plus AI coding agents flooding the market, you're flying blind. Each session is a black box. Costs accumulate invisibly. Projects sprawl across half a dozen tools. And when your manager asks "how much are we spending on AI?" you shrug and check three different dashboards—if they exist at all.

Here's the dirty secret nobody talks about: the AI coding revolution created a visibility crisis. We're shipping code faster than ever, but we've lost track of what it actually costs. Not just money—context, patterns, productivity. Every agent stores sessions in its own cryptic format, buried in dot-directories you'll never inspect manually.

Enter agentsview—the local-first session intelligence platform that turns that chaos into clarity. One binary. Zero accounts. Complete visibility across every AI agent on your machine. Built by Wes McKinney (yes, that Wes McKinney, creator of pandas and Apache Arrow), this isn't another SaaS dashboard begging for your data. It's a 100x faster, privacy-first replacement for ccusage that lives on your machine, respects your data, and answers questions you didn't know you should be asking.

Ready to stop guessing and start optimizing? Let's dive deep.


What is agentsview?

agentsview is a local-first session intelligence and analytics engine for AI coding agents. At its core, it's a single binary written in Go with an embedded Svelte 5 frontend that automatically discovers, indexes, and analyzes coding sessions from 20+ different AI agents—from household names like Claude Code and GitHub Copilot to emerging tools like Kiro, Piebald, and Warp.

The project emerged from a simple observation: as developers adopt multiple AI coding tools, session data fragments across incompatible formats. Claude Code dumps JSON in ~/.claude/projects/. Codex hides in ~/.codex/sessions/. Cursor, Gemini, OpenCode, Forge—they all speak different dialects. Wes McKinney, drawing from his deep data infrastructure experience (pandas, Arrow, Ibis), built agentsview as the universal translator and analytics layer this ecosystem desperately needed.

What makes agentsview genuinely different? Three architectural decisions that matter:

  • Local-first by design: All data stays in a SQLite database on your machine. No cloud dependency, no account creation, no telemetry. The server binds to 127.0.0.1 by default, and the only outbound request is an optional update check—disabled with --no-update-check.

  • Universal agent support: Auto-discovery for 22 agents with environment-variable overrides for custom paths. This isn't "Claude-only" or "OpenAI-only." It's everything.

  • Performance obsession: By indexing sessions in SQLite with FTS5 full-text search instead of re-parsing raw files on every query, agentsview achieves 100x+ speedups over tools like ccusage that parse JSON repeatedly.

The tool is trending now because it solves a pain point that's becoming critical: AI coding cost management at scale. Teams running multiple agents across multiple developers need visibility. Individual power users hitting API limits need optimization. And everyone needs to stop manually cat-ing JSON files in hidden directories.


Key Features That Demand Attention

Let's dissect what makes agentsview technically compelling beyond the marketing speak.

Blazing-Fast Cost Analytics with SQLite Indexing

The secret sauce is architectural. Instead of parsing raw session files on every invocation (ccusage's approach), agentsview performs a one-time sync into a local SQLite database with proper indexing. Subsequent queries hit indexed tables, not filesystem globbing. The result? Sub-second cost summaries versus multi-second waits on large session histories.

FTS5-Powered Full-Text Search

Every message across every session becomes searchable. Looking for that time Claude suggested a specific refactoring pattern? Search it. Need to find all sessions where you debugged a particular error? FTS5 handles it with proper relevance ranking—not grep hacking through nested JSON.

Real-Time Session Monitoring via SSE

Active sessions stream updates through Server-Sent Events. Open the web UI, start a coding session in Claude Code, and watch messages appear live. No polling, no refresh button spamming.

Prompt-Caching-Aware Cost Calculation

This is where agentsview gets sophisticated. It doesn't just multiply token counts by flat rates. It understands cache creation tokens versus cache read tokens—the pricing nuance that can 10x your costs if mishandled. LiteLLM rates provide automatic pricing with offline fallback.

Keyboard-First Navigation

j/k for scrolling, [/] for session switching, Cmd+K for search, ? for help. Built for developers who live in their keyboards, not their mice.

Multi-Backend Flexibility

SQLite for individuals, PostgreSQL for teams. Push local data to shared instances with agentsview pg push, serve read-only team dashboards with agentsview pg serve. The schema is versioned (schema_version: 1) for downstream consumers.

Export and Publishing

Sessions export as HTML for archival or publish directly to GitHub Gist for sharing—without exposing your entire session history.


Real-World Use Cases Where agentsview Dominates

Use Case 1: The Multi-Agent Freelancer

You're a contractor using Claude Code for architecture, Codex for quick scripts, and Cursor for IDE-integrated refactoring. Three tools, three cost centers, zero visibility. agentsview discovers all three automatically, giving you unified daily spend tracking and per-client cost allocation. Invoice with confidence, not estimates.

Use Case 2: The Cost-Conscious Engineering Manager

Your team of eight each picked their favorite AI agent. Monthly AI spend is... somewhere between $800 and $2,400? agentsview's PostgreSQL sync aggregates team-wide usage. Identify who's burning tokens on inefficient prompts, who's underutilizing cache, and which models deliver value per dollar.

Use Case 3: The Prompt Engineering Researcher

You're systematically comparing Claude 3.7 Sonnet against GPT-4o for code generation quality. agentsview's per-model breakdown with temporal analysis lets you correlate cost, context window usage, and session archetypes (automation vs. deep exploration) with actual outcomes—especially when combined with --include-git-outcomes for commit metrics.

Use Case 4: The Compliance-Focused Enterprise Developer

Your security team vetoed every cloud-based AI analytics tool. agentsview's local-first, no-telemetry, no-accounts architecture passes review. Run it air-gapped. Audit the source (MIT licensed). Bind to localhost. Your session data never leaves your machine—because it never needs to.

Use Case 5: The Productivity Optimizer

Session archetypes reveal your patterns: quick 5-minute fixes versus 3-hour deep dives. Activity heatmaps show when you're most productive. Tool-per-turn distributions expose over-reliance on specific capabilities. This isn't just cost tracking—it's behavioral analytics for knowledge work.


Step-by-Step Installation & Setup Guide

Getting agentsview running takes under two minutes. Choose your path:

Option 1: Shell Installer (Recommended)

# macOS / Linux — one-line install
curl -fsSL https://agentsview.io/install.sh | bash

# Windows — PowerShell equivalent
powershell -ExecutionPolicy ByPass -c "irm https://agentsview.io/install.ps1 | iex"

The installer downloads the appropriate binary for your platform and places it in your PATH.

Option 2: Desktop Application

Download prebuilt desktop apps (macOS/Windows) from GitHub Releases. These wrap the web UI in a Tauri shell for native feel without browser chrome.

Option 3: Docker (Team/Server Deployments)

# Basic local server
docker run --rm -p 127.0.0.1:8080:8080 \
  -v agentsview-data:/data \
  -v "$HOME/.claude/projects:/agents/claude:ro" \
  -v "$HOME/.forge:/agents/forge:ro" \
  -e CLAUDE_PROJECTS_DIR=/agents/claude \
  -e FORGE_DIR=/agents/forge \
  ghcr.io/wesm/agentsview:latest

Critical Docker notes: The container only discovers agents from explicitly mounted directories. The :ro read-only flag prevents container corruption of your session data. Use named volumes for /data—the container runs as root, and bind-mounts create root-owned files in your home directory.

For production deployments with PostgreSQL:

docker run --rm -p 127.0.0.1:8080:8080 \
  -e PG_SERVE=1 \
  -e AGENTSVIEW_PG_URL='postgres://user:password@postgres.example.com:5432/agentsview?sslmode=require' \
  ghcr.io/wesm/agentsview:latest

First Run Initialization

agentsview serve           # Start server, auto-open web UI at http://127.0.0.1:8080

On first launch, agentsview:

  1. Scans all supported agent directories (22 tools, auto-discovered)
  2. Parses and indexes sessions into local SQLite (~/.agentsview/data.db)
  3. Opens your browser to the dashboard
  4. Begins watching for new sessions in real-time

For CLI-only usage (no server needed):

agentsview usage daily     # Instant cost summary — 100x faster than ccusage

REAL Code Examples: From the Repository

Let's examine actual patterns from the agentsview codebase and documentation, with detailed explanations.

Example 1: Daily Cost Tracking with Granular Filtering

# Basic daily summary — default shows last 30 days
agentsview usage daily

# Per-model cost breakdown — see which model burned your budget
agentsview usage daily --breakdown

# Filter by specific agent and date range — audit Claude Code in Q2
agentsview usage daily --agent claude --since 2026-04-01

# JSON output for scripting — pipe to jq, feed to dashboards
agentsview usage daily --all --json

# One-line status for shell prompts or tmux status bars
agentsview usage statusline

What's happening here? The usage subcommand queries the pre-indexed SQLite database, not raw session files. The --breakdown flag joins against the model pricing table (LiteLLM rates with offline fallback). --since and --until use timezone-aware date bucketing. The --all flag removes the 30-day default window. JSON output follows a stable schema for programmatic consumption. The statusline variant formats for constrained display spaces—think Powerlevel10k or Starship prompts showing today's AI spend next to your git branch.

Example 2: Session Statistics with Git Outcome Correlation

# Human-readable summary over last 28 days (default window)
agentsview stats

# Machine-readable JSON with fixed date range — for CI pipelines
agentsview stats --format json --since 2026-04-01 --until 2026-04-15

# Restrict to Claude, inspect schema version for API stability
agentsview stats --format json --agent claude | jq '.schema_version'

# Include expensive git metrics — commits, LOC changed, files touched
agentsview stats --include-git-outcomes

# Add GitHub PR metrics via `gh` CLI (implicitly enables git outcomes)
agentsview stats --include-github-outcomes

Deep dive: The stats command computes window-scoped analytics: session archetypes (automation/quick/standard/deep/marathon), duration distributions, user-message counts, peak context sizes, tools-per-turn averages, and cache economics. The schema-versioned JSON output (schema_version: 1) guarantees downstream compatibility.

Git outcomes are opt-in because they're expensive: spawning git processes across potentially large repositories, computing diff stats, resolving merge commits. The --include-github-outcomes flag shells to the gh CLI for PR counts, adding network latency and API quota consumption. This explicit opt-in design prevents accidental slowdowns on large monorepos or slow connections.

Example 3: Docker Compose Production Deployment

# Clone or navigate to the repository
git clone https://github.com/wesm/agentsview.git
cd agentsview

# Launch production compose — persists data, mounts multiple agents read-only
docker compose -f docker-compose.prod.yaml up -d

The included docker-compose.prod.yaml demonstrates production patterns:

  • Named volume agentsview-data for SQLite persistence across container restarts
  • Read-only mounts for Claude (~/.claude/projects), Codex, Forge, and OpenCode session roots
  • Loopback-only binding (127.0.0.1:8080) preventing accidental external exposure
  • Root container execution with volume-managed permissions

Security consideration: The compose file intentionally doesn't expose beyond localhost. If you need team access, add --require-auth and publish intentionally—never expose an unauthenticated agentsview instance to networks you don't control, as session data may contain proprietary code.

Example 4: PostgreSQL Team Sync Pipeline

# Push local SQLite data to shared PostgreSQL instance
agentsview pg push

# Serve read-only web UI from PostgreSQL — team dashboard without write conflicts
agentsview pg serve

This two-command workflow enables team analytics without sacrificing local-first principles. Individual developers run agentsview serve locally for personal work, periodically pg push to share, and team leads run pg serve for read-only dashboards. The PostgreSQL schema handles concurrent reads; writes are serialized through the push command's transaction batching.


Advanced Usage & Best Practices

Optimize Cache Economics

Monitor cache creation versus read tokens in the cost dashboard. Cache reads cost ~10% of cache creation. If you see high creation with low reads, you're not reusing context effectively. Structure prompts to maximize cache hits across related sessions.

Automate with Cron

# Add to crontab for daily cost awareness
0 9 * * * agentsview usage daily --all --json > ~/.ai-costs.json

Custom Agent Paths

Override auto-discovery for non-standard installations:

export CLAUDE_PROJECTS_DIR=/custom/path/to/claude/sessions
export FORGE_DIR=/work/forge/data
agentsview serve  # Picks up custom paths

Performance Tuning Large Histories

Initial sync of 10,000+ sessions can take minutes. Use --no-update-check to skip the version check, and consider running sync overnight. Subsequent incremental syncs are near-instantaneous.

Schema Stability for Integrations

When building on agentsview stats --format json, always validate schema_version. The v1 schema is guaranteed stable; future versions will increment. Pin integrations to explicit schema versions.


Comparison with Alternatives

Feature agentsview ccusage Claude Code Built-in Custom Scripts
Agents Supported 22 1 (Claude) 1 (Claude) Varies
Speed 100x+ (indexed) Baseline (parse-on-read) N/A Varies
Local-First ✅ Full ✅ Yes ✅ Yes ✅ Yes
Web UI ✅ Full dashboard ❌ CLI only ❌ Terminal only ❌ None
Full-Text Search ✅ FTS5 ❌ No ❌ No ❌ Hard
Real-Time Updates ✅ SSE ❌ No ❌ No ❌ No
Team Sharing ✅ PostgreSQL sync ❌ No ❌ No ❌ Manual
Cost Breakdown ✅ Per-model, cache-aware ✅ Basic ❌ No ❌ Manual
Session Archetypes ✅ Automated ❌ No ❌ No ❌ No
No Accounts/Telemetry ✅ Guaranteed ✅ Yes ⚠️ Cloud-dependent ✅ Yes

Why agentsview wins: It's not just a cost tracker—it's a session intelligence platform. ccusage is excellent for Claude Code but single-purpose. Claude's built-in tools lack cross-session analytics. Custom scripts require maintenance and don't provide UI. agentsview occupies the unique intersection of multi-agent, high-performance, privacy-preserving, and visually insightful.


FAQ: Your Burning Questions Answered

Q: Does agentsview send my code or session data anywhere? A: Absolutely not. All data stays in local SQLite (or your PostgreSQL instance). No telemetry, no analytics, no accounts. The optional update check is the only outbound request—disable with --no-update-check.

Q: How does agentsview achieve 100x speed over ccusage? A: ccusage parses raw JSON session files on every invocation. agentsview performs one-time parsing into indexed SQLite tables. Subsequent queries hit optimized indexes instead of filesystem globbing and JSON parsing.

Q: Can I use agentsview with just the CLI, no web server? A: Yes. agentsview usage and agentsview stats work standalone with zero server overhead. The web UI is optional for visual exploration.

Q: What if my agent isn't in the supported list? A: Environment variables override all paths. If your agent writes sessions to any parseable format, you can point agentsview at it. The project also accepts contributions for new agents.

Q: Is the desktop app different from the CLI? A: The desktop app wraps the same binary in a Tauri shell for native window management. Functionality is identical; choose based on workflow preference.

Q: How do I back up my agentsview data? A: The SQLite database lives in ~/.agentsview/data.db (or your Docker volume). Copy that file for backup. PostgreSQL users rely on standard PG backup procedures.

Q: Can multiple team members write to the same PostgreSQL instance? A: Use agentsview pg push from individual machines. The pg serve command is read-only for dashboards. For true multi-writer, coordinate pushes or run a central sync agent.


Conclusion: Take Control of Your AI Coding Intelligence

The AI coding revolution didn't come with a dashboard. We've been flying blind, burning tokens and losing institutional knowledge into opaque session files scattered across hidden directories. agentsview changes the equation—transforming that chaos into clarity with a single binary that respects your privacy, rewards your curiosity, and optimizes your spending.

Whether you're a solo developer wondering where yesterday's $12 went, a team lead proving ROI to skeptical management, or a researcher correlating prompt patterns with code quality, agentsview provides the visibility layer this ecosystem desperately needed. The 100x performance improvement over ccusage isn't marketing fluff—it's the difference between actionable insight and abandoned tooling.

Wes McKinney's track record building foundational data tools (pandas, Arrow) shows in every architectural decision: SQLite for reliability, FTS5 for search, schema versioning for stability, local-first for trust.

Stop guessing. Start knowing.

Install agentsview today: curl -fsSL https://agentsview.io/install.sh | bash

Explore the source, contribute, and star the project at github.com/wesm/agentsview. Your future self—and your wallet—will thank you.


Last updated: June 2025 | agentsview is MIT licensed and actively developed.

Comments (0)

Comments are moderated before appearing.

No comments yet. Be the first to share your thoughts!

Support us! ☕