Skip to content
← ALL FIELD NOTES

MIKE & SPECTER / FIELD NOTE 05

CAN WE REASON ONCE
AND REUSE THE WORK?

When does a reusable script earn back the cost of writing it? Count accepted runs, failed attempts and the work still running after the conversation ends.

RESEARCH NOTE 05LLM & local resource efficiencyFourth research area / ongoing experimentsv2 · 12 MIN READ
DOCUMENTED TODAY

Declared project-script execution, local resource readings, Resource Guardian and branch/worktree hygiene have documented implementations and limits. A richer indexed, versioned library of model-generated scripts is an experimental direction we are testing.

WORKING HYPOTHESIS

Letting a model retrieve and execute a suitable reviewed script may avoid repeated code generation and reduce cost per accepted operation—if discovery, versioning, verification and machine cleanup remain dependable.

What has almost a year of agentic development made us notice?

The token counter stops when the answer arrives. The preview server can keep running all weekend. Across close to a year of agentic development we saw disk use grow and encountered spikes in memory, CPU and disk activity as projects accumulated. A process left behind after a task was one cause. To understand the cost of an operation, we had to follow it past the final model response.

In our own project work, providing a more direct route to repeatable tool execution has appeared to make a meaningful difference to token consumption. We have also observed a more manageable local resource footprint as we introduced monitoring and housekeeping. These are observations from our development practice, not a published controlled benchmark or a promised savings rate for another team.

Our partners ask about these costs often. As the number of agent-developed projects grows, the question is no longer limited to the model invoice. It includes storage, concurrent builds, leftover processes and the time an operator spends getting a machine usable again. We want to investigate those costs together.

This is our fourth research area: how do we use large models where their judgement helps, while moving suitable repeatable work into dependable execution paths? It connects to the other notes on accounting, workspace distribution and complete workflows, but asks a different question about efficiency.

When should the model reach for a script instead of writing it again?

One mechanism we are building and testing is a library of reusable scripts that a model can help create. A script may support a playbook step or be useful on its own when the agent recognises a recurring operation. The intended sequence is to find a suitable implementation, check its fit and version, execute it and inspect the result.

The model still has work to do. It must understand the request, choose an appropriate capability and interpret uncertainty or failure. The experiment removes unnecessary repeated implementation; it does not assume every task can become a canned command.

When the requirements change, an existing script may need a new version. We want that change to remain inspectable: why v1 no longer fits, what v2 changes, what was tested and which workflows still depend on the older behaviour. A model that silently changes the meaning of a widely used script has moved the risk rather than reduced the cost.

The reviewed A77 code already contains declared project-script execution from committed package scripts and Make targets, with checks against a changed working copy and the relevant permission policy. That is a concrete foundation. It does not prove that the full generated-script catalogue, semantic index and automatic lifecycle management described here are complete.

What would the two paths look like?

The first scenario illustrates the model choosing and reusing a candidate script. The second illustrates an accepted assignment being settled, an eligible owned helper being stopped and a worktree becoming releasable after its checks. Both show our intended reasoning, not activity running against your computer.

ILLUSTRATIVE ANIMATION / NOT A LIVE RUN

When the agent reaches for a script.

01 / 05
INSPECT-STATUS @ v1Task recognised
MODEL ROLEUnderstand the goal

Identify the task

RESEARCH PILOT
What is the basis?

The agent recognises a recurring operation rather than starting a fresh implementation.

What are we testing?

Can it detect a suitable repeat without forcing a novel task into an old script?

Illustrative task: inspect a deployment state. This animation makes no provider calls.

THE SCRIPT LIBRARY IS AN EXPERIMENT. RESOURCE AND WORKTREE TOOLS HAVE DOCUMENTED, SCOPED RULES; THE ANIMATION DOES NOT RUN THEM.

Notice the boundary in the housekeeping scenario: the example starts with accepted, integrated work. Confirming that integration is different from deciding to merge unfinished changes. A folder can also stay in use after a task is accepted. The process has to establish both the state of the work and the state of the resources before it releases anything.

Does a script library become another thing we have to maintain?

Yes, and that is a central part of the research. A directory full of useful-looking files is not enough. The agent needs a way to discover a script by its purpose, inputs, outputs, environment, side effects, permissions and known limits. It should not have to load the entire library into the model context to find one operation.

Versioning must also reach the caller. A playbook that depends on one behaviour should not silently inherit another because the script changed. We would like execution records to identify the script version, relevant parameters, outcome and acceptance evidence, while keeping secrets and unnecessary output out of the record.

Usage can inform maintenance, but popularity is not proof of correctness and rare use is not proof that a script is disposable. A recovery routine may be important precisely because it is seldom needed. Before retirement, we need to inspect dependencies, pinned procedures, replacement coverage and the ability to recover an older version.

We are considering periodic library review, including model-assisted analysis where judgement is useful. The review itself has a cost. Deterministic checks can identify missing metadata, duplicate signatures or stale references; a model may help investigate ambiguous overlap or propose a consolidation. Neither should casually delete the only implementation of a rare but important operation.

