<!-- Canonical page: https://reversedwithai.com/p/electron-app-lost-source-codex -->
Canonical page: https://reversedwithai.com/p/electron-app-lost-source-codex

# Recovered the lost source of an Electron drawing app from its compiled bundle with Codex

> Five days to turn an obfuscated bundle back into readable TypeScript.

The author used OpenAI Codex to reconstruct lost TypeScript source code from an obfuscated Electron app bundle. By implementing an external memory system and automated session management, the author achieved a functional codebase in five days.

## Key facts

- Target: Author's own Electron drawing app
- Category: Apps
- Platform: Electron
- Models: Codex
- Tools: Codex
- Outcome: Partial
- Time spent (author-reported): 5 days
- Checks: Source available: not reported; Repro steps: not reported; Real hardware: not reported; Verified by others: not reported
- Author: [Baoyu (@dotey)](https://x.com/dotey)
- Added: 2026-10-14
- Updated: 2026-10-14
- Sources reviewed: 2026-10-14 (editor)

## What was done

The author recovered lost source code from a compiled Electron application by using OpenAI Codex to reverse-engineer obfuscated JavaScript files extracted from an asar bundle. The process involved identifying module structures and converting them into TypeScript. To manage the limited context window of Codex, the author implemented an external memory system using AGENT.md and PLAN.md files, which tracked progress and provided instructions across multiple sessions. An automated script managed session continuity by detecting context limits and triggering new sessions with a continue command. The author reports that Codex initially prioritized code that compiled over complete restoration, requiring a specific instruction to ignore build errors during the module conversion phase. Final assembly involved scaffolding with Electron Forge and iterative testing. The author notes that while the resulting application is functional and modifiable, it contains runtime bugs and edge-case behavioral differences compared to the original. Verification through npm start and integration tests proved necessary for Codex to self-correct during the assembly phase. The project is documented at [https://x.com/dotey/status/2017754943197778247](https://x.com/dotey/status/2017754943197778247).

## Human work and limitations

Codex silently skipped code to make builds pass until a CODEX.md rule told it not to worry about compiling. The author added CODEX.md and PLAN.md as external memory and had Codex write a script to restart sessions. Some runtime bugs and edge-case differences remain.

## Sources

- [Write-up](https://x.com/dotey/status/2017754943197778247)
- [Discussion](https://yuanchang.org/en/posts/codex-reverse-engineer-lost-code/)

Figures are reported by the author and not measured by this site, except the commit history. Entry drafted with AI from the linked sources and checked against them.

Cite as: Baoyu (@dotey) (2026). Recovered the lost source of an Electron drawing app from its compiled bundle with Codex. Reversed with AI. https://reversedwithai.com/p/electron-app-lost-source-codex
