[PR #192·193·195] Developing with Codex on Windows: One Run Script, Updated Guides, and Merge Rules That Disagreed
In the previous post I started running the directing role from my Windows computer. After trying that, I approved a decision memo and an implementation plan for a “Codex and Windows development workflow”. This post covers that plan’s work (PR 192 and 193) and the follow-up that made two disagreeing merge-rule lines agree (PR 195). It is about how the work is done and about documents rather than new features, so it is kept short.
- What was done:
- PR 192, a Codex run script: In the previous operation, every Codex run (OpenAI’s coding agent) needed long options and a copy of the repository prepared by hand, and checking with
git statusthat Codex had not written outside the copy was also done by hand. Anything done by hand gets skipped when forgotten. Claude wrapped it into one script (scripts/codex-run.mjs): prepare the copy → run Codex → automatically check that nothing was written outside.- The copy is made in a separate folder under the home folder, with the GitHub address (origin) removed so there is nowhere to push. Installing dependencies (
npm ci) happens outside, where the network is available. - The Codex options are fixed to the values settled in the earlier trial run: model
gpt-5.6-luna, writing only inside the copy, network off. Only the reasoning level is chosen fromlow,mediumandhigh, withmediumas the default. - Before and after the run, the script compares
git statusof the main repository and of the current work folder, the main repository’s.gitsettings (config) and hooks (hooks, scripts that run automatically at set moments), and the folder that holds the copies. If anything differs, it stops with exit code 3.
- The copy is made in a separate folder under the home folder, with the GitHub address (origin) removed so there is nowhere to push. Installing dependencies (
- PR 193, updating the guides: The working-rules document (
CLAUDE.md) and the status documents still pointed to the rules of the earlier operation, which had already ended. Claude updated them so the next directing session would not follow the old rules. The old exception sentence was deleted, and the role-split sentence was replaced with a one-line summary of the decision memo and a link. The handover file got the Codex run results and a “How to use Codex” section, and the decision log got new lines. - PR 195, the merge rules:
CLAUDE.mdstated the merge rule in two places, and they differed. The newer line said “judge by the local check results written in the PR description, and run the end-to-end screen tests (npm run e2e) only when the admin web changes”. The older temporary line said “run both the full check and the end-to-end screen tests before every merge”. I had merged the previous PR by the newer rule. Claude changed the older line’s merge sentence to follow the newer line.- At my request, the same PR also changed the verification hook. The hook runs the full check when Claude ends a reply, but it said nothing when the check passed, so I could not tell when it had finished. It now shows “verification passed (N min N s)” once.
- PR 192, a Codex run script: In the previous operation, every Codex run (OpenAI’s coding agent) needed long options and a copy of the repository prepared by hand, and checking with
- Methods chosen and alternatives dropped:
- No Codex settings bundle (profile) was made. The plan had one, but the script carries the options, so my personal Codex settings do not need to change. The handover file and the decision log say so too.
- Three of Codex’s review findings were fixed: a failed setup left a half-made copy that the next run would use (it is now deleted); an existing copy was not switched to the requested branch (it now switches and fetches new commits); and changes to the main repository’s
.gitsettings and hooks were not caught (they now are). - Some findings were not accepted: a run failure when Codex is
codex.cmd(on this computer it is.exeand actually ran), a dependency install script writing outside (the job of that package), rewriting a file with exactly the same size and modification time (too rare), and loose argument parsing (only the directing session calls it). - The handover file’s old status lines were marked “record of the earlier operation” instead of deleted. The server-side director will need that record when it takes over from this file later. The old lines in the decision log were also left as they are, following that file’s rule, and new lines were added.
- For the disagreeing merge rule, the older line was changed. Deleting the older line entirely was dropped because its other guidance is still needed, and changing the newer line was dropped because the newer line is my most recent decision.
How It Was Checked
- Script tests:
node --test scripts/codex-run.test.mjspassed 18 tests, including folder names with Korean characters and spaces. - Four runs with real Codex: Claude actually ran Codex.
- A normal run ended with exit code 0 and took 173 seconds, including making the copy and installing dependencies.
- Asked to create a file in the folder just above the copy, Codex was blocked by the sandbox (a restricted execution environment) and no file appeared. The “can write outside the copy” seen in the previous operation did not occur with this run’s options, which turn the network off and set the work folder to the copy.
- So a file was created in the copies folder from outside while Codex was running, and the script showed exit code 3 and that path.
- Running again with the existing copy fetched the new commits and ended with exit code 0.
- Guides: The terms check passed, and searching
CLAUDE.mdfor the dates and counts of the earlier operation finds nothing. - Two checks overlapping: In PR 193 Claude started the full check by hand, and when the reply ended the verification hook ran the full check as well, so the two overlapped. 13 admin web screen tests and 7 customer app screen tests failed; rerunning only the failed files passed them all. The PR only changed documents, so these were treated as flaky tests (tests that pass and fail on the same code).
- Hook change: The 34 existing hook tests passed, and running the hook directly in a temporary repository showed “verification passed (0 min 0 s)” once. No hook test had checked the success output before. The full check first failed because dependencies were not installed in this work folder, and passed after installing them (admin web 310, customer app 383, server 591).
The Three PRs at a Glance
| PR | What was done | Key point |
|---|---|---|
| 192 | Codex run script | Prepare the copy → run → check automatically for writes outside |
| 193 | Guides updated to the new workflow | Finished rules removed, old records only marked |
| 195 | Merge rules aligned, hook pass message | The older line now follows the latest decision |
Who Did What
- I: approved the decision memo and the implementation plan, merged by the newer rule, and requested the new decision-log line and the hook’s pass message.
- Claude (Claude Code on my Windows computer): For PR 192 and 193, Claude Opus 5.5 wrote the script and the documents and checked them with real Codex. For PR 195, Claude Sonnet 5.5 fixed the wording and the hook.
- Codex (gpt-5.6-luna): ran the trial runs (low reasoning) and a read-only review (high reasoning) in PR 192.
Lessons
- Checks done by hand get skipped when forgotten. With preparing, running and checking in one script, a write outside the copy stops the run without anyone having to remember.
- Do not run by hand a check the hook already runs. When two checks overlap, tests that hit time limits look like failures. Leave it to the hook, or do not end the reply while a manual run is going.
- When setting a new rule, also look for old lines on the same topic. If two lines differ, no one can tell which to follow.