MCPcopy Index your code
hub / github.com/kenn-io/agentsview

github.com/kenn-io/agentsview @v0.36.1 sqlite

repository ↗ · DeepWiki ↗ · release v0.36.1 ↗
15,042 symbols 76,172 edges 1,237 files 4,134 documented · 27%
README

agentsview

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

Analytics dashboard

Install

# 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 or via homebrew: brew install --cask agentsview

Or run the published Docker image:

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/kenn-io/agentsview:latest

Quick Start

agentsview serve               # start foreground server
agentsview serve --background  # start server and return to the shell
agentsview serve status        # show whether a server is running
agentsview serve stop          # stop the running server
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.

For Devin CLI, point DEVIN_DIR or devin_dirs at the local root that contains cli/ — for example ~/Library/Application Support/devin on macOS, ~/.local/share/devin on Linux, or a redacted path like .../Application Support/devin. AgentsView reads session data under <root>/cli/... and intentionally ignores copied config or OAuth paths. Do not paste tokens, OAuth files, or other secrets into bug reports.

Claude and Codex sources can also be configured as s3:// roots, so a central AgentsView instance can read sessions that other machines push to S3-compatible object storage. Add those roots to claude_project_dirs or codex_sessions_dirs; AgentsView lists object metadata and only downloads changed sessions during sync. S3 change detection uses size, modified time, and available object fingerprints such as ETag, version ID, or checksums.

The desktop app and freshness-sensitive CLI commands share a detached local daemon. Read-only CLI commands attach to it when it is already running, but fall back to direct read-only SQLite on a cold archive so one-off scripts stay fast. Commands that need fresh data or need to write, such as sync, usage, token-use, pg push, and duckdb push, auto-start the daemon when needed.

Use agentsview serve --background when you want to start the daemon explicitly. The command prints the server URL, process ID, and log path (~/.agentsview/serve.log). Check on it with agentsview serve status and shut it down with agentsview serve stop. Background daemons self-exit after an idle period unless a client request or daemon-owned job is active.

Remote / forwarded access

agentsview binds to loopback and validates the request Host header to guard against DNS-rebinding attacks. When you reach it through SSH port-forwarding, a reverse proxy, or a remote dev environment (exe.dev, Codespaces, Coder, WSL2), the browser sends a Host that the server does not recognize, so API requests such as /api/v1/settings are rejected with 403 Forbidden.

To fix this, restart the server with --public-url set to the exact origin you open in the browser:

# Browser opens http://127.0.0.1:18080 via `ssh -L 18080:127.0.0.1:8080 host`
agentsview serve --public-url http://127.0.0.1:18080

# Browser opens a forwarded hostname
agentsview serve --public-url https://your-workspace.exe.dev

Use --public-origin (repeatable or comma-separated) to trust additional browser origins. If you expose the UI beyond loopback, also enable --require-auth.

Docker

The container image defaults to local agentsview serve. Set PG_SERVE=1 to switch the startup command to agentsview pg serve instead.

docker-compose.prod.yaml is included as a production example:

docker compose -f docker-compose.prod.yaml up -d

The included compose file persists the agentsview data directory in a named volume and mounts Claude, Codex, Forge, and OpenCode session roots read-only. The container runs as root, so prefer a named volume for /data over a host bind mount; if you do bind-mount, pre-create the directory with the desired ownership to avoid root-owned files in your home directory.

The examples publish the UI on loopback only (127.0.0.1). If you need to expose it beyond localhost, enable --require-auth and publish the port intentionally.

Important: a containerized agentsview instance can only discover agent sessions from directories you explicitly mount into the container. If you do not mount an agent's session directory and point the matching env var at it, that agent will not appear in the UI.

Example PostgreSQL-backed startup:

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/kenn-io/agentsview:latest

Example DuckDB mirror startup:

# Populate /data/sessions.duckdb from the mounted SQLite archive.
docker run --rm \
  -v agentsview-data:/data \
  -v "$HOME/.claude/projects:/agents/claude:ro" \
  -e CLAUDE_PROJECTS_DIR=/agents/claude \
  ghcr.io/kenn-io/agentsview:latest duckdb push --full

# Serve the populated mirror read-only.
docker run --rm -p 127.0.0.1:8080:8080 \
  -v agentsview-data:/data \
  ghcr.io/kenn-io/agentsview:latest duckdb serve

