| name | sessions |
| description | Search, browse, and read agent conversation transcripts across Claude, Codex, Gemini, and OpenCode. Use this skill to find previous sessions, recover context, or inspect what agents have done. |
| argument-hint | [search query or session ID] |
| allowed-tools | Bash(agents sessions*), Bash(agents cost*), Bash(agents logs*) |
| user-invocable | true |
Sessions Skill
Search and browse agent conversation transcripts. This skill teaches you how to use the agents sessions CLI effectively.
Basic Usage
agents sessions
agents sessions | head -20
agents sessions "add auth middleware"
agents sessions --project agents-cli --all
Filters
| Filter | Example | Description |
|---|
--agent | --agent claude | Filter by agent type |
--all | --all | Include sessions from every directory |
--project | --project myapp | Filter by project name |
--since | --since 2h | Only sessions newer than this |
--until | --until 2026-01-01 | Only sessions older than this |
--limit | --limit 10 | Maximum sessions to return |
--sort | --sort cost | Order by cost, duration, or recent (default) |
--active | --active | Only currently running sessions |
--teams | --teams | Include team-spawned sessions |
Reading Sessions
agents sessions --markdown <session-id>
agents sessions --json <session-id>
agents sessions --markdown --include user,assistant <session-id>
agents sessions --markdown --last 10 <session-id>
Artifacts
agents sessions --artifacts <session-id>
agents sessions --artifact <filename> <session-id>
Live Tailing
agents sessions tail <session-id>
agents logs <id>
agents logs <id> -f
Cost & Duration
Every session is priced offline at scan time (costUsd) and its wall-clock
runtime is stored (durationMs). Both appear in --json output, and the list
can be sorted by either.
agents sessions --all --sort cost --limit 10
agents sessions --sort duration
agents sessions --all --sort cost --json | jq '.[] | {shortId, agent, costUsd, durationMs}'
Use agents cost for a fleet-wide rollup (daily $ histogram, top sessions,
per-agent/project/day breakdown):
agents cost
agents cost --since 30d
agents cost --by project
agents cost --by day --json
agents cost answers "how much did this cost?"; agents usage answers "how
much quota / rate limit is left?" — different commands.
Tips
- Use
--active to find sessions running right now across terminals, teams, cloud, and headless agents
- Use
--teams to see what team-spawned agents are doing
- Use
--since 1h for recent activity
- Use
--sort cost / --sort duration to find your priciest or longest sessions
agents cost for spend rollups; agents usage for rate-limit status
- Combine filters:
agents sessions --project myapp --since 1d --agent claude