agent-analyzer
v0.1.16
Published
Local-first deterministic profiler for agentic coding logs.
Readme
Agent Analyzer
Deterministic performance profiler for AI coding workflows.
This repo starts with a Docker-local, end-to-end implementation:
- run the analyzer locally against target-sized recent supported agent logs per source
- write a sanitized report JSON that the user can inspect before upload
- upload only the sanitized report JSON
- detect waste patterns and ecosystem fingerprints
- generate a private-link report JSON
- download a free report pack and generate a plugin artifact from the same scan
- view the report in a static local web UI
The production target is CDN + local deterministic CLI + report-only upload + durable private-link report storage. Local development intentionally avoids cloud dependencies so the complete flow can be tested before any infrastructure is provisioned.
Launch Command
The public launch path is one copy/paste command:
npx --yes agent-analyzer@latest runThat command fetches a scriptless npm package, runs the bundled native Go binary,
selects recent logs per supported agent source to target roughly 5 MB locally, writes agent-analyzer-report.json,
shows the upload boundary, asks for confirmation, uploads only sanitized report
JSON, and opens the private report page.
For users who do not want npm/NPX, versioned GitHub Release archives with
checksums.txt remain available. See docs/distribution.md.
There is intentionally no browser upload form. Agent logs live in hidden tool-specific directories, which are awkward for Finder/browser upload flows. The public launch path is local-first:
npx --yes agent-analyzer@latest runstarts the local native analyzer.- The analyzer selects recent logs per supported source, currently Claude Code, Claude Desktop, Codex, OpenCode, Claude Desktop MCP, Cursor, Kiro, and Google Antigravity, targeting roughly 5 MB total per source, parses and redacts them locally, and writes
agent-analyzer-report.json. - The CLI prints the upload boundary and asks for confirmation.
- After confirmation, it sends only the sanitized report to
POST /api/client-reports. - The private report opens at
/r/{job_id}/{report_token}and remains available for later review. - The report page offers a free zip download containing a branded token-saving field guide PDF, a personalized PDF report, the sanitized report JSON, a plugin preview, and a partner voucher. The custom plugin artifact is generated from the sanitized report data.
Legacy raw-log token upload and email/full-scan endpoints still exist for internal compatibility tests. They are not the public onboarding path.
Paid delivery contract: docs/remediation/plugin-artifacts.md.
Local Runthrough
The analyze subcommand accepts a log path either as a positional argument or
via the --log flag. The two forms are mutually exclusive; passing both, or
passing more than one positional, fails fast with a non-zero exit:
# positional form (equivalent to using --log):
agent-analyzer analyze ~/.claude/projects/some-session.jsonl --out ./report.json
# explicit --log form:
agent-analyzer analyze --log ~/.claude/projects/some-session.jsonl --out ./report.json
# force a source-specific parser for an explicit path:
agent-analyzer analyze --source claude_desktop --log ~/Library/Application\ Support/Claude/audit.jsonl --out ./report.jsonIf neither form is supplied, the CLI auto-discovers target-sized recent logs per supported source. It aims for roughly 5 MB total per source, combines up to five small logs when that gets closer to the target, and falls back to a single huge log when only oversized sessions are available.
SQLite extraction is included in automatic discovery for Cursor, Kiro, Google Antigravity, and bounded Codex diagnostic logs. The CLI opens readable stores in SQLite read-only mode, extracts only bounded known rows, and does not write database snapshots or modify source stores.
docker compose up --buildOpen http://localhost:8080 and use the displayed one-line local analyze/review/upload flow. The smoke scripts also exercise the free report pack, plugin artifact download, and legacy token path with testdata/fixtures/sample-claude.jsonl for backend compatibility.
Smoke test:
./scripts/smoke-local.shIf Docker Desktop is unavailable, the same API/worker path can be checked with:
./scripts/smoke-native.shLocal load gate:
COMPOSE_PROJECT_NAME=agent-log-analyzer-load docker compose up --build -d
./scripts/load-local.sh 25
COMPOSE_PROJECT_NAME=agent-log-analyzer-load docker compose down -vAggregate analytics summary, for retained analytics.Event JSONL only:
go run ./cmd/analytics-summary --input /tmp/agent-log-analyzer/analytics/events.jsonl --min-cohort 10AWS-backend local smoke with LocalStack:
./scripts/smoke-aws-local.shDevelopment
go test ./...
go run ./cmd/api
go run ./cmd/workerUseful local env vars:
CLAUDE_ANALYZER_DATA_DIR, default/tmp/agent-log-analyzerCLAUDE_ANALYZER_ADDR, default:8080CLAUDE_ANALYZER_WORKER_INTERVAL, default2s
Privacy Posture
Raw logs are treated as toxic. The launch UX parses and redacts locally, emits aggregate-safe ecosystem IDs only, and uploads only sanitized report JSON. Operational logs forbid raw prompt/tool text.
See docs/data-retention-and-analytics.md.
Cloud launch checklist: docs/cloud-launch-todo.md.
License
Agent Analyzer is source-available, not open source. You may inspect, clone, and run the software for personal/internal evaluation and development testing, but production, hosted, commercial, redistribution, and managed-service uses require a separate written license.
See LICENSE.
