---
title: "coding.sh sessions · coding.sh docs"
description: "List captured sessions. Every option of coding.sh sessions, from its own --help."
canonical: https://coding.sh/docs/cli/sessions
human_url: https://coding.sh/docs/cli/sessions
markdown_url: https://coding.sh/docs/cli/sessions.md
agents_url: https://coding.sh/agents.md
llms_url: https://coding.sh/llms.txt
updated: 2026-11-11
---

# coding.sh sessions

List captured sessions. Every option of coding.sh sessions, from its own --help.

coding.sh sessions --help

```
coding.sh sessions [options]

  List captured sessions

Options
  -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
  -n, --limit <N>        Maximum rows (default: 20)
      --subagents        Include subagent sessions (a --where with id:, parent:, is:root or is:child picks them itself)
      --empty            Include sessions with no turn, tool call or model call (hidden by default)
      --project <ID>     Only sessions in this serve project (default: all)
      --flag <NAME>      Only sessions with this flag: looping, failure-streak, churn, no-progress, stalled, context-thrash, premature-completion, duplicate-fetch, …, or a tag such as skill:<name>
      --where <QUERY>    Only sessions matching a query, e.g. 'agent:codex cost>0.5 tool:Bash -flag:compaction' (keys: coding.sh sessions --help)
      --fields <PATHS>   With --json: print only these fields, as a comma list of dotted paths (id,title,stats.usage.costUsd). A path through a list picks from each item
      --facets [<KEYS>]  Count sessions per value instead of listing them: agent, model, provider, repo, launch, branch, flag, skill, hook, kind, tool, mcp (default: agent, model, repo, flag, skill, tool)
      --fresh            Wait for every pending capture to be ingested (default: answer after 1.5 s)

Examples
  coding.sh sessions --where 'agent:codex cost>0.5 since:7d'
  coding.sh sessions --where 'tool:Bash ok:false -flag:compaction'
  coding.sh sessions --facets model,tool --where 'repo:coding-sh'

Notes
  --where: key:value clauses, AND by default; OR between clauses; ( ) to group; - to negate; a,b for either value; * as a wildcard in text; > >= < <= and a..b on numbers. Bare words search prompts, replies and tool calls (every word in one event).
  Session keys: agent, model, provider, repo, launch, branch, dir, title, id, run, parent, flag, skill, hook, hook.tokens, since, until, duration, turns, tools, tool.errors, llm.errors, files, events, tests.passed, tests.failed, tokens, tokens.in, tokens.out, cost, cache.breaks, cache.lost, cache.cost, unapproved, has, is. Event keys (the session has a matching event; event keys in one group match the same event): kind, tool, ok, mcp, error, event.duration. Also sort:-cost and limit:N. Full list with examples: docs/reference/query.md.
  --facets counts each key over the query without that key's own clauses, so every value of a picked key still shows. --limit sets the values per key (default 10).
  With --json each session is a digest: its stats without stats.phases, and each derail without the event it started at (eventId, index). show <id> --json has both, and --fields stats.phases or --fields stats.derails prints them here.
  With --json, an answer given before every capture was indexed carries "pending": {"files": N, "indexing": true|false} (files still to ingest; indexing: an ingest is still running). The field is absent once all are indexed.
```

[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).
