---
title: "coding.sh export · coding.sh docs"
description: "Stream sessions, events or labels as JSONL or CSV, or write raw traces to a directory. Every option of coding.sh export, from its own --help."
canonical: https://coding.sh/docs/cli/export
human_url: https://coding.sh/docs/cli/export
markdown_url: https://coding.sh/docs/cli/export.md
agents_url: https://coding.sh/agents.md
llms_url: https://coding.sh/llms.txt
updated: 2026-11-11
---

# coding.sh export

Stream sessions, events or labels as JSONL or CSV, or write raw traces to a directory. Every option of coding.sh export, from its own --help.

coding.sh export --help

```
coding.sh export [what] [options]

  Stream sessions, events or labels as JSONL or CSV, or write raw traces to a directory

Arguments
  what          sessions, events or labels (not needed with --evidence)

Options
      --format <FORMAT>  Output format (default: jsonl)
      --evidence <DIR>   Instead: write each matching session's events, tool inputs and full outputs, redacted, as files under DIR
      --force            With --evidence, write into a directory that is not empty
  -a, --agent <AGENT>    Only sessions from this agent (repeatable, or a comma list: a,b)
  -r, --repo <PATH>      Only sessions in this repo root
      --since <WHEN>     Only at or after this time: 7d, 12h, 30m, today, yesterday or a date. A date without a zone is local time: 2026-11-09 is local midnight
      --flag <NAME>      Only sessions with this flag or tag, as in coding.sh sessions --flag
      --subagents        Include subagent sessions (and their events and labels). A --where with id:, parent:, is:root or is:child picks them itself
      --project <ID>     Only sessions in this serve project (default: all)
  -n, --limit <N>        Only the N newest matching sessions (default: all)
      --where <QUERY>    Only sessions (and their events and labels) matching a query, e.g. 'agent:codex cost>0.5 tool:Bash -flag:compaction' (keys: coding.sh sessions --help)
      --fresh            Wait for every pending capture to be ingested (default: answer after 1.5 s)

Examples
  coding.sh export sessions --since 30d --format csv > sessions.csv
  coding.sh export events --where 'agent:codex tool.errors>0' > events.jsonl
  coding.sh export labels --format csv

Notes
  --evidence writes DIR/index.md and, per session, index.md (stats and a timeline), session.json, events.jsonl and tools/NNNN-<tool>.txt (one tool call: input and whole output, read back from the blob store). Everything is redacted first; a tool file stops at 200 KB and events.jsonl at 5 MB. The same index gives the same bytes. Prints DIR.
  JSONL rows are the stored objects, one per line. CSV has fixed columns (docs/reference/query.md); event payloads are a JSON column.
  Text cells that start with = + - or @ get a leading ' in CSV so a spreadsheet does not run them as formulas.
  Works on every store, Postgres and ClickHouse included. Rows are streamed, so memory stays flat.
```

[All commands](https://coding.sh/docs/cli) · [Global options](https://coding.sh/docs/cli#global)

To set coding.sh up for a user, follow the agent workflow at [/agents.md](https://coding.sh/agents.md).
