data-export — Claude Code skill: what it does, how to install
Exports Claude Code sessions, events, costs, and analytics into JSON, CSV, or Markdown. Useful for backups, cost auditing, and custom reports.
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill data-export -a claude-codeWhat data-export does
This skill pulls operational records directly from Agent Monitor running locally. You pass it target data types like sessions, events, costs, or analytics, along with optional date filters and preferred output formats. By default, it outputs formatted JSON with metadata headers.
Under the hood, the skill queries http://localhost:4820 endpoints, including GET /api/sessions and GET /api/pricing/cost. Small responses under 100 rows print right in the conversation, while larger batches save straight to disk with a file path report.
Data retrieval fails immediately if Agent Monitor is not actively running on port 4820. CSV outputs include standard ISO timestamps and cost columns, while Markdown outputs include summary totals for quick review.
What it helps with
- export Claude Code session logs to CSV files
- generate Markdown cost summaries with total spending
- filter events from the last 30 days for reporting
- backup all Agent Monitor metrics into JSON
Example prompts for the agent
- Export sessions from the last 7 days to csv
- Show cost analytics in markdown
- Export all events to json
How to install data-export
1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill data-export -a claude-code2Manually: put the files in place
~/.claude/skills/data-export/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/data-export/
1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill data-export -a codex2Manually: put the files in place
.agents/skills/data-export/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill data-export -a cursor2Manually: put the files in place
.cursor/skills/data-export/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install hoangsonww/Claude-Code-Agent-Monitor data-export2Manually: put the files in place
.github/skills/data-export/SKILL.md1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill data-export -a gemini-cli2Platform CLI
gemini skills install https://github.com/hoangsonww/Claude-Code-Agent-Monitor --path plugins/ccam-devtools/skills/data-exportManually: put the files in place
.devin/skills/data-export/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill data-export -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about data-export
How to install data-export in Claude Code?
Run npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill data-export -a claude-code in your terminal.
What does data-export do?
It collects sessions, costs, events, and metrics from local Agent Monitor API and converts them into JSON, CSV, or Markdown.
What is required to run data-export?
Agent Monitor must be active on http://localhost:4820, because the skill pulls every record from its local endpoints.
Source text
SKILL.md · MIT
---
name: data-export
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
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 saving
© hoangsonww · MIT · hoangsonww/Claude-Code-Agent-Monitor