Cline Session History
Search and browse Cline session history stored on the local machine. Sessions live in ~/.cline/data/sessions/ as individual JSON metadata files and conversation transcript (.messages.json) files. Older sessions may also be in a sessions.db SQLite database.
When to Use This Skill
- "Find my session from the last hour about..."
- "Find my session that started with this prompt..."
- "Find the session where I asked about..."
- "Show me sessions that used model X"
- "What sessions failed yesterday?"
- "Show me the transcript for session "
- "Export sessions from last week to a folder"
- "What was that session where..."
- Any request involving past Cline conversation history
How to Use
The search script lives alongside this file at scripts/search_sessions.py, relative to the skill's own directory. Resolve it against the directory that contains this SKILL.md — not the current working directory — so it works regardless of where the command is run from.
Script path: scripts/search_sessions.py (relative to this skill's directory)
The examples below use scripts/search_sessions.py; prefix it with the skill directory's absolute path when running from elsewhere.
All filters are optional and combine with AND logic.
Quick Examples
# Sessions from the last 10 minutes
python3 scripts/search_sessions.py --since 10m
# Sessions between two dates with "chatgpt" in the prompt
python3 scripts/search_sessions.py --since 2026-06-01 --until 2026-06-21 --prompt chatgpt
# Find a session by its starting prompt (quoted substring match)
python3 scripts/search_sessions.py --since 1d --prompt "find some code that should be improved" --full-prompt
# Non-interactive sessions that failed
python3 scripts/search_sessions.py --no-interactive --status failed
# VS Code extension sessions using Claude models, full prompts
python3 scripts/search_sessions.py --source vscode --model "claude" --full-prompt
# Full transcript of a specific session
python3 scripts/search_sessions.py --session-id 1781991507587_pozk0 --transcript
# Export matching sessions to a directory
python3 scripts/search_sessions.py --since 1d --export ~/tmp/exported-sessions
Time Filters
Both --since and --until accept:
- Relative:
10m, 30min, 2h, 1d, 1w (minutes, hours, days, weeks)
- ISO 8601:
2026-06-20, 2026-06-20T21:30:00Z, 2026-06-20T21:30:00+00:00
All Available Filters
| Filter |
Description |
--since <time> |
Sessions started after this time |
--until <time> |
Sessions started before this time |
--prompt <text> |
Case-insensitive substring search in prompt |
--prompt-regex <pattern> |
Regex search in prompt (case-insensitive) |
--status <status> |
running, idle, completed, cancelled, failed |
--source <source> |
cli, vscode, etc. (exact match) |
--provider <name> |
Provider name, exact match (e.g. cline) |
--model <text> |
Model name substring, case-insensitive (e.g. claude) |
--mode <mode> |
plan or act |
--cwd <path> |
Working directory substring match |
--session-id <id> |
Exact session ID lookup |
--interactive / --no-interactive |
Filter by interactive flag |
--team-only / --no-team |
Filter by team session flag |
--subagents / --no-subagents |
Include/exclude subagent sessions |
Output Options
| Option |
Description |
--full-prompt |
Show full prompt text instead of truncated |
--transcript |
Print full conversation transcript |
--max-messages <n> |
Limit messages in transcript output |
--content-types <types> |
Comma-separated: text,thinking,tool_use,tool_result,image |
--export <dir> |
Copy matching session files to a directory |
--limit <n> |
Max number of sessions to return |
--json |
Output as JSON |
Data Source Options
| Option |
Description |
--sessions-dir <path> |
Custom sessions directory (default: ~/.cline/data/sessions) |
--db-path <path> |
Custom sessions.db path |
--no-db |
Skip SQLite DB, only scan JSON files |
Workflow
- Start by running the search with the user's criteria to get a list of matching sessions.
- If the user wants to see details, use
--full-prompt or --transcript.
- For transcript inspection, consider
--max-messages and --content-types to focus on relevant parts.
- For bulk export, use
--export <dir> to copy session files.
Session Data Structure
Each session on disk has:
<session_id>.json — Metadata: session_id, started_at, status, source, provider, model, cwd, prompt, metadata (mode, systemPrompt, cost, usage), etc.
<session_id>.messages.json — Full conversation transcript with messages containing content blocks (text, thinking, tool_use, tool_result, image).
The SQLite sessions.db may contain older sessions with similar fields plus transcript_path, hook_path, parent_session_id, agent_id, is_subagent.
1---2name: cline-session-history3description: Search and browse Cline session history. Use when the user asks to find, list, inspect, or export Cline sessions by time period, prompt content, status, model, provider, source, mode, workspace, or other criteria. Also use when the user wants to read a session transcript or export sessions to a directory. Trigger phrases include "find my session", "search my session history", "show me past sessions", "what was that session where", "find the session that started with", and any mention of past Cline conversations.4---5
6# Cline Session History
7
8Search and browse Cline session history stored on the local machine. Sessions live in `~/.cline/data/sessions/` as individual JSON metadata files and conversation transcript (`.messages.json`) files. Older sessions may also be in a `sessions.db` SQLite database.
9
10## When to Use This Skill
11
12- "Find my session from the last hour about..."
13- "Find my session that started with this prompt..."
14- "Find the session where I asked about..."
15- "Show me sessions that used model X"
16- "What sessions failed yesterday?"
17- "Show me the transcript for session <id>"
18- "Export sessions from last week to a folder"
19- "What was that session where..."
20- Any request involving past Cline conversation history
21
22## How to Use
23
24The search script lives alongside this file at `scripts/search_sessions.py`, relative to the skill's own directory. Resolve it against the directory that contains this `SKILL.md` — **not** the current working directory — so it works regardless of where the command is run from.
25
26**Script path:** `scripts/search_sessions.py` (relative to this skill's directory)
27
28The examples below use `scripts/search_sessions.py`; prefix it with the skill directory's absolute path when running from elsewhere.
29
30All filters are optional and combine with AND logic.
31
32### Quick Examples
33
34```sh
35# Sessions from the last 10 minutes
36python3 scripts/search_sessions.py --since 10m
37
38# Sessions between two dates with "chatgpt" in the prompt
39python3 scripts/search_sessions.py --since 2026-06-01 --until 2026-06-21 --prompt chatgpt
40
41# Find a session by its starting prompt (quoted substring match)
42python3 scripts/search_sessions.py --since 1d --prompt "find some code that should be improved" --full-prompt
43
44# Non-interactive sessions that failed
45python3 scripts/search_sessions.py --no-interactive --status failed
46
47# VS Code extension sessions using Claude models, full prompts
48python3 scripts/search_sessions.py --source vscode --model "claude" --full-prompt
49
50# Full transcript of a specific session
51python3 scripts/search_sessions.py --session-id 1781991507587_pozk0 --transcript
52
53# Export matching sessions to a directory
54python3 scripts/search_sessions.py --since 1d --export ~/tmp/exported-sessions
55```
56
57### Time Filters
58
59Both `--since` and `--until` accept:
60
61- **Relative**: `10m`, `30min`, `2h`, `1d`, `1w` (minutes, hours, days, weeks)
62- **ISO 8601**: `2026-06-20`, `2026-06-20T21:30:00Z`, `2026-06-20T21:30:00+00:00`
63
64### All Available Filters
65
66| Filter | Description |
67|--------|-------------|
68| `--since <time>` | Sessions started after this time |
69| `--until <time>` | Sessions started before this time |
70| `--prompt <text>` | Case-insensitive substring search in prompt |
71| `--prompt-regex <pattern>` | Regex search in prompt (case-insensitive) |
72| `--status <status>` | `running`, `idle`, `completed`, `cancelled`, `failed` |
73| `--source <source>` | `cli`, `vscode`, etc. (exact match) |
74| `--provider <name>` | Provider name, exact match (e.g. `cline`) |
75| `--model <text>` | Model name substring, case-insensitive (e.g. `claude`) |
76| `--mode <mode>` | `plan` or `act` |
77| `--cwd <path>` | Working directory substring match |
78| `--session-id <id>` | Exact session ID lookup |
79| `--interactive` / `--no-interactive` | Filter by interactive flag |
80| `--team-only` / `--no-team` | Filter by team session flag |
81| `--subagents` / `--no-subagents` | Include/exclude subagent sessions |
82
83### Output Options
84
85| Option | Description |
86|--------|-------------|
87| `--full-prompt` | Show full prompt text instead of truncated |
88| `--transcript` | Print full conversation transcript |
89| `--max-messages <n>` | Limit messages in transcript output |
90| `--content-types <types>` | Comma-separated: `text,thinking,tool_use,tool_result,image` |
91| `--export <dir>` | Copy matching session files to a directory |
92| `--limit <n>` | Max number of sessions to return |
93| `--json` | Output as JSON |
94
95### Data Source Options
96
97| Option | Description |
98|--------|-------------|
99| `--sessions-dir <path>` | Custom sessions directory (default: `~/.cline/data/sessions`) |
100| `--db-path <path>` | Custom sessions.db path |
101| `--no-db` | Skip SQLite DB, only scan JSON files |
102
103## Workflow
104
1051. Start by running the search with the user's criteria to get a list of matching sessions.
1062. If the user wants to see details, use `--full-prompt` or `--transcript`.
1073. For transcript inspection, consider `--max-messages` and `--content-types` to focus on relevant parts.
1084. For bulk export, use `--export <dir>` to copy session files.
109
110## Session Data Structure
111
112Each session on disk has:
113- `<session_id>.json` — Metadata: session_id, started_at, status, source, provider, model, cwd, prompt, metadata (mode, systemPrompt, cost, usage), etc.
114- `<session_id>.messages.json` — Full conversation transcript with messages containing content blocks (text, thinking, tool_use, tool_result, image).
115
116The SQLite `sessions.db` may contain older sessions with similar fields plus `transcript_path`, `hook_path`, `parent_session_id`, `agent_id`, `is_subagent`.