Example Quack startup:

# Expose the local DuckDB mirror over Quack from the host/container.
QUACK_TOKEN="$(openssl rand -base64 32)"
docker run --rm -p 127.0.0.1:9494:9494 \
  -v agentsview-data:/data \
  ghcr.io/kenn-io/agentsview:latest \
  duckdb quack serve \
    --bind quack:0.0.0.0:9494 \
    --token "$QUACK_TOKEN" \
    --allow-insecure

# Serve the web UI from a remote Quack endpoint.
docker run --rm -p 127.0.0.1:8080:8080 \
  -e AGENTSVIEW_DUCKDB_URL='quack:https://duckdb.example.com' \
  -e AGENTSVIEW_DUCKDB_TOKEN="$QUACK_TOKEN" \
  ghcr.io/kenn-io/agentsview:latest duckdb serve

Keep Quack on loopback or behind TLS. Plain HTTP Quack on a non-loopback bind requires --allow-insecure and should only be used behind a trusted tunnel or reverse proxy.

Token Usage and Cost Tracking

agentsview usage is a fast, local replacement for ccusage and similar tools. It tracks token consumption and compute costs across all your 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.

# Daily cost summary (default: last 30 days)
agentsview usage daily

# Per-model breakdown
agentsview usage daily --breakdown

# Filter by agent and date range
agentsview usage daily --agent claude --since 2026-04-01

# One-line summary for shell prompts / status bars
agentsview usage daily --all --json
agentsview usage statusline

Features:

  • Automatic pricing via LiteLLM rates (with offline fallback)
  • Prompt-caching-aware cost calculation (cache creation / read tokens)
  • Per-model breakdown with --breakdown
  • Date filtering (--since, --until, --all), agent filtering (--agent)
  • JSON output (--json) for scripting
  • Timezone-aware date bucketing (--timezone)
  • Works standalone -- no server required, just run the command

Per-Session Details

agentsview session usage <id> prints per-session token statistics plus a cost estimate for a single session. The output reports the session's total output tokens and peak context tokens, plus a cost estimate in USD (cost_usd) when pricing is available for the session's model(s) (has_cost). Cost is computed from input/output and cache tokens internally, but only the output-token and peak-context totals are reported alongside the cost.

# Print token usage and cost for a specific session
agentsview session usage <id>

# JSON output for scripting
agentsview session usage <id> --format json

The same per-session usage data is available from the REST API:

GET /api/v1/sessions/{id}/usage

The response includes the session_id, agent, project, total_output_tokens, peak_context_tokens, has_token_data, cost_usd, has_cost, models, and unpriced_models fields from the CLI JSON schema. HTTP responses also include server_running: true. Existing sessions return 200 even when token or cost data is absent; missing sessions return 404.

The deprecated alias agentsview token-use <id> remains available for compatibility and now also reports cost estimates.

Session Stats

agentsview stats emits window-scoped analytics over recorded sessions: totals, archetypes (automation vs. quick/standard/deep/marathon), distributions for session duration, user-message count, peak context, and tools-per-turn, plus cache economics, tool/model/agent mix, and a temporal hourly breakdown. The --format json output follows a versioned v1 schema (schema_version: 1) suitable for downstream consumers.

By default, stats only reads the local SQLite archive. Git-derived outcome metrics are opt-in because they can be slow or brittle on large/missing repos: use --include-git-outcomes for commits/LOC/files changed, and --include-github-outcomes for GitHub PR counts via gh (this also enables git outcomes).

# Human-readable summary over the last 28 days
agentsview stats

# Machine-readable JSON over a fixed date range
agentsview stats --format json --since 2026-04-01 --until 2026-04-15

# Restrict to one agent and inspect the schema
agentsview stats --format json --agent claude | jq '.schema_version'

# Include expensive local git outcome metrics explicitly
agentsview stats --include-git-outcomes

Session Browser

Dashboard Session viewer
Dashboard Session viewer
Search Activity heatmap
Search Heatmap
  • Full-text search across all message content (FTS5)
  • Token usage and cost dashboard -- per-session and per-model cost breakdowns, daily spend charts, all in the web UI
  • Analytics dashboard -- activity heatmaps, tool usage, velocity metrics, project breakdowns
  • Recent Edits feed -- the files your agents changed most recently across every session, grouped by project and 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 all shortcuts)
  • Export sessions as HTML or publish to GitHub Gist

