Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill data-export -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/data-export/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/data-export/

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

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set60

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor