# Codex Monitor

> Monitor active Codex CLI sessions - shows status, working directory, and last messages

- Skill: `diegosouzapw/codex-monitor` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add diegosouzapw/codex-monitor`
- Raw SKILL.md: https://api.skillmd.com/api/skills/diegosouzapw/codex-monitor/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: diegosouzapw (https://skillmd.com/u/diegosouzapw)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/diegosouzapw/codex-monitor

---


# Codex Session Monitor

When the user invokes this skill (e.g., "/sessions"), run the session monitoring script and report the results.

## What This Skill Does

Monitors all active Codex CLI sessions by parsing the JSONL rollout files in `~/.codex/sessions/`. Shows:

- Thread ID and working directory for each session
- Session status: WORKING, WAITING, or IDLE
- File size (indicates session length/activity)
- Last modification time
- Last 2-3 lines of the most recent user message
- Last 2-3 lines of the most recent Codex response

## How to Run

Execute the Python script:

```bash
python3 {{skill_dir}}/scripts/sessions.py
```

Report the full output to the user in a code block.

## Interpreting Results

- **WORKING**: Session has recent reasoning or function_call events - actively processing
- **WAITING**: Session has an input_wait event - blocked waiting for user input
- **IDLE**: No recent activity indicators - may be finished or stalled

Sessions are considered "active" if modified within the last 5 minutes.

