docs/session-history-mining.md
Use this when you want an AI agent to study recent Claude/Codex/Cursor work before proposing a plan.
This is optimized for:
Use Flow's cross-project session browser:
f sessions
f sessions scans Claude + Codex + Cursor sessions across projects, lets you pick one, and copies context to clipboard.
# List sessions across all projects without interactive selection
f sessions --list
# Only Claude sessions
f sessions --provider claude --list
# Only Codex sessions
f sessions --provider codex --list
# Only Cursor sessions
f sessions --provider cursor --list
# Copy selected session context (interactive picker via fzf)
f sessions --provider all
# Copy only the last N exchanges
f sessions --provider all --count 8
# Ignore checkpoints and copy full session
f sessions --provider all --full
# Produce a condensed handoff summary (requires Gemini key)
f sessions --provider all --handoff
Default f sessions copies context since last consumption checkpoint for the current repo.
That means repeated runs do not keep re-copying old context.
Checkpoint file:
.ai/internal/consumed-checkpoints.json
Use --full when you explicitly want full history instead of incremental context.
If you need more detail from a known session in the current repo:
f ai claude list
f ai codex list
f ai cursor list
# Copy the last 6 exchanges from a selected Claude session for this repo
f ai claude context - /absolute/path/to/repo 6
f ai cursor context - /absolute/path/to/repo 6
Use this after f sessions when you want to zoom in on one thread.
f sessions --provider all --listf sessions --provider claude --count 6
f sessions --provider codex --count 6
f sessions --provider cursor --count 6f sessions --provider all --handoffUse this format when asking an agent to mine history and propose execution:
I have ~$500 of Claude tokens expiring in <N> day(s) and want to use them efficiently.
Goal:
- study goose and propose a concrete execution plan for token usage
- use ideas from recent Claude/Codex/Cursor histories
- rank ideas by expected impact and execution cost
Constraints:
- avoid low-signal exploration
- maximize useful output per token
- include exact next commands I should run
Session context 1:
<paste from f sessions --provider claude --count 6>
Session context 2:
<paste from f sessions --provider codex --count 6>
Session context 3 (optional handoff):
<paste from f sessions --provider all --handoff>
Session context 4 (optional Cursor):
<paste from f sessions --provider cursor --count 6>
Deliver:
1. top opportunities (ranked)
2. 48-hour execution plan
3. fallback plan if one assumption fails
4. specific commands and owners
--count over --full unless you are reconstructing full intent.--handoff for large stale sessions before pasting into expensive models.fzf not found: install fzf, or use --list and then run interactive once fzf is available.--full.--handoff not working: set GEMINI_API_KEY or GOOGLE_API_KEY.