# Why asking the same coding agent session to review its own branch misses bugs (and the two CLI commands we use for clean-room review between Claude Code and Codex) — retained record

> Retained reddit record from reddit:ClaudeAI.

Canonical: https://highsignal.app/data/records/1569bd8995a01260

[← sources](https://highsignal.app/data)


source: [reddit](https://highsignal.app/data/reddit) (reddit:ClaudeAI)  published 2026-11-07 06:52 ingested 2026-11-08 02:36

[original source ↗](https://www.reddit.com/r/ClaudeAI/comments/1xpzxlr/why_asking_the_same_coding_agent_session_to/)

## retained text



```
When you finish a feature branch in Claude Code or Codex and ask that same session to "review your changes for bugs before I commit," the review almost always comes back clean even when an obvious regression is sitting in the diff.

The reason is context poisoning. Because the author agent still has its entire reasoning history in the context window, including the wrong assumptions it made twenty minutes ago and the edge cases it rationalized away, it reads its own code through those same assumptions. Even spawning a subagent on the same model family often hits the same blind spots.

The most reliable fix I have found is a clean-room review pass across model vendors where the reviewer only sees the raw git diff, the repo files on disk, and zero chat history from the session that wrote the code.

When Claude Code writes the branch, you can run OpenAI's built-in non-interactive review command in Codex CLI from the same terminal:

```bash
# Review all uncommitted (staged, unstaged, and untracked) changes
codex exec review --uncommitted --ephemeral

# Or review a feature branch against main and write findings to a file
codex exec review --base main --ephemeral -o /tmp/codex-review.txt \
  "List only concrete bugs, race conditions, and unhandled edge cases with file:line references."
```

Passing `--ephemeral` keeps the review pass from cluttering your saved Codex session list, and `-o /tmp/codex-review.txt` gives you a clean findings file you can feed back to the coding session if anything real turns up.

When Codex writes the branch and you want Claude Code to do the clean-room review pass without edit permissions, you can pipe the branch diff into `claude -p` with write tools disabled:

```bash
git diff main...HEAD | claude -p \
  "Review this diff against the codebase. Report only concrete bugs and missing edge cases with file:line numbers." \
  --tools "Read,Grep,Glob"
```

Because `--tools "Read,Grep,Glob"` strips `Edit`, `Write`, and `Bash`, the reviewer can still open surrounding files to check callers and types, but it cannot touch the working tree.

Running the author pass on one model and the read-only diff review on the other takes less than a minute before opening a PR, and it catches the exact off-by-one and schema mismatch bugs that same-session self-review rubber-stamps.

What does your pre-PR review pass look like when working with Claude Code and Codex?
```



document fetched 2026-11-08 00:21 · canonical https://reddit.com/r/ClaudeAI/comments/1xpzxlr/why_asking_the_same_coding_agent_session_to
