17d56d0e01
Clean break, no compatibility alias. Renames the product name, the CLI binary (`ccam` -> `agenthub`), the env var prefix (`CCAM_` -> `AGENTHUB_`), the Prometheus metric namespace (`ccam_*` -> `agenthub_*`), the tmux session prefix (`ccam-lane-<id>` -> `agenthub-lane-<id>`), the per-repo runtime profile directory (`.ccam/profile` -> `.agenthub/profile`), the lanes state root (`~/.claude/ccam-lanes` -> `~/.claude/agenthub-lanes`), the bundled plugins (`plugins/ccam*` -> `plugins/agenthub*`) and their slash commands (`/ccam-doctor` -> `/agenthub-doctor`, `/ccam:*` -> `/agenthub:*`). Because there is no alias, an existing install has to be updated by hand: rename its `.ccam/profile` directory and any `CCAM_*` variables, and reinstall the plugin under its new name. Two other name families are deliberately left alone here, since they are not just strings: the `Claude-Code-Monitor` repository/marketplace name, and the `agent-dashboard` npm package plus its `~/.claude/agent-dashboard` runtime directory, which holds the live database and needs a migration rather than a rename. Verified: server 1406/1406, client 459/459, `grep -i ccam` clean across tracked files, `openapi.yaml` regenerated (95 paths, unchanged count).
2.1 KiB
2.1 KiB
description
| description |
|---|
| Export Claude Code session and analytics data in JSON, CSV, or Markdown formats. Supports exporting sessions, events, costs, and analytics for external analysis or reporting. Use for data backup or integration. |
Data Export
Export Agent Monitor data in various formats.
Input
The user provides: $ARGUMENTS
This may be:
- A data type: "sessions", "events", "analytics", "costs", "all"
- A format: "json", "csv", "markdown" (default: json)
- A filter: "last 7 days", "session {id}", "completed only"
- Combined: "sessions csv last 30 days"
Procedure
-
Parse the request to determine:
- Data scope: which data to export
- Format: output format
- Filters: time range, status, session ID
-
Fetch data from
http://localhost:4820:- Sessions:
GET /api/sessions?limit=1000 - Events:
GET /api/events?limit=5000 - Analytics:
GET /api/analytics - Costs:
GET /api/pricing/cost - Full export:
GET /api/settings/export
- Sessions:
-
Transform to requested format:
JSON Format
Pretty-printed JSON with metadata header:
{ "export": { "source": "AgentHub", "exported_at": "2025-04-11T12:00:00Z", "filters": { "type": "sessions", "range": "last 7 days" }, "count": 42 }, "data": [...] }CSV Format
Standard CSV with headers, proper quoting, and ISO timestamps:
id,name,status,model,started_at,ended_at,duration_minutes,cost_usdMarkdown Format
Human-readable tables with summary statistics:
# Agent Monitor Export — Sessions (Last 7 Days) | ID | Name | Status | Model | Duration | Cost | |... **Total: 42 sessions, $12.34 cost** -
Output the data:
- For small exports (<100 rows): output directly
- For large exports: save to file and report the path
- Include row count and any filter notes
Output Format
Deliver the exported data in the requested format. Always include:
- Export metadata (when, what, filters applied)
- Row/record count
- Suggested filename for saving