Skip to content

Commit bfdd5b1

Browse files
committed
Add Cursor session support and trim transcript noise
1 parent e44a474 commit bfdd5b1

6 files changed

Lines changed: 1249 additions & 222 deletions

File tree

docs/commands/ai.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
# f ai
22

3-
Manage Claude Code and Codex sessions for the current project.
3+
Manage Claude Code, Codex, and Cursor sessions for the current project.
44

55
Flow reads local session stores, filters by current project path, and gives you one interface for list/search/resume/copy/save.
66
When you need to reopen a repo's session from another working directory, use `--path <project-root>` on `resume` or provider-specific `continue`.
7+
Cursor transcripts are supported for reading only.
78

89
## Quick Start
910

1011
```bash
11-
# Fuzzy-pick a recent session (Claude + Codex) and resume
12+
# Fuzzy-pick a recent session (Claude + Codex + Cursor)
1213
f ai
1314

14-
# Provider-specific list/resume
15+
# Provider-specific list/read
1516
f ai claude list
1617
f ai codex list
18+
f ai cursor list
1719
f ai claude resume <session-id-or-name>
1820
f ai codex resume <session-id-or-name>
1921
f ai codex resume --path ~/work/example-project
2022
f ai codex continue --path ~/work/example-project
23+
f ai cursor context - /path/to/repo 3
24+
f cursor copy
2125

2226
# Save a memorable alias for a session
2327
f ai save reclaim-fix --id a38cf8bf-f4e2-4308-8b27-0254f89c4385
@@ -27,6 +31,7 @@ f ai save reclaim-fix --id a38cf8bf-f4e2-4308-8b27-0254f89c4385
2731

2832
- Claude: `~/.claude/projects/<project-path>/*.jsonl`
2933
- Codex: `~/.codex/sessions/**/*.jsonl` (Flow matches by `session_meta.cwd`)
34+
- Cursor: `~/.cursor/projects/<project-key>/agent-transcripts/<session-id>/<session-id>.jsonl`
3035
- Saved aliases: `.ai/sessions/claude/index.json` in your repo
3136

3237
## Resume Behavior (Important)
@@ -38,6 +43,7 @@ Resume is interactive by design.
3843
- `f ai claude resume ...` requires a terminal TTY.
3944
- `f ai codex resume ...` requires a terminal TTY.
4045
- In non-interactive shells, Flow exits with a clear error and non-zero status.
46+
- Cursor does not currently expose a Flow resume/continue path; use `list`, `copy`, or `context`.
4147

4248
### Claude exact-ID behavior
4349

@@ -64,6 +70,15 @@ codex resume <id> --dangerously-bypass-approvals-and-sandbox
6470

6571
No fallback is applied on resume failure; Flow returns non-zero.
6672

73+
### Cursor behavior
74+
75+
Cursor transcripts are read-only in Flow:
76+
77+
- `f ai cursor list` opens a picker and copies the selected transcript
78+
- `f ai cursor copy` copies the latest Cursor transcript for this repo
79+
- `f ai cursor context ...` copies the last N exchanges
80+
- `f cursor ...` is a shortcut for the same provider-specific read commands
81+
6782
### Cross-directory resume
6883

6984
You can target another repo without changing directory:
@@ -94,6 +109,7 @@ f ai resume my-feature
94109
f ai resume a38cf8bf
95110
f ai claude resume 2
96111
f ai codex resume 019c61c5-0aef-71a1-b058-5c9ab43013d4
112+
f ai cursor context 382ef1a3 /path/to/repo 2
97113
```
98114

99115
## Content Copy Commands
@@ -112,6 +128,7 @@ Use `-` as session placeholder to trigger fuzzy selection:
112128

113129
```bash
114130
f ai claude context - /path/to/repo 3
131+
f ai cursor context - /path/to/repo 3
115132
```
116133

117134
## Project Workflow (Recommended)

docs/session-history-mining.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Session History Mining for Claude/Codex
1+
# Session History Mining for Claude/Codex/Cursor
22

3-
Use this when you want an AI agent to study recent Claude/Codex work before proposing a plan.
3+
Use this when you want an AI agent to study recent Claude/Codex/Cursor work before proposing a plan.
44

55
This is optimized for:
66
- cross-project history review
@@ -15,7 +15,7 @@ Use Flow's cross-project session browser:
1515
f sessions
1616
```
1717

18-
`f sessions` scans Claude + Codex sessions across projects, lets you pick one, and copies context to clipboard.
18+
`f sessions` scans Claude + Codex + Cursor sessions across projects, lets you pick one, and copies context to clipboard.
1919

2020
## Core Commands
2121

@@ -29,6 +29,9 @@ f sessions --provider claude --list
2929
# Only Codex sessions
3030
f sessions --provider codex --list
3131

32+
# Only Cursor sessions
33+
f sessions --provider cursor --list
34+
3235
# Copy selected session context (interactive picker via fzf)
3336
f sessions --provider all
3437

@@ -63,9 +66,11 @@ If you need more detail from a known session in the current repo:
6366
```bash
6467
f ai claude list
6568
f ai codex list
69+
f ai cursor list
6670

6771
# Copy the last 6 exchanges from a selected Claude session for this repo
6872
f ai claude context - /absolute/path/to/repo 6
73+
f ai cursor context - /absolute/path/to/repo 6
6974
```
7075

7176
Use this after `f sessions` when you want to zoom in on one thread.
@@ -77,6 +82,7 @@ Use this after `f sessions` when you want to zoom in on one thread.
7782
2. Pull 2 to 4 high-signal contexts:
7883
`f sessions --provider claude --count 6`
7984
`f sessions --provider codex --count 6`
85+
`f sessions --provider cursor --count 6`
8086
3. For stale/long sessions, prefer condensed transfer:
8187
`f sessions --provider all --handoff`
8288
4. Paste each copied output into labeled blocks in your prompt.
@@ -91,7 +97,7 @@ I have ~$500 of Claude tokens expiring in <N> day(s) and want to use them effici
9197
9298
Goal:
9399
- study goose and propose a concrete execution plan for token usage
94-
- use ideas from recent Claude/Codex histories
100+
- use ideas from recent Claude/Codex/Cursor histories
95101
- rank ideas by expected impact and execution cost
96102
97103
Constraints:
@@ -108,6 +114,9 @@ Session context 2:
108114
Session context 3 (optional handoff):
109115
<paste from f sessions --provider all --handoff>
110116
117+
Session context 4 (optional Cursor):
118+
<paste from f sessions --provider cursor --count 6>
119+
111120
Deliver:
112121
1. top opportunities (ranked)
113122
2. 48-hour execution plan
@@ -119,6 +128,7 @@ Deliver:
119128

120129
- Prefer `--count` over `--full` unless you are reconstructing full intent.
121130
- Prefer `--handoff` for large stale sessions before pasting into expensive models.
131+
- Cursor transcripts use file-modified time rather than per-message timestamps, so repeated copies may include the whole latest transcript after a new edit.
122132
- Merge duplicate context manually before sending to avoid repeated tokens.
123133
- Request ranked outputs with hard deliverables (plan, commands, owners, fallback).
124134

0 commit comments

Comments
 (0)