Heuristic
Turn stable repeated tool sequences into scripts
Do not pay a language model to rediscover a deterministic macro on every run.
When it fits
- An AI agent repeatedly performs the same browser, CLI or data-manipulation sequence with little judgment.
When to avoid it
- Do not automate an unstable process merely because it is repetitive; first understand authority, error handling and rollback.
Why it matters
Once a repeated sequence is understood and the inputs and failures are known, encode the deterministic portion as a script or task-shaped tool. Let the model decide when to use it and interpret exceptions, while the script handles the repeatable mechanics. Add logging and idempotence or dry-run behavior when repeated execution could create side effects.
An example
Instead of having an agent manually transform the same export columns every week, generate a tested transformation script and let the agent handle only exceptions and interpretation.
Check your result
The repeated sequence becomes faster, cheaper and more reproducible without hiding important decisions.
Keep this limit in mind
- Do not automate an unstable process merely because it is repetitive; first understand authority, error handling and rollback.
Connected ideas
Useful withPrefer a task-shaped tool to an open-ended one
Evidence and sources
Current agent-engineering practice recommends moving repeatable deterministic operations into scripts or tools while reserving model judgment for ambiguous decisions.
Do not automate a process before its inputs, errors and authority boundaries are understood.
Build Systems, Not Code · Assign determinism, judgment and authority; reusable scripts