Usage

Resume the latest session

Resume the most recent session recorded for the current directory, across all agents.

lazyagent latest finds the most recently active session whose working directory is the current directory (or a subdirectory of it), across all supported agents, and resumes it immediately with the originating agent’s CLI, with no table or prompt. It opens the first session shown by lazyagent sessions.

Synopsis

lazyagent latest [--agent NAME] [--dir PATH] [--yolo]
$ lazyagent latest
Opening: claude --resume 3f2a…

The resume command runs with this terminal attached, from the session’s own working directory when it still exists. Agents lazyagent can exec directly: Claude Code, Codex, Amp, pi, OpenCode, Kilo, Cursor, Grok, and Kimi. “Most recent” means latest activity in the transcript (lazyagent does not record a separate creation time).

Pass --yolo to apply the selected agent’s permissive flag. pi has no distinct YOLO mode, so a pi session exits with a clear unavailable-mode error.

Flags

FlagTypeDefaultSummary
--agent NAMEstringallConsider only one agent’s sessions
--dir PATHstringcurrent dirResume the latest session for another directory
--yoloboolfalseResume with the selected agent’s YOLO mode

Exit codes

CodeMeaning
0Session resumed and exited normally
1No session found for the directory, discovery error, or resume error
2Bad invocation (unknown flag or --agent value, --dir not a directory)