docs/how-to-use-flow-ai-to-manage-claude-code-sessions.md
Flow treats Claude and Codex as first-class coding runtimes in the same project loop: tasks, sessions, skills, and commit gates all live together.
# 1) Enter repo and inspect runnable workflows
cd <repo>
f tasks list
# 2) Resume exact prior AI context
f ai claude resume <session-id>
# or
f ai codex resume <session-id>
# 3) Keep skills synced to current tasks
f skills sync
f skills reload
# 4) Run the smallest meaningful validation
f test-related
# 5) Commit through flow's review/testing gates
f commit
This is the fastest way to keep context stable and avoid drift across sessions.
# Fuzzy-select and resume (all providers)
f ai
# Provider-specific listing
f ai claude list
f ai codex list
# Resume by exact ID / prefix / alias
f ai claude resume a38cf8bf-f4e2-4308-8b27-0254f89c4385
f ai codex resume 019c61c5-0aef-71a1-b058-5c9ab43013d4
f ai resume my-feature
# Search Codex sessions globally by prompt text and resume the best match
f ai codex find "make plan to get designer"
# Search Codex sessions globally by prompt text and copy the best match
f ai codex findAndCopy "make plan to get designer"
# Save alias
f ai save my-feature --id <session-id>
# Copy context/history for handoff
f ai context
f ai copy
When you pass an explicit session (name or id), Flow will not auto-open a different conversation if that ID fails.
claude --resume <id>--continue fallback for explicit IDsThis prevents restoring into the wrong session.
f ai claude resume (no argument) resumes the most recent Claude session for this repo. If that fails, Flow can fallback to claude --continue in the same cwd.
Flow resumes Codex by session ID and returns failure if resume fails. No fallback to another session is applied.
Both Claude and Codex resume commands require an interactive terminal (TTY). In non-interactive shells, Flow fails fast with a clear error.
AI sessions are most reliable when code execution goes through flow.toml tasks.
If a task prompts for input (like Y/n/a/q workflows), mark it:
[[tasks]]
name = "reclaim"
command = "./mole reclaim"
interactive = true
This keeps TTY passthrough correct for both humans and AI-assisted loops.
commands/ai.md for command-level semantics and examplescommands/skills.md for skill sync/reload loopcommands/commit.md for commit quality/testing gatesuse-flow-to-write-software-better.md for the full operating model