
Amateur astronomers are now reporting exoplanet candidates that no professional pipeline had flagged. They found them by asking OpenAI Codex to write the analysis code and pointing it at years of archived NASA light curves. OpenAI Codex exoplanet hunting is not a stunt. It shows that the hard part of citizen science has moved from writing the code to knowing what to ask and how to check the result. TESS has released several years of public sky data, and most of it has only been searched by automated pipelines tuned for the easy cases. With a laptop, Python and some patience, you can search the same archive this weekend.
What’s actually new in OpenAI Codex exoplanet hunting
The workflow is new. The data is not. TESS (Transiting Exoplanet Survey Satellite) and Kepler light curves have been free on NASA’s MAST archive for years, and tools like Lightkurve and astropy’s Box Least Squares (BLS) implementation have been mature for just as long. The barrier was always the glue code: downloading the right sectors, stitching and detrending noisy photometry, running period searches over thousands of targets, and filtering out the false positives that bury real signals. Hobbyists who reported recent candidates say they handed that glue work to Codex. They described each step in plain English, let the agent write and debug the scripts, and spent their own time on vetting.
Agentic coding tools now do more than autocomplete. They run code, read the tracebacks, fix their own mistakes and repeat the loop. In a terminal, Codex CLI can install packages, fetch data, produce a periodogram and adjust the detrending window after inspecting the residuals, often without the user writing a line of Python. For astronomy, that turns a weeks-long learning curve into an afternoon of guided iteration.
Be precise about what was found. These are candidates, not confirmed planets. A transit-like dip can come from an eclipsing binary, a blended background star, stellar activity or an instrument systematic. A candidate becomes a planet only after follow-up: radial-velocity measurements, high-resolution imaging or statistical validation, usually by professional teams. What changed is how many people can now produce credible, well-documented candidates worth that follow-up.
Why it matters
- The archive is under-mined. Official pipelines search for signals above set thresholds. Shallow transits, single transits, long periods and messy stars often fall through, and that is where amateurs have room.
- Natural language is now the interface. If you can describe a box least squares transit search clearly, you can run one. Scientific judgment matters more than syntax.
- Vetting is the new bottleneck. Generating candidates is cheap. The people who stand out will rule out false positives rigorously before they submit anything.
- It is a great data science project. TESS light curve analysis in Python teaches time-series cleaning, signal detection, statistics and reproducibility on real data with real stakes.
- The pattern carries over to other fields. The same Codex CLI prompting approach works on any large public dataset: genomics, climate records, financial filings.
- Expect more noise. Professional astronomers will see a flood of low-quality submissions. Careful documentation separates you from that flood.
How to use it today
The workflow below runs on free data and open-source libraries. You need Python 3.10+, Node.js 18+ for Codex CLI, and a ChatGPT plan or OpenAI API access to run Codex.
1. Set up your environment
python -m venv exohunt
source exohunt/bin/activate # Windows: exohunt\Scripts\activate
pip install lightkurve astropy numpy matplotlib pandas astroquery
npm install -g @openai/codex
codex --version
Run codex once in an empty project folder and sign in. Dedicate this folder to the project so the agent’s file access stays scoped.
2. Give Codex a project brief
Codex reads an AGENTS.md file in the project root for standing instructions. Use it to lock in the scientific guardrails before you write any prompts:
# AGENTS.md
Project: transit search over archival TESS light curves.
- Use lightkurve for data access (MAST), astropy BoxLeastSquares for searches.
- Prefer SPOC 2-min cadence; fall back to TESS-SPOC or QLP FFI light curves.
- Never discard data silently. Log every quality mask and outlier cut.
- Save every figure to ./figures and every result row to ./results/candidates.csv.
- A "candidate" requires: SDE > 9, at least 3 transits, odd/even depth consistent within 3 sigma.
- Do not claim discoveries. Report signals and diagnostics only.
3. Recover a known planet first
If your pipeline cannot find a confirmed planet, it will not find a new one. A short Lightkurve script:
import lightkurve as lk
import numpy as np
search = lk.search_lightcurve("Pi Mensae", mission="TESS", author="SPOC")
print(search)
lcs = search.download_all(quality_bitmask="default")
lc = lcs.stitch().remove_nans().remove_outliers(sigma_upper=4, sigma_lower=20)
flat = lc.flatten(window_length=901)
periods = np.linspace(1, 20, 20000)
pg = flat.to_periodogram(method="bls", period=periods, duration=[0.05, 0.1, 0.15, 0.2])
best = pg.period_at_max_power
t0 = pg.transit_time_at_max_power
dur = pg.duration_at_max_power
print(f"Period: {best:.4f} T0: {t0} Duration: {dur:.3f}")
flat.fold(period=best, epoch_time=t0).scatter()
Pi Mensae c should appear near 6.27 days. Once it does, you have a working baseline.
4. Let Codex build the batch pipeline
Hand the scaling work to the agent. This prompt works well in Codex CLI:
codex "Write search.py that takes a CSV of TIC IDs, downloads all TESS SPOC
light curves for each with lightkurve, stitches sectors, flattens with a
window_length tuned to ~3x the max duration searched, and runs astropy
BoxLeastSquares over periods 0.5-30 days. For each target, save: best period,
t0, duration, depth, SDE, number of transits observed, and a 4-panel PNG
(raw LC, flattened LC, periodogram, phase-fold). Handle download failures
gracefully and resume from where it left off. Test it on 5 targets first."
For unattended runs, use non-interactive mode:
codex exec "Run search.py on targets.csv, then summarize results/candidates.csv
sorted by SDE and list any errors encountered."
5. Choose targets where the archive is thin
Skip the stars everyone has already mined. Ask Codex to build a target list of fairly bright stars, observed in several sectors, that are not already TESS Objects of Interest:
codex "Using astroquery, query the TESS Input Catalog for stars with Tmag
between 9 and 12, Teff between 3500 and 6000 K, within a 10-degree radius
of RA=90, Dec=-66 (the southern continuous viewing zone). Cross-match against
the current ExoFOP TOI list and drop any star that is already a TOI. Save to
targets.csv."
6. Vet before you get excited
Most citizen-science claims fall apart here. Have Codex add the standard false-positive checks:
codex "Add vet.py. For each candidate: (1) compare odd vs even transit depths,
(2) search for a secondary eclipse at phase 0.5, (3) check whether the period
matches a known TESS systematic (~13.7 days, momentum dumps), (4) download the
target pixel file and test for centroid shifts in-transit vs out-of-transit,
(5) flag if depth implies a companion radius > 2 Jupiter radii given the TIC
stellar radius. Output a pass/fail table and diagnostic plots."
Open every flagged plot yourself. The agent writes the checks; you have to believe the result.
7. Report responsibly
If a signal survives vetting, write it up with the TIC ID, sectors used, period, epoch, depth, duration, all vetting plots and your code. Submit it as a Community TOI (CTOI) through ExoFOP, or post it to the Planet Hunters TESS community, where experienced volunteers and scientists review submissions. Don’t announce a “new planet” on social media.
How OpenAI Codex compares for exoplanet hunting
Codex isn’t the only option. Here is how the main approaches compare for citizen science on the NASA MAST archive:
| Approach | Coding required | Scale | Strengths | Weaknesses |
|---|---|---|---|---|
| OpenAI Codex CLI | Minimal | Thousands of targets | Runs and debugs its own code, good at batch pipelines, non-interactive mode for long jobs | Needs a paid ChatGPT or API plan; can write plausible but subtly wrong statistics |
| Claude Code | Minimal | Thousands of targets | Strong at long, multi-file projects and explaining its reasoning | Same verification burden; subscription required |
| Gemini CLI | Minimal | Thousands of targets | Generous free tier, large context for big logs and catalogs | Agent loop can be less reliable on long debugging sessions |
| Planet Hunters TESS (Zooniverse) | None | Per light curve, by eye | Human pattern recognition, established path to publication | Slow; you search only what the project serves you |
| Hand-written Python | High | Unlimited | Full understanding and control of every step | Steep learning curve; weeks before your first real search |
Our take: use whichever coding agent you already pay for. They all handle this workflow well. Your results depend on the guardrails in your AGENTS.md and the discipline of your vetting, not on which model wrote the loop.
What’s next
Expect the professional community to formalize this. ExoFOP and the TESS follow-up groups will probably tighten CTOI submission requirements as AI-assisted candidates pile up, likely requiring reproducible code, standard vetting reports and possibly automated triage of incoming submissions. Amateurs who already publish clean notebooks and diagnostics will have an advantage.
On the tooling side, watch for agent-friendly wrappers around existing vetting packages and for statistical validation tools like TRICERATOPS to become easier to run. The gap between “I found a dip” and “here is a false-positive probability” is closing. The data keeps growing too: TESS adds sectors, full-frame image light curves accumulate, and ESA’s PLATO mission is due to launch in the next few years with a whole new archive.
The bigger story is that agentic coding has made real science more accessible, and exoplanets are just the most photogenic example. The same weekend workflow of a public archive, an open library, a coding agent and human vetting works for variable stars, asteroid light curves, gravitational-wave catalogs and more. People who learn to direct and check these agents now will have a durable edge.
Frequently Asked Questions
Do I need astronomy experience to start OpenAI Codex exoplanet hunting?
No, but you need to learn the basics of vetting. Codex can write the pipeline. It cannot reliably tell you whether a dip is a planet or an eclipsing binary. Before you trust any candidate, learn what odd/even depth differences, secondary eclipses and centroid shifts mean.
Is the TESS and Kepler data really free?
Yes. All TESS and Kepler light curves, target pixel files and full-frame images are public on NASA’s MAST archive. Lightkurve downloads them directly with no account or API key.
What is a box least squares transit search?
BLS fits a simple box-shaped dip to a light curve across a grid of trial periods and durations, then reports which combination best explains the data. It is the standard first-pass method for finding periodic transits, and astropy and Lightkurve both include fast implementations.
How do I know my candidate isn’t already known?
Cross-match your TIC ID against the ExoFOP TOI and CTOI lists and the NASA Exoplanet Archive before anything else. Have Codex automate this check so you never waste vetting time on a known object.
Can I get credit if my candidate becomes a confirmed planet?
Often, yes. Planet Hunters TESS volunteers and CTOI submitters have been credited, and sometimes named as co-authors, on discovery papers. Credit depends on submitting through proper channels with complete documentation, not on posting first.
What laptop specs do I need?
Any modern laptop with 8 GB of RAM handles single targets and small batches. For thousands of targets, disk space for cached downloads and runtime become the limits. Run batches overnight with codex exec, or move to a free cloud notebook for larger searches.
Go deeper than this article
This article covers the essentials. Our premium eguide library gives you the full step-by-step playbooks — prompts, workflows, and copy-paste recipes you can put to work today.