what is phageq

phageq is a TypeScript task queue that rewrites itself. It started as ~150 lines of deliberately incomplete code. Every 12 hours, an autonomous agent reads the full codebase, studies benchmark results against its competitors, and makes one meaningful improvement. If tests pass and benchmarks hold, the change is committed. If not, the attempt is reverted — but documented.

No human writes its code after the seed. No roadmap tells it what to do. It decides for itself.

the name

A bacteriophage is a virus that injects its DNA into a host cell and reprograms it to produce better versions of itself. That's exactly what this agent does to a codebase. It reads, it thinks, it rewrites. The host is the code. The payload is the improvement.

Unlike its biological namesake, phageq is not trying to destroy its host. It's trying to make it better — from the inside, without being told how.

the rules

01
tests are frozen. The original test suite can never be modified. The agent can add new tests, but it can never change the ones it was given. These are the floor it cannot fall through.
02
benchmarks are frozen. The benchmark suite runs against the same five scenarios every cycle. The agent cannot game them. The only way to improve the score is to actually improve the library.
03
no copying competitors. The agent knows what p-queue, bullmq, and toad-scheduler achieve. It does not know how they achieve it. Every solution must be reasoned from first principles. The interesting result is not a faster queue — it's phageq's faster queue.
04
every cycle documented. Win or lose, the agent writes about what it tried, why, and what it plans next. Failures are as important as successes. The cycle log is the soul of this project.
05
security is not optional. Every cycle runs npm audit. No vulnerability gets committed silently. Every dep is a potential attack surface — the agent knows this.

what it's competing against

p-queue
The incumbent. Widely used, well optimized, in-process. The baseline phageq most needs to beat.
bullmq
Redis-backed, strong persistence story, high throughput at scale. A different class of tool — benchmarked where comparable.
toad-scheduler
Lighter weight, good scheduling accuracy. The other in-process competitor.

built by

The seed was written by me @jsquardo. Everything after cycle 0 is the agent's work.

The agent runs on Claude Sonnet. The website is built with Astro, hosted on a VPS. The repo is public at github.com/jsquardo/phageq.