These are design and evaluation questions. We do not present automatic indexing, pruning or safe self-maintenance as solved merely because the agent can generate a script.

Why does the local machine belong in the same conversation?

A cheaper model interaction can still leave an expensive system behind. More projects mean more worktrees, repeated dependency installations, caches, preview servers and build processes. Some are useful. Some belong to work that ended. Others are waiting, stuck or simply competing for memory.

We have encountered disk growth and sudden pressure on memory, CPU and disk access in our own development. The causes were not identical: helpers left running, workspaces not released, overlapping heavy checks and unfinished process lifecycles all contributed. Low instantaneous CPU does not reliably distinguish a harmless idle process from work starved by memory or I/O.

A77’s documented local tools show CPU, memory and disk use and attribute relevant work to processes and projects, with platform limits. Resource Guardian and branch/worktree hygiene provide scoped ways to inspect and release eligible resources. Later resource-guard work also describes heavier-job admission and overload handling; its verification record has its own limitations. We should not turn that into a claim of identical behaviour on every operating system.

One particularly useful lesson was that the monitor itself could become part of the problem. Our resource-guardian work records repeated disk-size scans being serialised, lowered in priority and cached instead of launched across folders at once. Monitoring is work too. A machine is not improved by an agent continually rediscovering how overloaded it is.

Can an agent close finished work without losing unfinished work?

We treat conversation closure, acceptance, code integration, process termination and directory removal as separate state changes. The current worktree settlement catalogue describes waiting to release a folder even after its code is integrated. It checks whether a process, thread or local change still holds the worktree, and retains a record so a restart can continue.

The cleanup guide likewise distinguishes merged work from unmerged or changed work. An unmerged branch is not disposable because it has been quiet. A dirty worktree must retain its changes. Scheduled rules and previews are useful precisely because they make these boundaries repeatable without asking a model to improvise a cleanup policy every time.

Process ownership matters as well. The documented idle-process path concerns eligible helpers A77 started; it does not give an agent a blanket licence to stop the person’s applications. Different paths require a click or an explicit rule. A reused cleanup script must preserve those limits, not bypass them.

The question we are testing is whether these small, dependable routines can make resource release a normal part of completing work. “Task done” should lead to checking what must remain and what can be released, rather than leaving every terminal, helper and worktree behind as a souvenir.

What would count as a real efficiency improvement?

When does reuse pay for itself? Take an illustrative routine. Suppose authoring and checking the first script costs 60 units. On comparable accepted runs, generation costs eight units and reuse costs two, including lookup and verification. Ten reuses recover the initial 60. If a dependency change costs another 24 to repair, break-even moves to fourteen. Those units could be money at fixed rates; mixing tokens with operator minutes would make the arithmetic meaningless. Keep latency, peak memory and disk retained after closure alongside the calculation. A seldom-used script can stay below break-even for its entire life.

We need repeated rounds on representative operations. A first run that writes and tests a reusable script may cost more than a one-off solution. The hypothesis becomes interesting when later accepted runs reuse that work. The comparison has to include the initial investment and the cost of keeping the script useful.

A useful unit is cost per accepted operation over a stated period, rather than tokens per successful-looking call. We would compare equivalent tasks with equivalent acceptance criteria, retain the environment and model versions, and show missing measurements as unknown. A result that consumes fewer tokens but fails more often is not automatically an improvement.

Reclaiming disk space also needs context. Removing a cache can free space now and require rebuilding it later. We want to examine the net effect across the project lifecycle, not only photograph a smaller folder after cleanup. The same applies to stopping a helper that immediately has to be restarted.

We have not published a controlled aggregate savings figure in this note. Our positive field observations justify further rounds; they do not remove the need to measure where the gains hold and where maintenance or recovery eats them.

Where should the model spend its attention next?

Our working answer is to spend judgement on the uncertain part: deciding whether a known routine fits, interpreting an exception, designing a new version or improving the process. Repeated execution with unchanged conditions is a candidate for a script. Repeated inspection with fixed rules is a candidate for a deterministic monitor. Neither removes the need for evidence and authority.

We would change the approach if discovery costs swallowed the expected savings, if the library accumulated unsafe assumptions, or if resource housekeeping repeatedly interrupted useful work. We would keep expanding it where reuse produced accepted results and resource release remained predictable.

We want to discuss this openly with the developers and partners facing the same pressures. Which operations are you asking a model to reconstruct every day? Which reusable routines genuinely saved work? Which “optimisation” simply moved the cost into a different process?

Mike would like the laptop back. Specter would like credit for not writing the same script for the forty-seventh time. We are trying to measure both requests responsibly.

EVIDENCE & REVISION RECORD

What is this note based on?

Combines the owner’s qualitative observations with current code and documentation reviewed on 26 November 2026. Reusable-library lifecycle mechanisms remain experimental. The animation is illustrative; no local cleanup, script execution or benchmark was performed by this page.

Product documentation is the baseline for implementation claims; the proposed studies are not completed experiments.

v2 / 26 November 2026

Adds a worked break-even calculation and accounts for maintaining a reused script.

v1 / 26 November 2026

Initial investigation, documented baseline and proposed tests.