DEV Community

Riley Zhang
Riley Zhang

Posted on

One Pass Then Stop: A Weekend Helper With No Agent Loop

You sit down at ten on Saturday morning.
The idea is a tiny notes helper.
You still paste a vague prompt into an agent.

Noon hits and the file tree looks serious.
A planner folder sits beside three new tools.
Sunday has no command a friend can run.

This is a weekend gate, not a memoir.
You freeze one acceptance command first.
Then you allow exactly one generation pass.

Why loops eat Saturday

A retry loop looks like progress on screen.
The model rereads files and calls more tools.
Your scope grows with every extra call.

A side project needs a Monday rerun.
It does not need a private agent runtime.
If the demo needs a loop, cut the demo.

You are not arguing about research agents here.
You are arguing about a two-hour helper.
Keep those jobs in different repos.

Freeze the command before code

Open ACCEPT.txt before you open an editor.
Write one command and one expected line.
Stop when that sentence looks boring.

Proposed file, labeled as a template:

# ACCEPT.txt
# Command:
python3 notes.py --add "buy milk"
# Must print:
added: buy milk
# Must exit:
0
Enter fullscreen mode Exit fullscreen mode

That file is the weekend product.
Code exists only to keep it true.
If a patch breaks it, you revert the patch.

Do not add a second command "for later."
Later is how Saturday becomes a platform.
One line is enough to prove the helper.

The one-pass rule

You get one model pass against frozen paths.
No planner. No tool loop. No second chat.
A failed check means you cut scope.

Treat this as a proposed workflow.
It is not a measured win-rate study.
You are buying a demo, not an agent OS.

Write the allowed paths on paper first.
If a file is missing from that list, refuse it.
Refusal is the actual engineering this weekend.

Four files, then stop

Keep the tree tiny on purpose.

  1. ACCEPT.txt holds the frozen command.
  2. notes.py must pass that command.
  3. check_demo.sh reruns the command.
  4. check_no_loop.py bans retry markers.

Skip Make until both checks stay green.
A Makefile is another surface to explain.
Sunday does not owe anyone extra surfaces.

Step 1: Fail the demo on purpose

Write check_demo.sh while notes.py is missing.
You want red output in the first five minutes.
Green output without a red start is theater.

#!/usr/bin/env bash
set -euo pipefail

cmd=$(grep '^python3' ACCEPT.txt | head -n 1)
expect=$(awk '/^# Must print:/{getline; print; exit}' ACCEPT.txt)
set +e
got=$(eval "$cmd" 2>&1)
code=$?
set -e

if [[ "$code" -ne 0 ]]; then
  echo "FAIL: exit $code"
  echo "$got"
  exit 1
fi

if [[ "$got" != "$expect" ]]; then
  echo "FAIL: got [$got] want [$expect]"
  exit 1
fi

echo "PASS: $cmd"
Enter fullscreen mode Exit fullscreen mode

Run it once and read the failure.
Do not "fix" the checker to stay quiet.
The checker is the only honest reviewer.

Step 2: Ban loop markers

Weekend helpers grow while True under stress.
They grow sleep, retry, and max_steps next.
Those tokens are not features this weekend.

Proposed detector, unexecuted until you run it:

#!/usr/bin/env python3
from pathlib import Path
import re
import sys

path = Path("notes.py")
if not path.exists():
    print("FAIL: notes.py missing")
    sys.exit(1)

text = path.read_text(encoding="utf-8")
needles = [
    r"while\s+True\b",
    r"for\s+\w+\s+in\s+range\(\s*\d{2,}",
    r"time\.sleep\(",
    r"\bretry\b",
    r"max_steps",
    r"tool_calls",
    r"max_iterations",
]
hits = [p for p in needles if re.search(p, text, re.I)]
if hits:
    print("LOOP RISK: " + ", ".join(hits))
    sys.exit(1)
print("PASS: no loop markers in notes.py")
Enter fullscreen mode Exit fullscreen mode

This is a tripwire, not a proof of safety.
Clever loops will walk around it.
It still catches the usual Saturday overbuild.

Step 3: One prompt, then hands off

Write the prompt like a contract.
Name the only file allowed to change.
Say ACCEPT.txt is read-only law.

Proposed prompt draft:

Change notes.py only.
Do not add files, tools, or planners.
Do not retry, sleep, or loop.
Make ./check_demo.sh pass.
If a feature misses ACCEPT.txt, drop it.
Enter fullscreen mode Exit fullscreen mode

