Why AI coding gets worse as your app grows.

In the first week the AI built whole screens from a sentence. Now a request to move one button takes four tries, and the answer sometimes changes a screen you never mentioned. You are using the same tool as before, and the code it has to read has grown larger and less tidy. This page explains why that matters, and shows how to organize the code so the AI can keep working as the app gets bigger.

Why the first week felt easy and this week does not

On day one your app was a few files. The AI could read all of them in a moment, so every request landed in the right place. Founders often read that early speed as a measure of the tool, when it was mostly a measure of how little there was to read.

Months later the app has dozens of screens, and the requests that used to take one message now take an evening. The slowdown tends to arrive gradually, which makes it hard to name. You may notice that a change shows up on one screen and is missing from another, that the AI builds something the app already has, or that you have started writing longer and longer messages to explain where things are.

None of this means you chose the wrong tool or that the app is beyond saving. In the apps we see, the cause is usually how the code is arranged, and arrangement can be changed without rewriting the product.

The AI does not remember your app. It reads the files again each chat

An AI coding tool commonly starts each new chat knowing nothing about your project. It finds out by opening files and reading them, and it can only hold so much at once. In a tidy project it opens the two files that matter and gets to work. In a disorganized project it is searching a junk drawer: it opens whatever looks close, guesses at the rest, and writes code based on the part it happened to see.

Duplicates are where this hurts most. Say the same Save button was written three separate times, once for each screen that needed it. You ask for the button to turn green. The AI finds one copy, changes it, and reports success. The other two copies never change. From your side the fix worked on one screen and failed on two, and that is why fixes seem to work about half the time.

The opposite arrangement has its own cost. When everything sits in one giant file, nothing is ever lost, and nothing is easy to find either. The AI has to read thousands of lines to locate the twenty that matter, and the longer the file, the more likely it edits a similar-looking part by mistake.

The sign, what it means, and what to ask for

Each symptom below points to a specific arrangement problem, and each has a request you can type into the tool today. Ask for one row at a time and look at the app after each, for the reasons covered in the clean-up section further down.

Common signs that the code has outgrown its arrangement, and the request that addresses each

The sign
A change appears on one screen and is missing on others
What it means
The same piece was written more than once, and only one copy was edited
What to ask for
Find every copy of this piece, keep one in the shared folder, and make every screen use that one
The sign
The AI builds something the app already has
What it means
It could not find the existing version, so it wrote a new one
What to ask for
Before writing anything, search the project for something that already does this and tell me what you found
The sign
You have to say which file to edit in every message
What it means
File and folder names do not say what is inside them
What to ask for
Rename these files so the name says which screen or job each one holds, and change nothing else
The sign
One file is so long the AI edits the wrong part of it
What it means
Several jobs are packed into a single file
What to ask for
Split this file so each new file does one job, without changing what the app does
The sign
Saving works on one screen and fails on another
What it means
Each screen talks to the database in its own way
What to ask for
Move the code that saves and loads this kind of record into one file in the data folder, and have both screens use it
The sign
The AI's summary of the app differs each time you ask
What it means
There is no written description of the layout for it to start from
What to ask for
Write a short description of each folder into the rules file, then read it back to me

The cure is labelled drawers: three folders

A kitchen works because the cutlery has a drawer and everyone knows which one. Code works the same way for an AI that has to find things from scratch every chat. Most small apps need only three labelled folders to get there.

The first folder holds screens, with one file per screen. If your app has a sign-in screen, a dashboard and a settings page, that folder has three files with those names. When you say 'change the dashboard', there is exactly one place to look.

The second folder holds shared pieces: anything used on more than one screen, such as a button, a page header or a pop-up. The rule for this folder is one copy, used everywhere. Change the button there and every screen that uses it changes with it, which removes the half-working fix described above.

The third folder holds the code that saves and loads data. Screens ask this folder for 'the customer's orders' and do not talk to the database themselves. When something saves wrongly, the fault is in a known place. The folder names matter less than the split; your tool may already have its own names for these, and it is fine to keep them.

Give the AI standing rules, and save them where it reads them

Folders drift unless something keeps them in order. Since the AI starts each chat fresh, telling it your preferences once in conversation does not last. Most AI coding tools read a rules file kept inside the project at the start of every chat. CLAUDE.md and AGENTS.md are two common names for such a file, and your tool's help pages will say which name it looks for.

Put your standing rules in that file on day one if you can, and today if day one has passed. Four rules do most of the work: keep the app readable by a beginner, give each file one job, keep files short, and check whether something exists before writing it again. The block below is a starting set you can paste and adjust. Change the folder names to match your project.

After you save the file, open a new chat and ask the AI what rules it is working under. If it cannot repeat them back, the file is in the wrong place or has the wrong name, and that is worth settling before you rely on it.

  • This app is maintained by a founder who is new to code. Write code a beginner can follow, and prefer the plain way over the clever way.
  • Every file does one job. If a file starts doing a second job, split it and tell me.
  • Keep files short. When a file grows past what fits comfortably on a few screens, propose a split before adding more to it.
  • Before you write a new button, form, pop-up or helper, search the project for one that already exists. Reuse it, or tell me why it does not fit.
  • Each screen lives in its own file in the screens folder. Pieces used on two or more screens live in the shared folder, with a single copy.
  • Screens never read or write the database directly. They call the files in the data folder.
  • When I ask for a change, change only what I asked for. List anything else you think needs attention and wait for my answer.
  • At the end of each change, tell me in plain words which files you touched and why.

