Skip to main content

Muscle Memory

Use a cheap coding model & let Muscle Memory clean up after it. It learns your fixes as free rules, so your AI bill drops the more it runs.

About the project

Top coding models cost a lot. Cheaper ones are fast and affordable, but they leave a mess: comments that just repeat the code, error handling that quietly hides bugs, leftover debug prints. In our tests, the cheaper model left about 8 times more junk than the expensive one.
Muscle Memory lets you use the cheap model and cleans up after it. A fast System One model, Jev, makes most cleanup calls in about 0.07 seconds, roughly 80 times cheaper than asking Gemini. Gemini only handles the hard calls. Every change is checked against the real tests plus hidden ones the AI never sees, and anything that breaks is rolled back.
It gets cheaper the more it runs. Once it has made the same call correctly 5 times, it writes that call down as a rule and never pays for AI on it again. One decision goes from 2 seconds and paid, to 0.07 seconds and nearly free, to instant and free. In our run it learned two rules on its own and caught its own mistake: one rule deleted code the task needed, the tests flagged it, and it rewrote the rule. Nothing broken shipped.
The rules are plain Semgrep files in your repo, and they run as a CI check that blocks new junk in about 2 ms with no AI cost at all.
Built with Jev, Gemini, Tiger Data, Sentry, DigitalOcean and Semgrep. The seed PRs that trigger the learning on cue are hand-written; everything else is real agent output and real measurements.

Built with

pythoncssjavascripthtmlreactnode.jstypescriptgeminigithubopenaiclaudegoogle-cloudfastapigrokelevenlabsgemma

AI tools

Coded withCursorClaude CodeGemini 4 HydrogenGoogle AI StudioAntigravityCodexGemini 3.5 Flash LiteGPT-6.1 TerraGPT-6.1 SolClaude Haiku 5.5Claude Opus 5.5Claude Sonnet 5.5

Prize Categories Entered

  • Gemini Prize Category Q1 2025 - Q1 2026

    Best Use of Gemini API

    Submitted

    We use the Gemini API through the google-genai Python SDK in four ways. Gemini 4 Hydrogen is our “expert AI”: it decides the cases our fast model is unsure about and double-checks 15% of the fast decisions, returning structured JSON with a verdict and a one-line reason. It’s also our rule writer. Once a kind of decision has 5 test-verified examples, Gemini writes a regex rule that must match the verified cuts and none of the verified keeps, and when a rule over-cuts, Gemini rewrites it. Gemini 4 Hydrogen and Gemini 3.5 Flash Lite also acted as our coding agents, implementing the same 10 tickets to produce the 20 real PRs the factory cleaned. Finally, gemini-embedding-001 embeds every piece of code we judge so we can find similar past decisions.

  • DigitalOcean

    Best Use of DigitalOcean

    Submitted

    The Muscle Memory dashboard runs on DigitalOcean App Platform at muscle-memory-mjivi.ondigitalocean.app. It’s built from our multi-stage Dockerfile, with the React frontend built in Node and the FastAPI backend installed with uv, and it redeploys automatically on every push to main, with a health check on the API. The deployed app only reads data and never calls the AI models, so the only secret on the server is the encrypted database URL. Our live multiplayer game, Junk or Needed?, runs on the same App Platform service, so the audience scans a QR code and plays against the AI on the deployed app from their phones.

  • Tiger Data Q3 2026 - Q2 2027

    Best Use of Tiger Data

    Submitted

    Tiger Cloud is our single database for relational data, vectors and time series. Every keep or cut decision is a row in a TimescaleDB hypertable with its tier, latency, tokens, cost and whether the tests agreed. A continuous aggregate rolls up average speed, cost and accuracy per tier every 10 seconds, and a compression policy keeps the history small. Each piece of code is stored with its 768-dimension Gemini embedding in pgvector. The dashboard’s Tiger panel runs one hybrid query that finds the past decisions most similar to the newest one within the last hour, combining vector distance and a time filter in a single SQL statement. It also compares query time on the continuous aggregate against the raw table. PRs and learned rules live in regular relational tables alongside.

  • Sentry

    Sentry Raffle

    Submitted

    We use the Sentry Python SDK for AI agent monitoring. Each PR the factory cleans is a Sentry transaction, and every Jev and Gemini call inside it is a gen_ai span recording the model name and token counts, so one trace shows the fast model answering in about a tenth of a second next to the expert model taking about two. Failed model calls are captured as errors and are never treated as a verdict, so a broken API call can’t silently delete code. The dashboard API reports to Sentry too, and the React frontend includes Sentry tracing, an error boundary and session replay, which switch on when a frontend DSN is set.

  • HyperFrames

    Best Demo Video Using HyperFrames

    Submitted

    Our entire demo video was built and rendered with HyperFrames. It’s 7 HTML scene compositions on one timeline: a live-action intro, a match cut into 2D animated versions of us, a story in a noir 2D style, and an animated recreation of our real dashboard. Camera moves, lip-sync, color grading, typing text cards, the dashboard animation, 30+ sound cues and the final MP4 are all HyperFrames. Everything is deterministic: same input, same 73.6 s video, rendered locally with the pinned CLI ([email protected])

  • Event prize

    Best Overall Hack

    Submitted

    Muscle Memory is an AI code cleaner that gets faster, cheaper and more trustworthy the more it works. AI coding agents write junk: comments that repeat the code, error handling that silently hides bugs, leftover debug prints. Our factory cleans it, and once a call has been proven right 5 times it writes that judgment down as a rule, so the same decision goes from about 2 seconds (Gemini), to about 0.1 seconds (Jev), to about 0.0002 seconds with no AI at all. Every cut is verified by real tests plus hidden tests the AI never sees, and it shipped zero broken changes. It even caught and fixed its own mistake live. It’s fully working and deployed, with a live dashboard, a phone game the audience plays against the AI, and a CI check that blocks new junk using the habits it learned.

  • Event prize

    Best Use of System One Models

    Submitted

    Jev is the core of our factory, and we use it the way it’s meant to be used: Jev makes judgments, and code makes decisions. For each piece of questionable code, Jev answers small, concrete yes/no questions (Nouls), such as “Does this except block throw the error away so the caller never learns it happened?” and “Does the ticket ask for errors to be ignored?” A readable truth table in code turns those probabilities into keep or cut. Only unsettled answers (probability between 0.3 and 0.7) go to the slower Gemini model. In our full run, Jev settled 80 of 84 model decisions, about 16 to 30 times faster and about 80 times cheaper than Gemini. Then we take “System One models should become part of code” literally: Jev-verified habits are compiled into rules that run with no model at all.

  • Event prize

    Cleanest Use of a Software Factory

    Submitted

    Coding agents produce PRs, and Muscle Memory is the gate that removes the slop before it ships, with proof. Every cut is applied in a scratch copy and verified against the real tests plus hidden tests no model ever sees. Anything that breaks is undone, so zero broken changes shipped. The factory is fully transparent: every decision is logged, and every learned habit is a readable Semgrep rule versioned in git. When a habit over-cut code the task needed, the tests caught it, the rule was switched off, and it was rewritten as v2, and that whole correction is in the git history. Those habits then run as a CI check that blocked 10 problems in a new AI-written file in about 2 milliseconds, with no AI involved.