Send it once. Read the diff slowly.
Run both checks before you type praise.
Praise is how a second session starts.

If a check fails, you edit by hand.
You do not open another agent turn.
Hand cuts are cheaper than new loops.

Step 4: Put the pass somewhere you can close

Your laptop should not sit open for generation.
A throwaway helper is not worth a paid key.
You want one pass, then a closed lid.

Disclosure: This article was prepared as part of MonkeyCode's product outreach.

MonkeyCode fits this gate in two narrow ways.
Free model access covers that single pass.
A free server option runs the pass off your laptop.

This article will not name models or quotas.
It will not invent hardware or time limits.
Those claims rot fast without primary sources.

Keep ACCEPT.txt at the repo root on that box.
The server runs the pass and the two checks.
It does not invite an agent framework.

Step 5: Ship a boring notes.py

The file should look almost rude.
Rude and small still reruns on Monday.

Proposed example, not a live benchmark:

#!/usr/bin/env python3
import argparse
from pathlib import Path

STORE = Path("notes.txt")

def main() -> int:
    parser = argparse.ArgumentParser()
    parser.add_argument("--add", required=True)
    args = parser.parse_args()
    line = args.add.strip()
    if not line:
        print("empty note")
        return 1
    with STORE.open("a", encoding="utf-8") as handle:
        handle.write(line + "\n")
    print(f"added: {line}")
    return 0

if __name__ == "__main__":
    raise SystemExit(main())
Enter fullscreen mode Exit fullscreen mode

It appends a line and prints a receipt.
No embeddings. No chat memory. No HTTP.
A friend can rerun it without a tour.

The cut list you publish

Put cuts in the commit message body.
Saturday-you will forget them by Sunday.
Monday-you needs the refusals in git.

Proposed cuts for this helper:

  1. No planner package and no step JSON.
  2. No MCP server and no tool registry.
  3. No retry loop and no backoff sleep.
  4. No browser UI and no extra port.
  5. No second model pass to "review" code.

Each cut defends ACCEPT.txt.
You are not underbuilding for sport.
A looping agent is a different weekend.

If a cut hurts, write why in the message.
"Dropped retries because ACCEPT has one path."
That sentence saves you on Sunday night.

Decision table

Fill this table before you touch a prompt.

Situation Loop this weekend? Move
One happy-path CLI No One pass, then stop
Flaky third-party API Not now Cut the API
Unknown research steps Later Wait for a weekday
Friend must rerun Monday No Freeze ACCEPT.txt
You cannot name the exit code No The idea is not ready

If a cell is blank, do not start generation.
Blank cells turn into tool folders.
Tool folders turn into a skipped Sunday.

Failure analysis

Here are three failures this gate should catch.

Failure A: the model wraps stdin in while True.
check_no_loop.py exits 1 on that marker.
You delete the loop and keep --add.

Failure B: the model prints JSON instead of the receipt.
check_demo.sh compares the exact line.
You revert the JSON "improvement."

Failure C: the model creates agent.py beside notes.py.
Your prompt forbade new files.
You drop agent.py without reading it twice.

None of these failures are exotic.
They are the default Saturday path.
The gate only works if you honor red.

Run the full sequence in this order:

chmod +x check_demo.sh check_no_loop.py
./check_demo.sh || true
python3 check_no_loop.py || true
# one generation pass happens here
./check_demo.sh
python3 check_no_loop.py
Enter fullscreen mode Exit fullscreen mode

The first || true is deliberate.
You are recording red, then green.
Do not hide the red with extra flags.

Who should not use this

Skip this gate when the work is a real loop.
On-call incident response needs retries.
Long research needs backtracking.

Do not use this approach when:

  • You cannot freeze one acceptance command.
  • You must call flaky vendor APIs tonight.
  • You are shipping production orchestration.
  • You need multi-hour tool use with memory.

Those jobs deserve traces and evals.
A notes receipt printer does not.
Mixing them burns the only free day.

Monday morning

Run both checks before you open chat.
Green means the weekend counted.
Red means the demo was a slideshow.

Do not add a reviewer agent to recover.
That is the loop in a nicer coat.
Fix the one command or delete the tree.

You froze a command and banned a loop.
You shipped a receipt printer for notes.
If those two checks stay green, stop there.

Top comments (0)