data-export
The data-export skill retrieves Agent Monitor information such as sessions, events, analytics, and costs from a local API endpoint, then transforms and outputs the data in JSON, CSV, or Markdown format based on user specifications. Use this skill when you need to extract and reformat monitoring data with optional filtering by time range or session ID.
git clone --depth 1 https://github.com/hoangsonww/Claude-Code-Agent-Monitor /tmp/data-export && cp -r /tmp/data-export/plugins/ccam-devtools/skills/data-export ~/.claude/skills/data-exportSKILL.md
# 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
1. **Parse the request** to determine:
- Data scope: which data to export
- Format: output format
- Filters: time range, status, session ID
2. **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`
3. **Transform to requested format**:
### JSON Format
Pretty-printed JSON with metadata header:
```json
{
"export": {
"source": "Claude Code Agent Monitor",
"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_usd
```
### Markdown Format
Human-readable tables with summary statistics:
```markdown
# Agent Monitor Export — Sessions (Last 7 Days)
| ID | Name | Status | Model | Duration | Cost |
|...
**Total: 42 sessions, $12.34 cost**
```
4. **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 savingOperate and maintain the local MCP server for this repository. Use for MCP tool updates, policy-guard changes, host configuration, and MCP runtime troubleshooting.
Run release-readiness checks for this repository. Use when validating docs, scripts, verification coverage, and operational safety before merge or release.
Understand this repository quickly before making changes. Use for architecture discovery, ownership mapping, command selection, and initial implementation planning.
Review backend route and hook logic for regressions, data integrity risks, and missing tests.
Review React UI changes for behavior regressions, state consistency, and UX breakage.
Review MCP server changes for tool safety, schema quality, and host integration correctness.
Debug production-like issues in this repository with disciplined evidence gathering. Use when fixing failing workflows, regressions, flaky behavior, or data inconsistencies across hooks, API, DB, websocket, and UI.
Operate and maintain the local MCP server for this project. Use when creating MCP host config, troubleshooting tool connectivity, modifying tool domains, or adjusting safety policy flags.