---
title: "I Used REA to Clone OpenAI's Codex"
url: "https://reamcp.dev/en/cases/i-used-rea-to-clone-openai-s-codex-925c9e"
source: "https://www.youtube.com/watch?v=pX8Sy8Rd44U"
source_type: "youtube"
author: "SoftsWeb"
author_handle: "softsweb"
stars: 0
category: "App feature recreation"
categories: ["app-recreation"]
tags: ["agentic-reverse-engineering", "cli", "codex", "ghidra", "open-source", "rea"]
added: "2026-10-16T02:16:00.497Z"
updated: "2026-10-15T10:19:44.000Z"
locale: "en"
content_locale: "en"
---

# I Used REA to Clone OpenAI's Codex

A video demo where the author gives Claude Code only the installed files of OpenAI's open-source Codex (no source) and has it rebuild the non-interactive CLI engine in Python, making REA and Ghidra mandatory tools. The resulting clone passes 416/422 hidden checks (98.6%), with the test kit, REA and Codex repositories linked.

## Description

The author shows a reverse engineering workflow: scan the installed Codex files, make real Codex respond, define a hidden test, then let Claude Code rebuild the program in Python, first without and then with REA and Ghidra mandatory. Notes that Codex is Apache-2.0 open source, that only non-interactive codex exec mode was reproduced using a fake AI server, and that the full Ghidra analysis of the 294 MB binary timed out, so only a carved 15 MB piece was opened with REA. Links to the hidden-test-kit repository and the REA GitHub project are provided.

## Original README

I Used REA to Clone OpenAI's Codex

I gave Claude Code only the files that OpenAI's Codex installs on a computer, with no source code at all, and asked it to rebuild the program in Python while a hidden test I wrote beforehand decided if the copy was good enough. REA, the open source reverse engineering tool, is the one it was supposed to use.

The first copy scored 99% on my easy test and only 75.4% on a much harder one, so I made REA and Ghidra mandatory. The second copy passed 416 of 422 checks (98.6%) and the whole AI bill for both rounds was about $16.80. Everything on screen is replayed from the real logs and results.

0:00 Two terminals, one secret
1:08 The one rule that makes it fair
1:44 Step 1: what is inside the file
2:29 Step 2: making the real Codex talk
3:31 Step 3: the hidden test
4:12 Step 4: the first copy
4:50 Step 5: a much harder test
5:32 Step 6: Ghidra and REA get their turn
6:43 The verdict
7:40 What this really means

Links
Test kit from this video (the hidden test, the fake AI server and the AI's notes): https://github.com/softsweb/codex-clone-hidden-test-kit
REA on GitHub: https://github.com/morluto/rea
Codex on GitHub (open source, Apache-2.0): https://github.com/openai/codex

Notes and honesty
- Codex is open source (Apache-2.0), that is why I picked it. I did not do this to Cursor or Claude Code because their terms forbid it.
- I only copied Codex's non-interactive mode (codex exec). The copy has no screen and no model, it is only the engine, and I used a fake AI server so the test cost nothing.
- Not tested: the real sandbox (it does not start on my computer), the interactive screen, resume and review commands, and a real model.
- The full Ghidra analysis of the 294 MB program never finished (every call timed out after 330 seconds), so I show exactly which parts worked: a carved 15 MB piece of the file that REA could open.
- Remaining misses (6 checks of 422): the real program rejects a tiny image that the copy accepts, the copy does not count tokens used by a goal, it lacks the codex-path folder in PATH, and it does not print the applied patch.
- Only analyze software you are allowed to test. I am not a lawyer and this is not legal advice.
- This video is not sponsored.

#REA #Codex #ClaudeCode #ReverseEngineering #OpenSource
