Using Claude Code to Refactor Ugly FileMaker Scripts Without Breaking Production

Using Claude Code to Refactor Ugly FileMaker Scripts Without Breaking Production

The Script That Everyone Is Afraid To Touch

You have a FileMaker script that works.

You know it works because production is still running. But you also know there are parts of it that make you nervous.

A variable name that only makes sense because of a decision made years ago. A long chain of If statements that nobody wants to modify. A section of logic that depends on something happening earlier in the script.

It works, but it is fragile.

That is usually the script that needs attention.

Don’t Start By Asking AI To Rewrite It

The first mistake is giving an AI tool a large script and saying:

“Clean this up.”

A working script contains more than steps. It contains years of business decisions and assumptions.

Before changing anything, you need to understand what the script is actually doing.

Give Claude The Logic, Not The Screenshot

Claude Code cannot understand the intention behind a layout screenshot.

It needs the actual script.

Give it:

  • Script steps.
  • If and Else conditions.
  • Set Variable chains.
  • Loops.
  • Error handling.
  • Comments and notes.

The goal is to show the decisions inside the script, not just what the user sees.

Find The Risk Before Improving The Style

Before asking for a refactor, ask questions like:

  • Where are the hidden assumptions?
  • What happens if the found set is empty?
  • What happens if a variable is missing?
  • Which parts depend on another script running first?
  • Where could this fail silently?

Many scripts that look messy are not just style problems.

They are logic problems hiding underneath.

Refactor One Section At A Time

Avoid rewriting the entire script in one go.

Large refactors create large risks.

A script that handles seven different tasks has seven places where something can change unexpectedly.

Instead:

  • Pick the worst section.
  • Refactor that section.
  • Test it in a development copy.
  • Compare the results.
  • Move to the next section.

Small improvements are easier to verify.

The Goal Is Not Just Cleaner Scripts

A good refactor is not about making the script look nicer.

It should make the system:

  • Easier for another developer to understand.
  • Safer to modify.
  • Easier to troubleshoot.
  • Ready for future business changes.

The script you improve today is the one someone else may need to extend six months from now.

AI Is A Partner, Not A Replacement For Judgment

Claude Code can be a powerful assistant for FileMaker development.

But like any good developer, it needs context.

Give it enough information to understand the system, and give yourself enough discipline to review every change.

The most dangerous refactors are not the ones that fail immediately.

They are the ones that work, but quietly change something nobody tested.

Recent comments

No comments yet.

Get in touch

Comments are reviewed before they appear.