If the app is already a mess: clean one folder at a time

Reorganizing is the one kind of request where the AI touches many files at once, so it needs more care than a normal change. Start by making a save point with Git, the standard tool for recording versions of code. Many builders make these for you or offer a button for it; if yours does not, ask the AI to walk you through making a commit. A save point means any step below can be undone in full.

Then ask for one folder cleaned at a time, and say the sentence that matters most: do not change what the app does. A good first request is to gather the screens into one folder with one file each. A good second is to find duplicated pieces and replace them with a single shared copy. Moving the save-and-load code usually goes last, because more of the app depends on it.

After each step, click through the app yourself. Open every screen, press the main buttons, save a record and load it back. If everything behaves as before, make another save point and name it after the step you finished. If something broke, go back to the previous save point and ask for a smaller version of the same step. Our guide on fixes that break other things covers the save-and-check habit in more detail.

Resist asking for the whole clean-up in one message. A single huge reorganization that goes wrong leaves you unable to tell which of fifty moved files caused the fault, and you end up restoring the lot.

A tangled app, sorted over four sittings

Ask the AI to explain your folders in plain words

You do not need to read code to know your way around your own app, and knowing your way around makes every later request shorter. Ask the AI to explain the folders in plain words: what each one is for, which files sit in it, and what would break if a given file were deleted. Ask it to avoid jargon and to define any term it cannot avoid.

Read the answer with the app open beside you. If a folder's description matches what you see on screen, good. If the AI describes two files that seem to do the same job, or cannot say what a file is for, write that down. Those are the places where duplicates and leftovers live, and they make a ready list for the next clean-up step.

Ask for the explanation to be saved into the rules file as a short map of the project. The next chat then starts with a description of where things are instead of working it out again, and you have a page you can hand to anyone who helps you later.

When to keep going alone and when to get help

Keep going alone while each clean-up step leaves the app working and the AI's requests are getting shorter. That combination means the arrangement is improving, and many founders get the whole way with the steps on this page.

Get help when a step keeps breaking the app however small you make it, when the AI cannot give a steady account of how saving and loading works, or when the mess sits in sign-in, payments or customer records, where a mistake during reorganizing costs more than a missing button colour. It is also reasonable to ask for help simply because the clean-up is taking time you would sooner spend on customers.

We do this work for founders. Our Diagnostic is a fixed-price written plan: we read the code, describe how it is arranged now, say which parts can stay as they are and which should be regrouped, and set out the order to do it in, with the fee credited to the build if you go ahead with us. The work is done in your project, and your repo and accounts stay yours.

Before you ask for the next feature

These are the things that keep a growing app easy for the AI to work in. Each one can be checked in a few minutes.

  1. A rules file in the project, and a new chat in which the AI repeated the rules back to you.
  2. A folder of screens with one file per screen, named after the screen.
  3. A folder of shared pieces, with no second copy of any of them elsewhere.
  4. A folder for the code that saves and loads data, used by every screen.
  5. A Git save point made after the last step that left the app working.
  6. A plain-words map of the folders, saved in the rules file.
How we can help

We can sort the code so the AI can keep building.

Book a free consultation and tell us what the AI has started getting wrong and how big the app is now. We will say whether the folder clean-up on this page is likely to be enough or whether the Diagnostic should come first. If we do the work, we regroup the code in your repository, write the rules file and the folder map with you, and hand back a project you and your AI tool can both find your way around.

Book a free consultation

On the project call, we’ll discuss the problem, your existing tools and what TDAT should take off your hands. Then we can define the scope and next steps.

Or call (919) 289-1231

Questions before we start

Why does AI coding get worse as my app gets bigger?

The AI commonly starts each chat without any memory of your project and learns it by reading files. A small app can be read in full. A large, disorganized one cannot, so the AI works from the part it found, misses duplicates and edits the wrong place. Arranging the code into clearly named folders gives it less to search.

Why do the AI's fixes only work some of the time?

A frequent cause is that the same piece, such as a button or a form, was written several times. The AI changes the copy it finds and the others stay as they were. Keeping one shared copy that every screen uses means a single change shows up everywhere.

What is a rules file?

It is a plain text file kept in your project that the AI coding tool reads at the start of each chat. You write your standing instructions in it once. CLAUDE.md and AGENTS.md are two common names; check your tool's help pages for the name and location it expects.

Will reorganizing the code break my app?

It can, which is why the order matters. Make a Git save point first, ask for one folder at a time with the instruction to leave behaviour unchanged, click through the app after each step, and save again when it works. If a step breaks something, you go back one save point and lose only that step.

Should I start over with a clean project instead?

Usually there is no need. Arrangement can be changed while the screens, wording and data stay. Starting over throws away parts that work. If a clean-up keeps failing in one area, have someone read the code before you decide, because the trouble may sit in that one area only.

I cannot read code. Can I still do this?

Yes. The requests on this page are written in plain language, and the checks are things you do in the running app. Ask the AI to explain each folder in plain words and to tell you which files it touched after every change. You are judging whether the app still behaves the same, which needs no code reading.