docs/commands/ai.md
Manage Claude Code, Codex, and Cursor sessions for the current project.
Flow reads local session stores, filters by current project path, and gives you one interface for list/search/resume/copy/save.
When you need to reopen a repo's session from another working directory, use --path <project-root> on resume or provider-specific continue.
Cursor transcripts are supported for reading only.
# Fuzzy-pick a recent session (Claude + Codex + Cursor)
f ai
# Provider-specific list/read
f ai claude list
f ai codex list
f ai codex sessions
f ai codex sessions --path ~/repos/mark3labs/kit
f ai cursor list
f codex resolve "latest"
f codex resolve "https://linear.app/.../project/.../overview" --json
f codex open "continue the deploy work"
f ai claude resume <session-id-or-name>
f ai codex resume <session-id-or-name>
f ai codex resume --path ~/work/example-project
f ai codex continue --path ~/work/example-project
f ai cursor context - /path/to/repo 3
f cursor copy
# Save a memorable alias for a session
f ai save reclaim-fix --id a38cf8bf-f4e2-4308-8b27-0254f89c4385
~/.claude/projects/<project-path>/*.jsonl~/.codex/sessions/**/*.jsonl (Flow matches by session_meta.cwd)~/.cursor/projects/<project-key>/agent-transcripts/<session-id>/<session-id>.jsonl.ai/sessions/claude/index.json in your repoResume is interactive by design.
f ai claude resume ... requires a terminal TTY.f ai codex resume ... requires a terminal TTY.list, copy, or context.If you pass an explicit session (name, id, or id-prefix), Flow is strict:
claude --resume <id>--continue for explicit sessions (prevents opening the wrong conversation)For f ai claude resume with no argument:
claude --continue in the same cwd (TTY only)For Codex, Flow runs:
codex resume <id> --dangerously-bypass-approvals-and-sandbox
No fallback is applied on resume failure; Flow returns non-zero.
Use open when you want one Codex entrypoint that stays conservative about context:
f codex open
f codex open "continue the deploy work"
f codex open "resume latest"
f codex open --path ~/work/example-project "what was I doing here"
f codex resolve "https://linear.app/fl2024008/project/llm-proxy-v1-6cd0a041bd76/overview" --json
f codex doctor --path ~/work/example-project
Behavior:
latest, resume session, ordinals, or session IDs: resume the matching Codex sessionwhat was I doing or continue the ... work: build a compact recovery handoff and start a new sessionThis keeps prompt cost flat unless Flow has a strong reason to recover or unroll context.
Use f codex doctor to confirm whether wrapper transport, runtime skills, and context budgets are actually active for the current repo.
If your Mac restarts and you lose the live Codex terminals, use:
f ai codex sessions
f ai codex sessions --path ~/repos/mark3labs/kit
Behavior:
continue, so you can reopen quicklyExamples:
f ai codex continue 1 --path ~/repos/mark3labs/kit
f ai codex continue 019cd046 --path ~/repos/mark3labs/kit
f ai codex sessions --path ~/repos/mark3labs/kit --json
flow.toml resolver configYou can teach f codex open and f codex resolve to unroll repo-specific references:
[codex]
auto_resolve_references = true
prompt_context_budget_chars = 900
max_resolved_references = 1
[[codex.reference_resolver]]
name = "linear"
match = ["https://linear.app/*/issue/*", "https://linear.app/*/project/*"]
command = "my-linear-tool inspect {{ref}} --json"
inject_as = "linear"
Notes:
flow.toml or global ~/.config/flow/flow.toml{{ref}}, {{query}}, and {{cwd}} are available in resolver commandsprompt_context_budget_chars hard-caps injected context before your request is appendedmax_resolved_references prevents broad unrolling from bloating one turnFlow can also materialize tiny per-launch runtime skills for current upstream Codex without forking Codex.
Enable it globally with:
f codex enable-global --full
f codex doctor --path ~/docs --assert-runtime --assert-schedule
Or configure it manually with:
[codex]
runtime_skills = true
[options]
codex_bin = "~/code/flow/scripts/codex-flow-wrapper"
Current first-slice behavior:
f codex open "write plan" can attach a tiny plan-writing runtime skill~/.config/flow/codex/runtimeInspect or clear runtime state:
f codex runtime show
f codex runtime clear
f codex memory status
f codex memory query --path ~/code/flow "codex control plane runtime skills"
f codex memory recent --path ~/docs
f codex doctor
Assertive health checks:
f codex doctor --path ~/docs --assert-runtime
f codex doctor --path ~/docs --assert-schedule
f codex doctor --path ~/docs --assert-learning
f codex doctor --path ~/docs --assert-autonomous
--assert-learning is intentionally strict: it fails until Flow has real
logged events, grounded outcome samples, and a non-empty scorecard for that
target.
Built-in plan writer:
cat <<'EOF' | f codex runtime write-plan --title "Example Plan"
# Example Plan
- item
EOF
Flow can learn which runtime skills are actually worth injecting from local Codex usage history without replaying Codex in the hot path.
Useful commands:
f codex eval --path ~/work/example-project
f codex memory sync --limit 400
f codex memory recent --path ~/work/example-project --limit 12
f codex skill-eval show --path ~/work/example-project
f codex skill-eval run --path ~/work/example-project
f codex skill-eval cron --limit 400 --max-targets 12 --within-hours 168
f codex telemetry status
f codex telemetry flush --limit 200
f codex trace status
f codex trace current-session --json
f codex trace inspect <trace-id> --json
f codex skill-source list --path ~/work/example-project
f codex skill-source sync --path ~/work/example-project --skill find-skills
The Codex memory mirror:
~/.jazz2/... or ~/repos/garden-co/jazz2/.jazz2/...)see ~/code/flow ... can inject likely files such as src/ai.rs or docs/... without dumping raw sourcememory query / codex resolvesrc/... paths; summary/docs prompts prefer doc headings and docs pathsf codex skill-eval cron, so the mirror heals even if a hot-path write is skippedf codex open / f codex resolveWhat cron does:
For your use case, this keeps learning cheap and safe enough to run regularly.
Flow now assigns a trace envelope to all Flow-managed Codex launches, not just
special workflows like check <github-pr-url>.
That means sessions started or resumed through:
j ...
k <session-id>
f codex open ...
f codex resume ...
f codex continue ...
carry FLOW_TRACE_* env vars and emit at least one compact Flow telemetry
event, so the session becomes remotely inspectable.
Useful commands:
f codex trace status
f codex trace current-session --json
f codex trace inspect <trace-id> --json
Behavior:
trace status checks whether Maple MCP reads are configured and reachabletrace current-session reads the active FLOW_TRACE_ID from the current
Flow-managed Codex session, flushes recent Flow telemetry once, then attempts
a remote trace readreadError instead of failing
without contextThis keeps the workflow autonomous from inside Codex itself: once the session was started through Flow, you can inspect the current trace without manually copying ids.
f codex eval --path ... is the joined operator report:
If codexd is running, it also keeps recent completion reconciliation warm and
now does a bounded background scorecard refresh, so the eval report does not go
stale as quickly between manual runs.
Optional telemetry export follows the same local-first pattern: Flow keeps
local Codex logs canonical, and if FLOW_CODEX_MAPLE_* env vars are set it can
export redacted route/context/outcome spans to Maple without shipping raw
prompts or full repo paths. Use:
f codex telemetry status
f codex telemetry flush --limit 200
For local-only secrets, prefer f env set --personal .... On macOS you may
need f env unlock once per day for background reads. Flow-launched Codex
sessions also inherit the same FLOW_CODEX_MAPLE_* values from the personal
store, while explicit shell env still wins for one-off tests.
When codexd is running, the daemon also performs a bounded background export
pass so the external analytics view stays warm.
If you want scorecards to stay fresh automatically on macOS:
f codex-skill-eval-launchd-install
f codex-skill-eval-launchd-status
f codex-skill-eval-launchd-logs
f codex enable-global --full installs this schedule for you.
Default schedule:
You can tune install-time bounds:
f codex-skill-eval-launchd-install --minutes 20 --limit 600 --max-targets 16 --within-hours 72
f codex-skill-eval-launchd-install --dry-run
Remove it with:
f codex-skill-eval-launchd-uninstall
Cursor transcripts are read-only in Flow:
f ai cursor list opens a picker and copies the selected transcriptf ai cursor copy copies the latest Cursor transcript for this repof ai cursor context ... copies the last N exchangesf cursor ... is a shortcut for the same provider-specific read commandsYou can target another repo without changing directory:
f ai codex resume --path ~/work/example-project
f ai codex resume --path ~/work/example-project 019c61c5-0aef-71a1-b058-5c9ab43013d4
f ai codex continue --path ~/work/example-project
resume --path <repo> resolves the requested session against that repo instead of the current cwdcontinue --path <repo> resumes the latest session for that reporesume accepts:
.ai/sessions/claude/index.jsonExamples:
f ai resume my-feature
f ai resume a38cf8bf
f ai claude resume 2
f ai codex resume 019c61c5-0aef-71a1-b058-5c9ab43013d4
f ai cursor context 382ef1a3 /path/to/repo 2
# Copy full conversation to clipboard
f ai copy
f ai copy <session>
# Copy last N prompt/response turns
f ai context
f ai context <session> <path> <count>
Use - as session placeholder to trigger fuzzy selection:
f ai claude context - /path/to/repo 3
f ai cursor context - /path/to/repo 3
f tasks listf ai claude resume <id> or f ai codex resume <id>f skills sync then f skills reloadf test-related / f testf commitThis keeps sessions, tasks, skills, and commit quality checks in one loop.
Flow also supports running a prompt through Everruns while routing client-side
seq_* tool calls to local seqd:
f ai everruns "open Safari and take a screenshot"
Key points:
f ai claude ... or f ai codex ....seq_* tool definitions injected into new sessionsseq_open_app, seq.open_app, seq:open-app)request_id, run_id, tool_call_id)/sse) with automatic fallback to polling (/events) if SSE is unavailable.SEQ_EVERRUNS_MAPLE_* env vars are configured.f seq-rpc, session resume/copy/context flows).Setup and validation details are documented in:
docs/everruns-seq-bridge-integration.mddocs/everruns-maple-runbook.md