Overnight Experimenter
Give an AI agent a codebase, a metric, and a time budget — let it run experiments autonomously overnight. You wake up to a log of what it tried, what worked, and what didn't.
Inspired by Karpathy's autoresearch, but general-purpose. Works for performance optimization, prompt engineering, config tuning — anything with a measurable score.
~1000 lines of Python. Zero external dependencies.
Install
pip install overnight-experimenter
Requires Python 3.10+ and a coding agent CLI (Claude Code or Codex).
Quick Start
# Create an experiment
overnight init my-experiment
# Edit the files:
# program.md — what to optimize + constraints
# evaluate.sh — script that outputs a numeric score
# workspace/ — the files the agent can modify
# Run it
overnight run my-experiment --budget 8h --agent claude --direction minimize
# Check progress
overnight status my-experiment
# Generate an HTML report
overnight report my-experiment
How It Works
experiment/
├── program.md # Instructions for the agent
├── workspace/ # Files the agent modifies
├── evaluate.sh # Returns a numeric score
├── experiments.jsonl # Auto-generated log
└── best/ # Snapshot of best version
The loop:
- Agent reads
program.md+ experiment history - Agent makes ONE modification to
workspace/ evaluate.shruns → numeric score- If improved → snapshot to
best/, log success - If not → revert to
best/, log failure - Repeat until time budget is exhausted
Example: Python Performance
The included example optimizes a naive prime-finding algorithm:
# Copy the example
cp -r examples/python-perf my-experiment
# Run for 30 minutes
overnight run my-experiment --budget 30m --agent claude --direction minimize
Starts with trial division (~0.11s), agent discovers sieve of Eratosthenes, bitwise tricks, etc.
CLI Reference
| Command | Description |
|---|---|
overnight init <name> |
Create experiment from templates |
overnight run <name> [options] |
Run the experiment loop |
overnight status <name> |
Show progress summary |
overnight report <name> |
Generate HTML report |
Run Options
| Flag | Default | Description |
|---|---|---|
--budget |
8h |
Time budget (e.g. 8h, 30m, 2h30m) |
--agent |
claude |
Coding agent (claude or codex) |
--direction |
maximize |
Optimization direction (minimize or maximize) |
--max-experiments |
— | Optional cap on number of experiments |
License
MIT
Metadata
Release files for overnight-experimenter 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| overnight_experimenter-0.1.0.tar.gz | 14.4 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| overnight_experimenter-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.4 kB
Release files / overnight_experimenter-0.1.0.tar.gz
| Download URL | overnight_experimenter-0.1.0.tar.gz |
|---|---|
| Size | 14.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7fad27b4116b655419b20731b896bc86d094ab92cbc75186d97132ce8b344422
|
|
BLAKE2b-256 checksum How to use checksums |
de9be160270be0aab252afe7271302e5f8b8bc25c9321cb52c2ebe77ff7b5411
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 9, 2026.
Transparency logRelease files / overnight_experimenter-0.1.0-py3-none-any.whl
| Download URL | overnight_experimenter-0.1.0-py3-none-any.whl |
|---|---|
| Size | 16.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1c886c063033bfbcbb8745dd81652cee405c98dd7317fc802ea3f14ea95f8d42
|
|
BLAKE2b-256 checksum How to use checksums |
7004347365fa10915ce5d6eb9d4815b0a622f8fbb7b163fc64fa852db0cdddd4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 9, 2026.
Transparency logSecurity for overnight-experimenter 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for overnight_experimenter-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 9, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.