Skip to content

Instantly share code, notes, and snippets.

@fcoury
Last active September 3, 2025 18:22
Show Gist options
  • Select an option

  • Save fcoury/3c706ab811a1e5a0aff442c0239ae177 to your computer and use it in GitHub Desktop.

Select an option

Save fcoury/3c706ab811a1e5a0aff442c0239ae177 to your computer and use it in GitHub Desktop.
function codex_continue
# Find the most recently modified JSONL file in ~/.codex/sessions (recursively)
set latest (find ~/.codex/sessions -type f -name '*.jsonl' -print0 2>/dev/null | xargs -0 ls -t 2>/dev/null | head -n 1)
if test -z "$latest"
echo "No session files found in ~/.codex/sessions"
return 1
end
echo "Resuming from: $latest"
codex --config experimental_resume="$latest" $argv
end
# bash/zsh version -- not tested, generated by Claude
codex_continue() {
# Find the most recently modified JSONL file in ~/.codex/sessions (recursively)
local latest=$(find ~/.codex/sessions -type f -name '*.jsonl' -print0 2>/dev/null | xargs -0 ls -t 2>/dev/null | head -n 1)
if [[ -z "$latest" ]]; then
echo "No session files found in ~/.codex/sessions"
return 1
fi
echo "Resuming from: $latest"
codex --config experimental_resume="$latest" "$@"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment