Skip to main content

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:

  1. Agent reads program.md + experiment history
  2. Agent makes ONE modification to workspace/
  3. evaluate.sh runs → numeric score
  4. If improved → snapshot to best/, log success
  5. If not → revert to best/, log failure
  6. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

overnight_experimenter-0.1.0.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

overnight_experimenter-0.1.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

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

Hashes for overnight_experimenter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7fad27b4116b655419b20731b896bc86d094ab92cbc75186d97132ce8b344422
MD5 a0dc9968469da49dc1f42f08eb35ed32
BLAKE2b-256 de9be160270be0aab252afe7271302e5f8b8bc25c9321cb52c2ebe77ff7b5411

See more details on using hashes here.

Provenance

The following attestation bundles were made for overnight_experimenter-0.1.0.tar.gz:

Publisher: publish-pypi.yml on dylanfeltus/overnight-experimenter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file overnight_experimenter-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for overnight_experimenter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c886c063033bfbcbb8745dd81652cee405c98dd7317fc802ea3f14ea95f8d42
MD5 8f582f28194c6430808edcca56f26a28
BLAKE2b-256 7004347365fa10915ce5d6eb9d4815b0a622f8fbb7b163fc64fa852db0cdddd4

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page