# agentsview — local-first session search & cost tracking for coding agents

# agentsview

Browse, search, and track costs across all your AI coding agents. One binary, no accounts, everything local.

GitHub description: "Local-first session search, analytics, insights, and token use statistics for coding agents, supporting Claude Code, Codex, and more than 20 other agents."

## Install

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

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

Or download the desktop app (macOS / Windows) from GitHub Releases, via homebrew (`brew install --cask agentsview`), or run the published Docker image `ghcr.io/kenn-io/agentsview:latest`.

## Quick Start

```bash
agentsview serve           # start the server in the foreground
agentsview daemon start    # start the writable SQLite daemon
agentsview daemon status   # show daemon status
agentsview daemon restart  # restart from current configuration
agentsview daemon stop     # stop the writable daemon
agentsview session list    # read from the daemon if warm, otherwise SQLite
agentsview usage daily     # print daily cost summary
```

On first run, agentsview discovers sessions from every supported agent on your machine, syncs them into a local SQLite database, and serves a web UI at `http://127.0.0.1:8080`.

Claude and Codex sources can be configured as `s3://` roots so a central instance can read sessions other machines push to S3-compatible object storage; S3 change detection uses size, modified time, and fingerprints (ETag, version ID, checksums).

The desktop app and freshness-sensitive CLI commands share a detached local daemon. Read-only CLI commands attach to it if running, else fall back to direct read-only SQLite. Commands needing fresh data or writes (`sync`, `usage`, `token-use`, `pg push`, `duckdb push`) auto-start the daemon. Background daemons self-exit after an idle period.

## Remote / forwarded access

agentsview binds to loopback and validates the request `Host` header to guard against DNS-rebinding attacks. When reached via SSH port-forwarding, a reverse proxy, or a remote dev environment (exe.dev, Codespaces, Coder, WSL2), the unrecognized `Host` gets `403 Forbidden`. Fix with `--public-url` set to the exact browser origin; `--public-origin` trusts additional origins; `--require-auth` for non-loopback exposure.

## Docker & backends

The container image defaults to local `agentsview serve`. Set `PG_SERVE=1` to switch to `agentsview pg serve` (PostgreSQL for team dashboards). A `docker-compose.prod.yaml` production example persists data in a named volume and mounts Claude, Codex, Forge, and OpenCode session roots read-only. Containerized instances only discover sessions from explicitly-mounted directories.

DuckDB mirror: `duckdb push --full` populates `/data/sessions.duckdb` from SQLite; `duckdb serve` serves it read-only. Quack (`duckdb quack serve`) exposes the DuckDB mirror over a network endpoint (`quack:HOST:PORT`), token-authenticated; keep on loopback or behind TLS.

## Token Usage and Cost Tracking

`agentsview usage` is a fast, local replacement for ccusage and similar tools. Tracks token consumption and compute costs across all coding agents, not just Claude Code. Because session data is already indexed in SQLite, queries are "over 100x faster than tools that re-parse raw session files on every run."

```bash
agentsview usage daily                       # last 30 days
agentsview usage daily --breakdown           # per-model
agentsview usage daily --agent claude --since 2026-04-01
agentsview usage daily --all --json
agentsview usage statusline
```

Features: automatic pricing via LiteLLM rates (offline fallback); prompt-caching-aware cost calculation (cache creation / read tokens); per-model breakdown; date filtering; JSON output; timezone-aware bucketing; works standalone with no server.

## Per-Session Details

`agentsview session usage <id>` prints per-session token stats plus a cost estimate. Reports total output tokens and peak context tokens, plus `cost_usd` when pricing is available (`has_cost`). Same data via REST API `GET /api/v1/sessions/{id}/usage` (fields: `session_id`, `agent`, `project`, `total_output_tokens`, `peak_context_tokens`, `has_token_data`, `cost_usd`, `has_cost`, `models`, `unpriced_models`). Deprecated alias: `agentsview token-use <id>`.

## Session Stats

`agentsview stats` emits window-scoped analytics: totals, archetypes (automation vs. quick/standard/deep/marathon), distributions for session duration, user-message count, peak context, tools-per-turn, cache economics, tool/model/agent mix, temporal hourly breakdown. `--format json` follows versioned v1 schema (`schema_version: 1`). Git-derived outcome metrics are opt-in (`--include-git-outcomes` for commits/LOC/files; `--include-github-outcomes` for GitHub PR counts via `gh`).

## Session Browser features

- Full-text search across all message content (FTS5)
- Semantic search (opt-in) — index session content with any OpenAI-compatible embeddings endpoint; search by meaning via `agentsview session search --semantic` or `--hybrid`; matches cite the conversation unit
- Token usage and cost dashboard — per-session and per-model breakdowns, daily spend charts
- Analytics dashboard — activity heatmaps, tool usage, velocity metrics, project breakdowns
- Recent Edits feed — files agents changed most recently across sessions, grouped by project/path, each linking to the message that made the change
- Live updates via SSE as active sessions receive new messages
- Keyboard-first navigation (`j`/`k`/`[`/`]`, `Cmd+K` search, `?` for shortcuts)
- Export sessions as HTML or publish to GitHub Gist

## Supported Agents

Discovers sessions from 50+ agents. Aider is opt-in (no central session dir; set `AIDER_DIR`). Amp is deprecated (current releases may store threads server-side). Notable entries and their session directories:

- Claude Code — `~/.claude/projects/`
- OpenClaude — `~/.openclaude/projects/`
- Claude Cowork — `~/Library/Application Support/Claude/local-agent-mode-sessions/` (macOS)
- Codex — `~/.codex/sessions/`
- Copilot CLI — `~/.copilot/`
- Devin CLI — `~/.local/share/devin/` (Linux), `~/Library/Application Support/devin/` (macOS)
- Cortex Code, Cursor, DeepSeek TUI, Forge (`~/.forge/`), Gemini CLI, gptme, Grok, Hermes Agent, iFlow, Kilo, Kimi, Kiro CLI/IDE, MiMoCode, Mistral Vibe, OpenClaw, OpenCode, OpenHands CLI, OhMyPi, Pi (`~/.pi/agent/sessions/`), Piebald, Posit/Positron Assistant, QClaw, Qoder, Qwen Code, QwenPaw, Reasonix, RooCode, VSCode Copilot, Visual Studio Copilot, Windsurf, Warp, WorkBuddy, Antigravity / Antigravity CLI

## Privacy

Session data remains local by default. Minimal telemetry: app version, commit, OS, CPU architecture only — no session or file details. Disable with `AGENTSVIEW_TELEMETRY_ENABLED=0`.

## Repo facts

- Repo: https://github.com/kenn-io/agentsview
- Stars: ~4,500
- License: MIT
- Primary language: Go (83.9%)
