sparring
Skill1 starsChanged 6 days agoMITView on GitHub
Let Claude Code and OpenAI Codex debate a technical question about the current project. Codex runs in a read-only sandbox, explores the whole project on its own, and never edits files; both sides' turns go into one Markdown log the user can watch live. Use when the user asks to "spar with Codex", "discuss this with Codex", "get Codex's opinion", "have Codex review or check this", "get a second opinion from Codex", or runs /sparring, in any language. Every round spends the user's ChatGPT/Codex quota, so start only on an explicit request and never decide on your own to consult Codex.
- Reads credentials
- Installs packages
6 other projects use a version of this.
Adopted by
Most recently taken up by
- nyxandro/sparring-skilltheir own version, first seen Nov 5, 2026
- marcogalluccio/company-brain-ostheir own version, first seen Sep 28, 2026
- MbappeWU/murder-boardtheir own version, first seen Sep 25, 2026
- moazessam376-dev/sparringtheir own version, first seen Sep 12, 2026
- gavishap/omnia-vaulttheir own version, first seen Aug 28, 2026
- gyujeongion/claude-code-sparringtheir own version, first seen Jul 1, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- gavishap/omnia-vault★ 53same name
- MbappeWU/murder-board★ 15same name
- marcogalluccio/company-brain-os★ 7same name
- nyxandro/sparring-skill★ 3same name
- gyujeongion/claude-code-sparring★ 0same name
- moazessam376-dev/sparring★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 5 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
The script owns the log: only the script writes the log, so the two sides can never collide.
- Distinctive: line 40
Ask the user only about what is unclear.
- Distinctive: line 54
If anything turns up, show the list to the user and wait for confirmation before continuing.
- Very specific: line 58
Run start. The default is isolated mode (--ignore-user-config):
- Very specific: line 63
Add --use-user-config only when the user explicitly wants Codex to have those tools.
- Very specific: line 67
Read the relevant code yourself first, then use the Write tool to save your message to a scratch file (for example …
- Very specific: line 68
Do not write it with a heredoc (cat > ...
- Distinctive: line 88
Do not accept everything at face value, and do not agree just to end the discussion.
- Very specific: line 103
Use Write to draft a summary (consensus, open disagreements, recommended next steps) and append it with note --title "Summary".
- Distinctive: line 105
If the conclusion calls for code changes, Claude makes them after the user agrees.
- Very specific: line 131
Update the Codex CLI with npm install -g @openai/codex@latest.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Claude × Codex Sparring
One script, scripts/sparring.py, turns "Claude speaks → Codex replies" into one command per round.
Roles:
- Claude leads: decides what to ask, verifies Codex's claims, and decides when to stop.
- Codex is read-only: explores the project inside
--sandbox read-only, answers, and never writes a file. - The script owns the log: only the script writes the log, so the two sides can never collide.
- The thread continues: round 1 starts a thread with
codex exec; later rounds usecodex exec resume <thread_id>, so Codex remembers earlier rounds.
Running the script
<SKILL_DIR> is the folder that contains this SKILL.md (usually ~/.claude/skills/sparring for a user-level install, or <project>/.claude/skills/sparring for a project-level one).
PY=python3 # on Windows usually python or py; if python opens the Microsoft Store stub, use the interpreter's full path
SPAR="<SKILL_DIR>/scripts/sparring.py"
"$PY" "$SPAR" start --log "<log.md>" --project "<project folder>" --topic "<one-line topic>" [--effort high] [--reply-language "<language>"]
"$PY" "$SPAR" ask --log "<log.md>" --message-file "<this-round.md>"
"$PY" "$SPAR" note --log "<log.md>" --message-file "<summary.md>" --title "Summary"
"$PY" "$SPAR" status --log "<log.md>"ask also accepts --dry-run (print the command and the prompt without running anything) and --timeout <seconds>.
Workflow
0. Settle the parameters
Ask the user only about what is unclear; otherwise use these defaults:
| Parameter | Default |
| Topic | A one-line summary of the user's request |
| Project folder | The current working directory |
| Max rounds | No limit: keep going until the discussion converges (Codex replies AGREE and you agree too). Stop earlier only when a point needs the user's call. If the user gives a limit (— rounds: N), stop there |
| Reasoning effort | Unset: inherited from ~/.codex/config.toml (start prints the effective value). With xhigh, one round can take several minutes; --effort high suits most discussions |
| Reply language | The language the user is speaking with you, e.g. --reply-language "Traditional Chinese"; English when unclear |
| Log file | <project>/sparring/YYYY-MM-DD-<kebab-slug>.md. If the project's CLAUDE.md prescribes an output location, follow it; ask the user when unsure |
1. Safety check (first use in a project)
Codex sends whatever it reads to OpenAI. Glob the project for **/.env*, **/*.pem, **/*.key, **/*credential*, and **/*secret*.
If anything turns up, show the list to the user and wait for confirmation before continuing.
2. Create the log
Run start. The default is isolated mode (--ignore-user-config):
- Not loaded: MCP servers, plugins, and the notify program from the Codex config. The sandbox restricts file writes and network access, but not MCP tools or plugins (browser control, for example), and a read-only sparring partner should not have them.
- Still applied: the model, reasoning effort, and Windows sandbox mode from the config. The script reads them and passes them explicitly.
Add --use-user-config only when the user explicitly wants Codex to have those tools.
3. Write this round's message
Read the relevant code yourself first, then use the Write tool to save your message to a scratch file (for example <scratchpad>/sparring/turn-1.md).
Do not write it with a heredoc (cat > ... <<EOF): long content can be truncated in transit, and shells can mangle quotes and backslashes.
A good message contains:
- Background: the problem and its constraints.
- The current idea or approach, with
path:linereferences. - Specific points for Codex to check (for example "is this lock safe under concurrent access?"), not just "what do you think?".
- From round 2 on: a point-by-point response to Codex's previous reply: what you accept, what you dispute, and your evidence.
4. Send and wait
Always run ask in the background (Bash tool with run_in_background: true). A round can take minutes, and a foreground command can wait at most 10 minutes.
You are notified when it finishes, so do not poll and do not sleep. While waiting, you can tell the user what is being discussed.
Output: stdout prints Codex's reply and the parsed STATUS.
Exit codes: 0 success, 1 invalid arguments or lock conflict, 2 Codex failed this round (details on stderr).
5. Read the reply and decide
Verify first: open the path:line references Codex cites and confirm they say what Codex claims.
Do not accept everything at face value, and do not agree just to end the discussion.
| STATUS | Next step |
CONTINUE | Write the next message (back to step 3) |
AGREE | If you agree too, wrap up; if not, write another round explaining why |
NEED_USER | Stop, ask the user with AskUserQuestion, and include the answer in the next round |
UNKNOWN (no STATUS line) | Treat it as CONTINUE and remind Codex to end with a STATUS line |
FAILED | Read stderr. Retry once for a transient error; if the same error happens twice, stop and tell the user |
There is no default round limit. If the user set one, stop there even without consensus. A deadlock is not convergence: when two consecutive rounds repeat the same disagreement with no new argument or evidence, stop and ask the user with AskUserQuestion instead of looping.
6. Wrap up
- Use Write to draft a summary (consensus, open disagreements, recommended next steps) and append it with
note --title "Summary". - Report to the user: the summary, remaining disagreements, the number of rounds, and the full path of the log.
- If the conclusion calls for code changes, Claude makes them after the user agrees. Codex never edits files in this workflow.
Generated files
| Path | Contents |
<log>.md | The discussion log; the user can open it live in any editor (VS Code, Obsidian, ...) |
<log folder>/.sparring/<name>.state.json | Round count, Codex thread id, settings |
<log folder>/.sparring/<name>.lock | Exists only while a round is running |
<log folder>/.sparring/<name>.round-<N>.jsonl | Raw Codex events for round N, including the commands it ran (for debugging) |
<log folder>/.sparring/<name>.round-<N>.stderr.txt | Codex's stderr for round N (for debugging) |
Pitfalls
- How Codex is located: on Windows the script first looks for
%APPDATA%\npm\node_modules\@openai\codex\bin\codex.jsand runs it with node, so it works even when the npm global folder is not on PATH. Do not switch tocodex.cmd: cmd.exe rewrites quotes inside arguments. Elsewhere it usescodexfrom PATH. TheCODEX_BINenvironment variable overrides both. codex exec resumerejects--sandboxand--cd: the script passes-c sandbox_mode="read-only"and sets the child's working directory instead. Keep this in mind when running commands by hand.- Never add
--ephemeral: without saved sessions, the thread cannot be resumed. - Never switch the sandbox to
workspace-writeordanger-full-access. If the user wants Codex to edit files, that is outside this skill; say so. - Stale lock file: an interrupted round can leave a
.lockbehind. Confirm withstatusand the process list that no Codex process is running before deleting it. - Do not hand-edit the log during a discussion: the script locates the reply through a placeholder; if the placeholder is changed, the reply is appended to the end of the file instead.
- Paths: on Windows both
C:/...and Git Bash style/c/...work; the script converts them. - Non-ASCII text in the Windows sandbox: PowerShell runs in Constrained Language Mode and cannot change its output encoding, so
Get-Contentgarbles CJK text (with or without-Encoding UTF8). The round-1 prompt tells Codex to usecmd /c type <file>instead, which prints UTF-8 correctly (verified). - Reasoning effort values:
minimal,low,medium,high,xhigh(xhighdepends on the model).
Maintenance
- Update the Codex CLI with
npm install -g @openai/codex@latest. Afterwards, runask --dry-runonce to check that the command still builds, then run one real round. - The flags follow
codex exec --helpfrom codex-cli 0.154.0. Ifaskbreaks after an upgrade, compare againstcodex exec --help(on Windows, whencodexis not on PATH:node "%APPDATA%/npm/node_modules/@openai/codex/bin/codex.js" exec --help). - Verify that the sandbox blocks writes (Windows, no quota used): in Git Bash, first
export MSYS_NO_PATHCONV=1(otherwise the/cincmd /cbecomesC:/), then runcodex sandbox -P :read-only -C "<project>" -- cmd /c "echo x> t.txt". Expected: exit code 1, an "Access is denied" message (possibly garbled on non-English consoles), and not.txt. With-P :workspacethe file is created, which serves as a control. - Offline tests:
python tests/test_offline.py. They usetests/fake_codex.pyto simulate the event stream ofcodex exec --json; no sign-in or quota is needed.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

