Saturday Shortcuts: Save the Script Your AI Agent Keeps Rewriting (Mine Wrote One Asana Call 85 Different Ways)

AI agent helper scripts: dozens of near-identical frosted glass blocks scattered on a workbench, one amber block saved in a glass holder under a spotlight

This week’s shortcut sounds too obvious to bother with: when your AI agent writes the same little script twice, save it as a tool and make the agent use that.

AI agent helper scripts are the small, boring pieces your agents need every day: “create a task,” “add a row,” “publish a post.” If you don’t give your agent a saved version, it writes a fresh one every run. Each copy works, and each one is slightly different from the last.

I run a fleet of scheduled agents that write, post, check email and do outreach for this site. Each run gets a scratch folder for whatever code it needs that day. This morning (28 November 2026) I opened those folders and counted.

The receipt: 85 versions of one line

Since 23 October (the oldest scratch folder still on disk), my agents have created 357 scratch folders holding 1,660 throwaway scripts, about 36,000 lines. In 36 days.

Most of it is the same few jobs written over and over:

  • 207 scripts talk to Asana, my task board. 123 of them are literally named asana.py. The one line that actually sends the request exists in 85 different versions, written slightly differently each time.
  • 369 scripts talk to Airtable, where my queues live. That request line exists in 116 versions.
  • The ID numbers for my Asana project and its sections are typed into those scripts by hand 228 times.

None of this broke anything today. Every one of those scripts did its job. That’s why it’s easy to miss: the cost doesn’t show up as failures, it shows up as drift.

Jon Jones

⚡ GET THE AI EDGE

Weekly AI tips that actually save you time and money. No fluff, no hype — just what works.

Newsletter Signup - Blog CTA

Where rewriting actually bit me

Two of the bugs my agents logged this month came from a freshly rewritten helper, not from the task itself. One scraping script overwrote its own results file on every call, so a batch of research was lost and had to be fetched again. Another time, two halves of a checking job ran side by side and each one rewrote the whole shared results file, so the second one quietly erased the first. Each fix now lives as a note in my agent’s memory file, not inside a tool the next run will actually use.

The flip side is just as real. One of my shared tools, the image script, has a known bug: it sends a field name my Airtable table doesn’t have, so its logging step fails. My agents have noted that and logged the row by hand on several runs this month. That’s annoying, but it’s also the argument for sharing: a bug in one shared tool gets fixed once. A bug in 85 copies gets fixed never.

3 ways to stop the rewrite loop

  1. Promote the second copy. The first time your agent writes a helper, fine. The second time, save it somewhere permanent (a scripts/ folder, an n8n sub-workflow, a Zapier step you reuse) and add one line to the agent’s instructions: “To create a task, run scripts/asana.py. Don’t write your own.”
  2. Move the IDs out of the code. Project numbers, table IDs and list IDs go in one settings file or environment variable. When an ID changes, you change it in one place, not in 228.
  3. Put the hard-won fixes inside the tool, not in a note. “Don’t overwrite the results file” belongs in the code as a rule it can’t break. A lesson in your notes depends on the agent reading it; a fix in the tool works even when it doesn’t.

The honest part

I haven’t done this yet. My fleet still writes its Asana and Airtable helpers from scratch most mornings, including the one that published this post. Pulling the top few into shared tools is on my list, not done. I’m also not claiming the rewrites are expensive in dollars. I didn’t measure that. What I measured is drift: 85 ways to do one thing means 85 places a fix can miss.

Do this today

  • Open wherever your agents or automations keep their working files and look for the same filename or the same step showing up again and again.
  • Pick the most repeated one. Save a single good version and point your agent at it.
  • Move any IDs inside it into one settings file.

The takeaway: the second time your agent writes something, it’s not a script anymore. It’s a tool you haven’t saved yet.

If you want the Asana side of this, here’s what my agents actually do with the Asana API, and here’s how I run the whole fleet without an orchestration platform. If you’d like a setup where every agent uses the same tested tools, book a strategy session.

The AI Playbook — Free Download

📥 FREE: THE AI PLAYBOOK

The exact tools and workflows I use to run a one-person agency. 25 years of marketing experience distilled into an actionable guide. Yours free.

Lead Magnet - AI Playbook

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *