Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Review the last Codex assistant message (plan, analysis, or proposal) with inline annotations in a TUI overlay. Extracts the most recent response from Codex rollout files and opens it in revdiff for review and annotation. Activates on "revdiff-plan", "review plan with revdiff", "annotate plan", "review last response", "annotate codex output".
.claude/skills/umputun-revdiff-plan/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-05 | ✗→✓ | ▲ Improved | 87% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 130% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 40% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 63% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 42% | 0% |
Review the last Codex assistant message with inline annotations using revdiff TUI in a terminal overlay.
Resolve the script directory using repo root first, then fall back to Codex home:
bashSCRIPT_DIR="$(git rev-parse --show-toplevel 2>/dev/null)/plugins/codex/skills/revdiff-plan/scripts" if [ ! -d "$SCRIPT_DIR" ]; then SCRIPT_DIR="${CODEX_HOME:-$HOME/.codex}/skills/revdiff-plan/scripts" fi
Also resolve the launcher script from the revdiff skill:
bashLAUNCHER_DIR="$(git rev-parse --show-toplevel 2>/dev/null)/plugins/codex/skills/revdiff/scripts" if [ ! -d "$LAUNCHER_DIR" ]; then LAUNCHER_DIR="${CODEX_HOME:-$HOME/.codex}/skills/revdiff/scripts" fi
Use $SCRIPT_DIR and $LAUNCHER_DIR in place of script paths throughout this skill.
--only=<tempfile> in a terminal overlayRun the extraction script with --skip-current to avoid picking up this session's own output:
bash$SCRIPT_DIR/extract-last-message.sh --skip-current
The script:
~/.codex/sessions/If the script fails (no sessions, no messages), inform the user and stop. If the user reports that the wrong content was extracted, ask them to provide the rollout file path explicitly: $SCRIPT_DIR/extract-last-message.sh /path/to/rollout.jsonl
Capture the output and write it to a temp file:
bashTMPBASE="${TMPDIR:-/tmp}" PLAN_FILE=$(mktemp "$TMPBASE/revdiff-plan-XXXXXX") mv "$PLAN_FILE" "${PLAN_FILE}.md" PLAN_FILE="${PLAN_FILE}.md" $SCRIPT_DIR/extract-last-message.sh --skip-current > "$PLAN_FILE"
Run the launcher script with --only=<tempfile>:
bash$LAUNCHER_DIR/launch-revdiff.sh --only="$PLAN_FILE"
The launcher sets REVDIFF_EXIT_CODE_ON_ANNOTATIONS; exit 10 means annotations were captured and is not a launcher failure. Treat other nonzero statuses as failures.
IMPORTANT -- long-running command: The launcher blocks until the user finishes reviewing in the TUI overlay. Set the bash timeout parameter to the maximum your harness allows (e.g. 1800000 or higher). Do NOT use run_in_background.
If the bash tool reports a timeout, use the same fallback as the revdiff skill:
bash output_file="$(ls -t "${TMPDIR:-/tmp}"/revdiff-output-* 2>/dev/null | head -1)" if [ -n "$output_file" ] && [ -f "$output_file" ]; then cat "$output_file" fi
If the bash tool reports exit 10, read stdout and process it as annotations; do not call it a failure. If the launcher produces output, the user made annotations. The output format is:
## plan-XXXXXX.md:12 ( )
this section needs more detail about error handling
## plan-XXXXXX.md:25 ( )
explain why we chose this approach over alternativesEach annotation block has:
## filename:line (type) -- which file and lineSplit annotations into two categories:
Explanation requests -- annotation matches either rule (case-insensitive):
??, ???, etc.) -- a language-neutral shortcut for "please explain"explain, remind, describe, what is, what are, how does, how do, clarifyThese are questions the user wants answered, not plan changes.
Plan-change directives -- everything else. These are instructions to modify the plan content.
If explanation requests are found:
a. Write the explanation to a temp markdown file b. Launch revdiff with --only=<explanation-file> via the launcher script c. If user quits without annotations -- explanation accepted, proceed to pending directives or Step 5 d. If user annotates -- refine explanation, loop back to (b)
If no explanation requests -- proceed directly to Step 4.
For plan-change directives:
$PLAN_FILE with the updated contentAfter addressing annotations, re-launch revdiff with the updated plan:
bash$LAUNCHER_DIR/launch-revdiff.sh --only="$PLAN_FILE"
The user can:
When the launcher produces no output, the review is complete.
Clean up the temp file:
bashrm -f "$PLAN_FILE"
Inform the user that the plan review is complete. If the plan was modified during the review, present the final version.
Other measured skills in the registry, with their headline benchmark lift.