agentsview README

The project's README from github.com/kenn-io/agentsview. As one markdown file: README.md.

agentsview

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

Analytics dashboard

Install

macOS and Linux:

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

Windows (PowerShell):

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 the server in the foreground
agentsview daemon start    # alternatively, start the same server in the background
agentsview daemon status   # show daemon status
agentsview daemon restart  # restart from current configuration
agentsview daemon stop     # stop the server, web UI, and sync
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.

The daemon is the server: the web UI, API, session sync, and file watchers share one process. Choose serve for a foreground process or daemon start for a background process. Running serve when a compatible daemon is already running reports its URL and exits. daemon stop and serve stop both stop that writable server, including sync; serve stop also stops read-only mirror servers for the same data directory.

For Devin CLI, point DEVIN_DIR or agents.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 agents.claude.dirs or agents.codex.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. The server remains running after these commands exit and also serves the web UI. For a one-shot sync with no background server, stop the daemon first and run AGENTSVIEW_NO_DAEMON=1 agentsview sync.

Use agentsview daemon start when you want to start the writable SQLite daemon explicitly. It loads the normal effective configuration from config.toml and supported environment variables; daemon start and daemon restart accept no serve-specific flags. Background daemons self-exit after an idle period unless a client request or daemon-owned job is active.

The existing agentsview serve --background, agentsview serve status, and agentsview serve stop commands remain available. Use serve --background when a one-off daemon needs a serve-only flag, such as --no-sync or an unauthenticated non-loopback --host override.

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

--public-url also selects the URL opened on startup; it does not configure a listener or external proxy. Use --no-browser on a headless server, or use --public-origin (repeatable or comma-separated) on its own for trust-only configuration. If you expose the UI beyond loopback, also enable --require-auth. See Remote Access for the listener, browser URL, and managed Caddy port rules.

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:[email protected]: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.
# The client url uses the native quack:HOST:PORT form; the Quack extension
# does not accept quack:http:// or quack:https:// urls. A non-loopback host
# needs --allow-insecure.
docker run --rm -p 127.0.0.1:8080:8080 \
  -e AGENTSVIEW_DUCKDB_URL='quack:duckdb.example.com:9494' \
  -e AGENTSVIEW_DUCKDB_TOKEN="$QUACK_TOKEN" \
  ghcr.io/kenn-io/agentsview:latest duckdb serve --allow-insecure

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 tracks token consumption and compute costs across all your coding agents -- not just Claude Code. Reports read from the same local SQLite archive that powers the UI.

# 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:

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 (cost) 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, has_cost, models, and unpriced_models fields from the CLI JSON schema. Machine-readable money is always an integer microdollar object, for example {"cost":{"microdollars":2410000}}; CLI tables and labels render that value as ordinary dollars. 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.

For one exact non-interactive claude -p or codex exec --json execution in CI, use agentsview capture run. It preserves the child streams and exit outcome, writes a separate versioned usage result, and starts no daemon, web server, or watcher. See One-shot CI capture.

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

Supported Agents

agentsview discovers sessions from all of these. Aider is opt-in because it has no central session directory; set AIDER_DIR or agents.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 agents.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 ~/.codex/sessions/
Copilot CLI ~/.copilot/
Devin CLI ~/.local/share/devin/ (Linux), ~/Library/Application Support/devin/ (macOS); point DEVIN_DIR / agents.devin.dirs at the root that contains cli/
Evener ~/.local/state/evener/projects/ (or $XDG_STATE_HOME/evener/projects/; semantic transcript v2)
Cortex Code ~/.snowflake/cortex/conversations/
Cursor ~/.cursor/projects/
DeepSeek TUI ~/.codewhale/sessions/, ~/.deepseek/sessions/
DeepSeek Harness ~/.dsh/sessions/ (or $DSH_HOME/sessions/)
Forge ~/.forge/
Gemini CLI ~/.gemini/
Goose ~/.local/share/goose/sessions/ (macOS a

agentsview (kenn-io/agentsview)

Searching Database…

这是什么?AgentsView 是一款本地优先的工具,用于浏览、搜索和追踪 Claude Code、Codex 以及其他 20 多种编码智能体会话的费用。所有数据都保存在本地 SQLite 数据库中,无需任何云端账户。
这是命令行工具还是网页应用?它是一个单一的 Go 二进制文件,以本地守护进程方式运行,在同一个进程中同时提供命令行工具和网页界面/API,此外还提供适用于 macOS 和 Windows 的桌面应用。
我该如何让它运行起来?在 macOS/Linux 上安装二进制文件,在 Windows 上通过 PowerShell 安装;也可以从 GitHub Releases 获取桌面应用,或运行 'brew install --cask agentsview';还可以直接运行已发布的 Docker 镜像。首次运行时,它会发现所有受支持智能体的会话,并在提供网页界面的同时,将这些会话同步到本地 SQLite 数据库中。
要让费用统计生效,我需要 API 密钥吗?不需要。费用会通过 LiteLLM 和 OpenRouter 的价格表自动计算,并提供离线备用方案,因此无需任何外部账户即可获得费用估算。
Docker 版本会自动看到我所有的智能体会话吗?不会。容器化的实例只能发现你明确挂载到容器中的目录里的会话。如果某个智能体的会话文件夹没有挂载,且其环境变量也没有设置,该智能体就不会出现在网页界面中。
我的会话数据会离开我的电脑吗?不会。所有内容都在本地存储和处理,保存在 SQLite 归档中;默认情况下,无需账户,也不依赖任何外部服务。
它支持哪些编码智能体?它支持 Claude Code、Codex、Cursor、Gemini CLI、Devin CLI、Copilot CLI、Aider、Forge,以及远不止 20 种的其他智能体,每种智能体都有各自文档说明的会话目录。
Token 用量和费用统计是如何工作的?'agentsview usage' 命令会读取本地 SQLite 归档,按模型和会话报告费用。计算时会考虑提示词缓存,支持按日期和智能体筛选,还能输出 JSON 供脚本使用,且无需服务器。
我能通过 SSH 端口转发或远程开发容器打开仪表盘吗?默认情况下,AgentsView 绑定到回环地址,并会拒绝无法识别的 Host 请求头,以阻止 DNS 重绑定攻击。因此远程环境需要重新启动它,并将 --public-url 设为浏览器访问的精确来源地址;如果要暴露到 localhost 之外,还需加上 --require-auth。
除了搜索会话,我在网页界面里实际还能做什么?它包括全文搜索和可选启用的语义搜索、按会话和模型划分的费用仪表盘、活动热力图、最近编辑动态流、回忆语料浏览器、实时 SSE 更新、键盘优先的导航,以及导出为 HTML 和 GitHub Gist。
Creator
kenn-io
Size
62.6 MB
Stars
6.2K
Age
8mo
Commits · 90 Days