Skip to content
Back to skills

Codex Result Handling

ASecurity

Internal guidance for presenting Codex or OpenCode helper output back to the user

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 29, 2026
ai-agentsgo

Works with

  • cli

Security analysis

A100/100

Scanned October 4, 2026

npx -y skills add Fundryi/claude-codex-handoff --skill codex-result-handling --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Codex Result Handling?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Codex Result Handling
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/fundryi-codex-result-handling/badge)](https://www.skillsdirectory.com/skills/fundryi-codex-result-handling)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: codex-result-handling
description: Internal guidance for presenting Codex or OpenCode helper output back to the user
user-invocable: false
---

# Codex Result Handling

When the helper returns Codex output:
- Preserve the helper's verdict, summary, findings, and next steps structure.
- For review output, present findings first and keep them ordered by severity.
- Use the file paths and line numbers exactly as the helper reports them.
- Preserve evidence boundaries. If Codex marked something as an inference, uncertainty, or follow-up question, keep that distinction.
- Preserve output sections when the prompt asked for them, such as observed facts, inferences, open questions, touched files, or next steps.
- If there are no findings, say that explicitly and keep the residual-risk note brief.
- If Codex made edits, say so explicitly and list the touched files when the helper provides them.
- For `codex:codex-rescue`, do not turn a failed or incomplete Codex run into a Claude-side implementation attempt. Report the failure and stop.
- For `codex:codex-rescue`, if Codex was never successfully invoked, do not generate a substitute answer at all.
- CRITICAL: After presenting review findings, STOP. Do not make any code changes. Do not fix any issues. You MUST explicitly ask the user which issues, if any, they want fixed before touching a single file. Auto-applying fixes from a review is strictly forbidden, even if the fix is obvious.
- If the helper reports malformed output or a failed Codex run, include the most actionable stderr lines and stop there instead of guessing.
- If the helper reports that setup or authentication is required, direct the user to `/codex:setup` and do not improvise alternate auth flows.
- A result ends with `Codex job: <job id> · thread: <thread id>` or `OpenCode job: <job id> · thread: <ses_id>`. It tells the viewer which transcript started the job. Keep the thread id and engine for a follow-up; you need not show the line to the user.

## When Codex asks a question

A task result can end with a "Needs decision" section, and the prompt hook can show it as "Codex asks:". Codex has stopped and waits for the answer on the same thread.

These steps also apply to OpenCode. For an OpenCode result or `ses_` session id, put `--engine opencode --resume-thread <ses_id>` on the first line of every answer handoff. Keep the same engine and session. The [runtime skill](../codex-cli-runtime/SKILL.md) owns the engine flag rules.

1. Answer by yourself only when you are sure beyond reasonable doubt: the answer is plain from this conversation, the repository, or the spec. Then resume the same thread: launch the `codex:codex-rescue` agent (`run_in_background: true`) with `--resume-thread <thread-id>` on the first line and the answer below it, starting with `Answer from Claude (automatic N of 2):`.
2. If you have any doubt, ask the user first with `AskUserQuestion`. Offer the options Codex listed, and put your recommendation first. Then forward the answer the same way, starting with `Answer from the user:`.
3. Always ask the user when the question is about scope, risk, cost, product behaviour, or anything destructive or hard to undo.
4. At most 2 automatic answers per thread. Count the `Answer from Claude (automatic` lines you already sent on it. After 2, ask the user.
5. Each time you answer by yourself, tell the user the question and your answer in one or two lines.

This is a new handoff you choose to make, not recovery. Never resume a dead or stuck job this way; that stays the user's click.

## Inside a Workflow script

When a Workflow script calls the `codex:codex-rescue` agent, the Codex result goes back to the script, not to you. The viewer then treats an open question as the workflow's, not the user's. So the script must handle it:

- Look for a "Needs decision" section that is not "None".
- Answer it on the same thread. The next `agent()` call for that task starts with `--resume-thread <thread-id>` (from the result's last line), then the answer, as in step 1. This also applies to a fix round after a review. A fresh handoff loses Codex's context and leaves the old question open.
- If the script cannot decide (the limits of steps 2 and 3), put the question in the workflow's return value. Then the main thread asks the user.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.