Supported Agents

agentsview discovers sessions from all of these. Aider is opt-in because it has no central session directory; set AIDER_DIR or aider_dirs to enable it. Amp support is deprecated because current Amp releases may store threads server-side and leave only local stubs; agentsview can still parse historical local Amp thread JSON files.

Agent Session Directory
Aider <repo>/.aider.chat.history.md (per repo; opt in with AIDER_DIR or aider_dirs)
Amp (deprecated) ~/.local/share/amp/threads/ (historical local thread JSON only)
Antigravity ~/.gemini/antigravity/
Antigravity CLI ~/.gemini/antigravity-cli/ (see note below)
Claude Code ~/.claude/projects/
OpenClaude ~/.openclaude/projects/
Claude Cowork ~/Library/Application Support/Claude/local-agent-mode-sessions/ (macOS)
Codex

Extension points exported contracts — how you extend this code

ProviderFactory (Interface)
ProviderFactory is the registry surface for creating config-bound provider instances. [28 implementers]
internal/parser/provider.go
SyncStateStore (Interface)
SyncStateStore is the interface needed for normalizing local sync timestamps stored in SQLite. [4 implementers]
internal/postgres/time.go
Emitter (Interface)
Emitter is notified after a sync pass writes data. Implementations must be thread-safe; Emit is called from whatever gor [4 …
internal/sync/engine.go
SessionService (Interface)
SessionService is the canonical per-session operation interface. Two implementations: directBackend (wraps *db.DB) and h [3 …
internal/service/service.go
Store (Interface)
Store is the interface the HTTP server uses for all data access. Any new server-visible query or mutation belongs here, [3 …
internal/db/store.go
MockInstance (Interface)
(no doc) [2 implementers]
frontend/src/lib/virtual/createVirtualizer.cache.test.ts
GenerateFunc (FuncType)
GenerateFunc is the signature for insight generation, allowing tests to substitute a stub.
internal/insight/generate.go
Option (FuncType)
Option configures a Server.
internal/server/server.go

Core symbols most depended-on inside this repo

Len
called by 2002
internal/duckdb/push.go
Close
called by 1370
cmd/agentsview/pg_watch.go
Get
called by 1036
internal/service/service.go
Run
called by 907
internal/ssh/sync.go
Exec
called by 501
internal/db/db.go
Err
called by 491
internal/parser/linereader.go
Add
called by 416
internal/db/query_dialect.go
Scan
called by 404
internal/db/sessions.go

Shape

Function 10,434
Method 2,964
Struct 1,221
Interface 213
Class 132
TypeAlias 52
FuncType 25
Enum 1

Languages

Go90%
TypeScript10%
Python1%

Modules by API surface

internal/sync/engine.go269 symbols
internal/server/server_test.go218 symbols
internal/sync/engine_integration_test.go210 symbols
internal/db/db_test.go194 symbols
internal/db/analytics.go176 symbols
internal/duckdb/analytics_usage.go122 symbols
internal/sync/engine_test.go120 symbols
internal/parser/antigravity_test.go107 symbols
internal/db/sessions.go101 symbols
internal/db/analytics_test.go100 symbols
internal/db/db.go99 symbols
internal/config/config_test.go98 symbols

Dependencies from manifests, versioned

dario.cat/mergov1.0.2 · 1×
github.com/Azure/go-ansitermv0.0.0-2025010203350 · 1×
github.com/Microsoft/go-winiov0.6.2 · 1×
github.com/apache/arrow-go/v18v18.5.1 · 1×
github.com/cespare/xxhash/v2v2.3.0 · 1×
github.com/containerd/errdefsv1.0.0 · 1×
github.com/containerd/errdefs/pkgv0.3.0 · 1×
github.com/containerd/logv0.1.0 · 1×
github.com/containerd/platformsv0.2.1 · 1×
github.com/cpuguy83/dockercfgv0.3.2 · 1×

Datastores touched

agentsviewDatabase · 1 repos
dbDatabase · 1 repos
dbnameDatabase · 1 repos
agentsDatabase · 1 repos
agents_archiveDatabase · 1 repos
agentsview_testDatabase · 1 repos
appDatabase · 1 repos
archiveDatabase · 1 repos

For agents

$ claude mcp add agentsview \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact