I wrote some hook to prevent premature exit where previously some sessions would quit without having all tasks done. However, i found that this is at the risk of possibility of blocking sessions from quitting, if the hook has any corresponding bug. Thus would inquire if there is any convenient way of quickly identifying still-working codex sessions (e.g., listing codex session id instead of process id, and its status - not merely opened, but still working that burns my very limited credits). Thanks.
no built in command for that as far as i know, but the session files give you most of it. codex writes each session to a rollout file under ~/.codex/sessions/YYYY/MM/DD/ and the session id is in the filename. if a file was modified in the last minute or so that session is still doing something. if it hasn’t changed for a while it’s idle or stuck, even if the terminal is still open. sorting that folder by modified time gets you a quick id plus status list
for the hook i’d give it an escape hatch: a max retry count or a timeout, and log the session id every time it blocks an exit. that way a bug in the hook can’t keep a session looping and burning credits, and the log tells you which one it was
Codexometer: track your quota, usage, orchestrate sessions & benchmark models! is perfect for this
“Sessions” tab even shows you a pretty evolving chart for each sessions token consumption.
New sessions automatically get added as a new row and stale sessions are marked.
thanks merefield. i see it pinned at the top. Is this an official product?
Nope, it’s a community project, I’m the author and a trusted regular. It already has a few GitHub stars already. The code is entirely open source and leverages the official codex app api. Of course there is always some risk of a bug, but feel free to report any on that topic and I will look into it!