The language model reads tokens and produces tokens. It does not run a test or edit a file by itself. Software around the model, called the harness, reads a requested tool call, runs it, and gives the result back to the model.
That cycle turns one prediction into a worker: ask, act, inspect the result, and decide what comes next. The context grows on every lap because the tool call and its result both become more tokens.
See the loop as code
context = [system_prompt, tools_schema, user_request]
while True:
output = model(context) # one forward pass per token
if output.is_answer:
return output # the model chose to stop
result = execute(output.tool_call)
context += [output, result] # both are tokens
Watch the result return to context each time. Track the meter until the model chooses an answer.
Put verification inside the loop. An agent that tests after each edit gets useful feedback on the next lap. Waiting until five files have changed makes the next step sort through several guesses at once.
Give the loop a stop condition and a budget. Without them, a model can keep finding one more check to run.
Loops that outlive the session
A scheduled loop starts with a fresh context on each run. It remembers last night only if it wrote useful state to a file and reads that file when it wakes. The harness owns the schedule; the file carries the history.
Match the check rate to the signal. Polling every minute for a change that happens daily spends tokens on repeated "nothing changed" results. Use an event trigger when the system can provide one.
Skills: procedure as files
Teams repeat procedures: how to deploy, how to run a difficult test suite, or how to handle an incident. Putting every procedure in every prompt wastes context on instructions the current task does not need.
A skill stores one procedure in a named file. The model always sees a short description, then loads the full instructions only when the task matches. Forty short descriptions can replace forty full procedures in the starting context.
Notice what stays small before the match, then watch one full procedure enter the context.
A skill lives in a repository, so a team can review, version, and change it without retraining the model. The next matching run reads the new file.
Keep instructions in the right place. The request states today's job. Memory stores durable facts. A skill stores a reusable procedure.
Try the decision
Choose where each instruction belongs, then check the reveal.
Loops and skills compose
A recurring agent combines a schedule with a skill. The schedule says when to run. The skill says which files to check, what counts as urgent, and what state to save for the next run.
Working defaults
- Create a skill when the same procedure appears a second time.
- Write a clear description so the model knows when to load it.
- Give every loop a budget, a stop condition, and a check inside the lap.
- For recurring work, decide what the loop must save for its next run.
- The harness runs tools; the model chooses the next token or tool call.
- Each lap grows the context, so verification and stopping rules control cost.
- Skills keep reusable procedures out of unrelated requests.