Self-improving coding environment  ·  biofeedback loop

The signal that can’t lie.

A development environment that reads your heartbeat, learns which interruptions keep you in flow, and evolves with you · under your hand, never on its own.

orienting → calm startle → stress the loop that learns scroll ↓
scan to follow along

Where this came from

It started with a talk, two weeks ago.

At Organized AI, at Antler, Esteban reproduced HarnessX live: the idea that you improve an agent by evolving its harness (its tools, memory, prompts, control flow) from real execution traces, running local Ollama models with a frontier model as the judge.

Could the harness evolve from my biofeedback?

Could the environment I build with learn, from my own nervous system, how to keep me in flow? I walked out with that question. This deck is the experiment that answers it.

Esteban’s workshop at Organized AI (Antler), reproducing HarnessX. arXiv:2606.14249. Local model here: qwen3.5:27b.

The invisible tax

Every interruption has a price you can’t feel.

A ding arrives. You glance, you answer, you turn back. The switch felt free. It wasn’t.

23 min

Studies of interrupted knowledge work put the cost of a single interruption at over twenty minutes to fully return to the task. The body registers the jolt in the first five seconds, long before you notice.

The premise

Your nervous system is already scoring every alert.

A chest strap can read that score in real time: heart rate, beat-to-beat variability, the shape of the response. The information was always there. Nothing was listening to it.

Two sounds, two heartbeats  ·  real captures

Same alert. Opposite physiology.

Two notifications, two recordings from the same heart, minutes apart. One kept me in flow. One tore me out of it. My pulse knew which was which before I did.

In flowimpression 472

A sound that lands

Attention captured, then the heart slows. The orienting response: awareness without alarm.
heart rate −2.85 bpm HRV ×1.08 reward 0.69
Yanked outimpression 475

A sound that jars

The heart races and variability collapses. The startle response: sympathetic, costly, slow to recover.
heart rate +2.11 bpm HRV ×0.63 reward 0.30

Heart-rate and HRV values, and the rewards, are the actual measurements from a Polar H10 (RR intervals, single-lead ECG recorded simultaneously). The beat rhythm you see is driven by those real numbers; the waveform is rendered for legibility. Reward is a 0–1 orienting score: higher is calmer.

The orienting response  ·  measured on my own heart

The difference is measurable, and it is fast.

Two real notification captures, minutes apart. Attention without threat decelerates the heart and lifts variability. A startle does the opposite, in seconds, before you notice.

A sound that lands  ·  impression 472
−2.85 bpm

Heart rate slows. Orienting: attention captured, calm held.

HRV ×1.08reward 0.69
A sound that jars  ·  impression 475
+2.11 bpm

Heart rate races. Startle: sympathetic, costly, slow to recover.

HRV ×0.63reward 0.30

Both columns are real measurements from a Polar H10, minutes apart. The reward is the 0 to 1 orienting score the system actually learns from. This is the signal a five-second smartwatch sample cannot see.

Inside the sensor  ·  the capture path

From chest strap to reward, without leaving the machine.

No cloud, no phone app in the middle. The strap speaks straight to the laptop over Bluetooth, and the entire score is computed locally, in the moment.

Pipeline: Polar H10 to RR intervals plus ECG 130 Hz to a window around the alert to an orienting versus startle score to a reward from 0 to 1

Close the loop

The application tunes itself to your nervous system.

Every alert is an experiment. The heartbeat is the result. Over time the environment learns which signals you meet with calm.

1 · act
It needs you
An agent finishes or blocks. A sound plays. One impression logged.
2 · measure
Your heart answers
A window of RR and ECG around the alert, scored orienting vs startle.
3 · reward
Blend the evidence
Your rating, your response time, your physiology · combined honestly.
4 · learn
Choose better next time
A bandit shifts toward the sounds you meet with calm, and keeps exploring.

An honest reward

A learning system is only as good as the labels it trusts.

Observed-only

Never guess a missing signal

No rating that session? The reward leans on latency and pulse alone. Absent signals are skipped, never imputed, so the estimate can’t drift toward whatever is most often missing.

Recency decay

Yesterday’s delight fades

A wonderful sound dulls with repetition. Beliefs decay toward the prior, so the system tracks the person you are now, not the one you were last month.

Exploration floor

Always keep sampling

A guaranteed slice of curiosity means no early favorite gets to lock the system in. It keeps asking the question your body keeps answering.

The same three commitments govern how the wider environment scores its own changes. The discipline that keeps a heartbeat honest is the discipline that keeps a self-editing tool honest.

The whole system, one picture

Three loops, one weekly desk, one human.

Everything the environment learns converges into a single briefing you read once a week. Each loop measures a different thing; none of them touch the live system on their own.

Three loops (the environment evolves, corrections become tests, your body tunes the alerts) converge into a Weekly Improvement Report, which ends at You promote or reject

Loop 3 is deployed today. Loop 1 is built and gated. Loop 2 and the weekly report are the next build. The picture is the destination; the honest status is on a later slide.

You steer the evolution

The system proposes. You dispose.

This is guided evolution, not autopilot. The environment can draft a change to its own instructions, sounds, or workflow, but nothing reaches the live system until it clears three gates · and the last gate is you.

