Give an AI agent a codebase, a metric, and a time budget — let it run experiments autonomously overnight.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file overnight_experimenter-0.1.0.tar.gz.
File metadata
- Download URL: overnight_experimenter-0.1.0.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fad27b4116b655419b20731b896bc86d094ab92cbc75186d97132ce8b344422
|
|
| MD5 |
a0dc9968469da49dc1f42f08eb35ed32
|
|
| BLAKE2b-256 |
de9be160270be0aab252afe7271302e5f8b8bc25c9321cb52c2ebe77ff7b5411
|
Provenance
The following attestation bundles were made for overnight_experimenter-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on dylanfeltus/overnight-experimenter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
overnight_experimenter-0.1.0.tar.gz -
Subject digest:
7fad27b4116b655419b20731b896bc86d094ab92cbc75186d97132ce8b344422 - Sigstore transparency entry: 1066546285
- Sigstore integration time:
-
Permalink:
dylanfeltus/overnight-experimenter@0fee8e81e7a175ecf97de2ef811fec3f7619a05a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/dylanfeltus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@0fee8e81e7a175ecf97de2ef811fec3f7619a05a -
Trigger Event:
push
-
Statement type:
File details
Details for the file overnight_experimenter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: overnight_experimenter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c886c063033bfbcbb8745dd81652cee405c98dd7317fc802ea3f14ea95f8d42
|
|
| MD5 |
8f582f28194c6430808edcca56f26a28
|
|
| BLAKE2b-256 |
7004347365fa10915ce5d6eb9d4815b0a622f8fbb7b163fc64fa852db0cdddd4
|
Provenance
The following attestation bundles were made for overnight_experimenter-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on dylanfeltus/overnight-experimenter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
overnight_experimenter-0.1.0-py3-none-any.whl -
Subject digest:
1c886c063033bfbcbb8745dd81652cee405c98dd7317fc802ea3f14ea95f8d42 - Sigstore transparency entry: 1066546287
- Sigstore integration time:
-
Permalink:
dylanfeltus/overnight-experimenter@0fee8e81e7a175ecf97de2ef811fec3f7619a05a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/dylanfeltus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@0fee8e81e7a175ecf97de2ef811fec3f7619a05a -
Trigger Event:
push
-
Statement type: