Codex Dual-Session Story Flow

    1

    Two separate Codex sessions per story: one implements in an isolated worktree, one reviews read-only. A verifier exit code, not agent prose, decides when it is done.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+22 more

    Codex Dual-Session Story Flow

    Example session with this skill installed

    Run story CAN-002 with the dual-agent Codex flow.

    • Read your context and instructions
    • Compiled the codex dual-session story

    Summary

    CAN-002 is implemented, verified and independently reviewed in its own worktree. Verdict: PASS. The flow stopped before push; the branch is ready for your review.

    Illustrative example of the stages and artifacts the bundled scripts produce. It is not a recorded run.

    StageWhat runsOutput
    Worktreenew-story.sh CAN-002.agent-worktrees/CAN-002 on branch codex/CAN-002, from the fetched base. Your current branch is untouched.
    Buildcodex exec -s workspace-writeImplementer commits specs/CAN-002.md, line_count() and its tests on the story branch
    Verifyscripts/verify.shscripts/verify-project.sh exits 0
    Reviewseparate codex exec -s read-only.codex-flow/CAN-002/CAN-002-review.md starts with VERDICT: PASS
    Fix passskippedonly runs on VERDICT: CHANGES_REQUESTED, at most once, followed by verify and one re-review

    Review finding format (when changes are requested): P0, P1 or P2 severity, file and line, a reachable failure scenario, and the smallest safe correction. Style-only or speculative findings are excluded.

    Traces: every Codex run writes JSONL under .codex-flow/CAN-002/.

    Next steps

    • Read the diff of codex/CAN-002 against the base
    • Push, open the PR and merge yourself
    • After the merge, clean up with Merged Worktree Cleanup

    Connects securely to your tools. The creator never sees your data.

    About this skill

    What it does

    The problem. A single Codex session that writes and reviews its own code agrees with itself. Long review loops burn tokens without converging, and an agent with push rights can ship before you look.

    What the skill does. It starts a fresh implementer session with a workspace-write sandbox inside a dedicated worktree, requires it to commit spec, code and tests, runs your verifier, then starts a separate reviewer with a read-only sandbox. Findings must name severity, file and line, a failure scenario and a minimal fix. At most one fix pass and one re-review follow.

    Why not just prompt for it. The isolation is real: separate processes, separate sandboxes, a separate worktree, and an exit code as the gate.

    Use it when you work Codex-only and want an independent review on a story with checkable acceptance criteria.

    Known limits.

    • Codex quota is consumed by two sessions per story, more when a fix pass runs.
    • If the review stage fails (for example on Codex quota), resume with story.sh <ID> --from review; it skips only the build and reruns verification first.
    • Non-mechanical judgments must be recorded as human gates.

    Where it fits

    1. Project Setup, once per repository: plan, backlog, verifier
    2. Story Flow or Codex Dual-Session Story Flow (this skill), once per story: build, verify, independent review
    3. You: read the diff, push, open the PR, merge
    4. Merged Worktree Cleanup, after the merge: remove the worktree and branch

    Project Setup is optional but recommended: without it the story flows fall back to auto-detected checks, with no backlog or project-owned verifier.

    How to use

    1. Unzip into ~/.codex/skills/.
    2. Add scripts/verify-project.sh with your real checks.
    3. Write specs/<ID>.md from the bundled template, then ask Codex to run the story. The ID must match PREFIX-nnn.
    4. Review the diff, push, open the PR and merge yourself.

    Requirements

    git, codex, tee, and your project's toolchain. macOS, Linux, or Windows through WSL.

    Works best with: Project Setup (verifier and backlog) and Merged Worktree Cleanup (after the merge). Want Claude Code as the implementer instead? Use Story Flow.

    How to use

    Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free forever

    No account required to browse

    Trust & safety

    Security scanned

    Verified clean 4 days ago

    • Free to download with an account

    Requires

    Git
    Codex CLI

    Listed4 days ago

    What's inside

    Frequently Asked Questions