Gate 1 Deterministic

Plain code, not a model. No previously working behavior may regress; a curated safety set must hold with zero tolerance; the change must actually help. Frozen guardrails can never be touched.

Gate 2 An adversary

A second model from a different family tries to refute the change: is the gain real, or is it gaming the test? It can veto, but it can never overrule the code gate.

Gate 3 You

Every surviving change arrives as a plain diff with its evidence and a one-line undo. You promote it, or you don’t. Nothing is ever applied on its own.

Not a tradeoff

Flow, health, and output are the same signal.

The old assumption is that productivity is bought with strain. The heartbeat says otherwise: the calm alert is the one you answer fastest, remember longest, and pay for least. Optimize for the regulated nervous system and the other two follow.

Flow

Protected attention

Fewer startles, and none during deep focus. The thread stays unbroken.

Health

A calmer baseline

Higher variability, less sympathetic load, measured not guessed, across the day.

Output

Faster, cleaner returns

The signal you meet with calm is the one you act on soonest and recover from fastest.

The bigger loop

The same idea, scaled to the whole environment.

Notifications were the proving ground. The same architecture · instrument, measure, reward, gate, propose · runs over the environment itself. It reads its own execution traces, digests them locally so nothing private leaves the machine, and drafts small, reviewable improvements to its instructions and skills. Every week it hands you a report: here is what I noticed, here is what I would change, here is the evidence, here is the one command to undo it. You remain the conductor.

The recursion

It improves the way it improves.

The engine that gates changes was itself hardened by that exact method: a model proposed the code, an adversary found sixteen flaws, a test suite gated the fixes, a human merged them. Even this presentation’s companion paper was adversarially reviewed and lost its two best claims for being unprovable. The gates apply to everything, including themselves.

Do this yourself

The recipe is not exotic. It is off-the-shelf parts, wired with discipline.

  1. 01Wear a real sensor. A chest strap with beat-to-beat output, a Polar H10 or equivalent, read over Bluetooth with an open library. ~$90 · bleak / node-ble
  2. 02Instrument the moment. Log every alert your tools raise as an event you can attach a reward to. a hook, a watcher
  3. 03Score the response. Take an HR window around each alert; orienting is deceleration with rising variability, startle is the opposite. RR intervals · RMSSD
  4. 04Learn with a bandit. A discounted Thompson sampler over your candidate signals, blending rating, latency, and pulse. ~200 lines
  5. 05Digest locally. Run a small local model over your own traces so nothing private leaves the machine. Ollama · qwen3.5:27b
  6. 06Gate, then propose. A deterministic check, a second model as adversary, and a human promotion step. Never auto-apply. the whole safety story
Three rules that make it trustworthy

Observed-only reward. Never impute a signal you did not measure. Missing is missing, not zero.

Recency decay. Let old beliefs fade toward the prior, so the system tracks who you are now.

Propose-only. The machine drafts, a gate filters, an adversary attacks, and a human decides. Every time.

Get those three right and the parts underneath can be anything. The discipline is the product.

The shopping list

One purchase that matters. The rest you probably already run.

Hardware
  • Polar H10 chest strap. The whole biometric story runs on this: beat-to-beat RR and raw ECG over Bluetooth. ~$90
  • Spare Pro strap (optional). The fabric wears before the pod does. ~$25
  • A Mac or Linux laptop with Bluetooth. You already have it. have it
Software
  • Python + bleak to read the strap. free
  • Ollama running qwen3.5:27b for private digestion. 32 GB RAM helps. free
  • Claude + Codex as evolver and adversary. your AI plans
  • A terminal agent harness (herdr, tmux, or similar). free

Total new spend to replicate the loop: about $90. Everything else is free or software you already run. The strap is the only thing between you and your own biofeedback loop.

Where it is, honestly

Deployed to the heartbeat. Building outward.

● live
The attention loop. Learning bandit in production, biometric reward from a real Polar H10, running autonomously whenever the strap is worn. 472 impressions logged.
● live
Hardware-verified physiology. Single-connection RR + ECG, orienting rewards written end-to-end. The captures on this page are from it.
◐ built
The evolution engine. Propose, gate, adversarially critique, promote, roll back · 119 tests, twice adversarially reviewed. It refuses well; it has not yet been asked to accept.
○ next
Correction mining & the weekly report. Turning real corrections into the benchmark that lets the loop honestly accept a good change, and the Sunday-night briefing that puts it all in one place.
○ next
Focus-aware timing. Joining attention, fleet state, and pulse so the environment holds a non-urgent alert until you surface from deep work.

Above: an actual single-lead segment recorded during impression 472. Real recording, real heart, real 0.69.

The thesis

Stay in flow. Stay well. Ship more.

Build a development environment that keeps you regulated, keeps you healthy, and gets a little better every week · because it learns from the one signal that can’t lie, and it never changes itself without asking.

SICE  ·  a biofeedback-driven, human-gated self-improving coding environment
the gates are not overhead on the value · the gates are the value

Connect with me

I’m always looking to collaborate with smart people.

Colin McNamara

Field CTO, AHEAD

Founder & organizer, AIMUG
Founder, Acquit.ai

colinmcnamara.com/connect

scan to connect