Long autonomous AI coding sessions have a characteristic way of going wrong. The
model is fine. The tools are fine. What fails is the operating structure around
the session: after an hour or two the run drifts off the original goal, redoes
work it already finished, expands scope on its own, stalls waiting for a
certainty that is never going to arrive, or quietly starts asserting things the
evidence in front of it does not support.
I build autonomous revenue and operations workflows, and I kept hitting all five.
This is the structure I now put around every long session to keep it pointed at
the goal. None of it is exotic. It is mostly about writing things down before you
start and being strict about a few boundaries.
1. Define the mission in one line, and say what not to redo
Before the agent does anything, write a single sentence that states the outcome
you want from this session, plus a short list of things that are already done and
must not be touched. "Add pagination to the results endpoint; the schema
migration and the client SDK are already shipped, leave them alone."
This sounds trivial. It is the highest-leverage thing you can do. A long session
without a one-line mission will interpret every interesting side quest as in
scope. A one-line mission gives the agent — and you — something to check every
action against: does this move the mission forward, yes or no.
2. Separate hard constraints from soft signals
Split every "should I do this?" decision into two layers that are evaluated
differently.
Hard constraints are deterministic and fail-closed. Do I have the right to
make this change. Am I about to state something I have not verified. Is this the
exact target I was asked to modify, or just something close. Is the data I am
relying on actually what it claims to be. If any hard constraint fails, the
action does not happen — no amount of "but this looks like a good idea" rescues
it.
Soft signals are probabilistic. How confident am I that this design is right.
How likely is this to be the thing the user actually wants. These get a vocabulary
like unknown / weak / moderate / strong, and — importantly — an unknown soft
signal should make the next step smaller, not stop it. Refusing to act because
you are not certain has its own cost: the work never gets done and you never
learn anything. Shrink the step, take it, look at the result.
Mixing these two layers is how you get an agent that is reckless about the things
that matter and paralysed about the things that do not.
3. Evidence before expansion
Do not scale up an approach on a proxy for success. Scale it on the real thing.
There is a natural hierarchy of evidence: "the code compiles" is weaker than "the
test passes" is weaker than "the feature works against a real input" is weaker
than "the person who asked for it confirmed it does what they need." A long
session loves to treat the weak end of that hierarchy as permission to build ten
more things on top. It is not. Get one real confirmation before you expand.
A passing test suite and a high internal "this looks ready" feeling can never
move you up that hierarchy on their own. Only a real downstream result does.
4. Keep state, and checkpoint it
A long session should leave a trail you can read. After each meaningful step,
write down: what changed, why, what the observed result was, and what the next
step is. A short running log in a file is enough.
Two reasons. First, when the session gets summarised or interrupted, that log is
what lets it resume without re-deriving everything. Second, it forces the agent
to state the result of each step explicitly, which is where you catch "I made the
change" quietly standing in for "I made the change and checked that it worked."
5. Write explicit stop conditions
Decide, up front, what "done" means and what would make you stop early. "Done =
the new endpoint returns paginated results, the existing tests pass, and I have
run it against the staging dataset once." "Stop early if the migration turns out
to be required after all, or if the change touches more than three files."
Without stop conditions a long session does not end — it tapers into
increasingly speculative work. With them, the agent has a clear finish line and a
clear list of trip-wires that mean "surface this to a human instead of pushing
on."
6. Distinguish execution from verification
These are different activities and long sessions blur them. Execution is making
the change. Verification is establishing, with evidence, that the change did what
it was supposed to and did not break anything else. Budget time for both, and do
not let a session report success on the strength of execution alone. "I wrote the
function" is not "the function is correct."
7. Do not build a framework when a shipped action would do
The most common way a long autonomous session burns hours with nothing to show:
it decides the real problem is that the codebase needs a better abstraction, and
disappears into building one. Sometimes that is genuinely the task. Usually it is
avoidance of a smaller, more exposed, more useful action.
A good rule: if you can accomplish the mission with a concrete, bounded change
that a person could review in ten minutes, do that first. Earn the abstraction
with a second and third real use case, not with a prediction that you will need
one.
8. Tie the session to an economic or operational goal
Every long session should trace back to something that matters outside the
codebase — revenue, a cost, a user-facing capability, an operational risk. When
the mission is anchored to a real-world outcome, scope questions answer
themselves: "does this help ship the thing the business is waiting on" is a much
sharper filter than "is this a reasonable improvement." Improvements are
infinite. Outcomes are not.
A short checklist
- [ ] One-line mission written, plus what not to redo
- [ ] Hard constraints listed (fail-closed) and separated from soft signals
- [ ] Smallest useful step identified; uncertain steps made smaller, not skipped
- [ ] Running log updated after each meaningful step
- [ ] "Done" defined; early-stop trip-wires defined
- [ ] Verification treated as separate work from execution
- [ ] No new abstraction without two or three real uses
- [ ] Mission traces to a real economic or operational outcome
A note on where this comes from
I run a project called Revenue Operator, and I built the operating structure
above into a small reference kit: The Revenue-First Autonomous Execution Kit.
It is a single Markdown file — the loop I run each session, the hard-constraints
vs soft-signals model with worked examples, an evidence hierarchy, three reusable
long-horizon prompt templates, a truthfulness checklist, and six real anonymised
examples from an actual build (including a wedge that failed three times before it
worked, and a metric that silently counted the wrong thing).
It is $19, one file, instant download, 30-day refund:
https://aiops7.gumroad.com/l/revfirst-exec-kit
To be transparent: it is my product and I sell it. It describes a working method.
It does not promise a financial outcome and makes no claims about your results.
The checklist above is the useful core and stands on its own whether or not you
ever look at the kit.
If you run long autonomous sessions: which of these failure modes do you hit most
— drift, repeated work, scope creep, stalling, or unsupported claims? I would
genuinely like to know which one is worst in practice.
Top comments (0)