Back to blog

16 min read

Why AI Writes Better Code Than Copy: Your Work Needs a Repository

Ask an AI coding tool to "add a settings page" inside a real software project and something quietly impressive happens. Before it writes a line, it goes looking. It opens the existing pages, finds how buttons are styled, notices which naming conventions the team uses, reads the file that explains the project's rules, and only then writes code that looks like it belongs.

Ask a chat app to "write the next scene where Mara confronts her brother" and you get something fluent, generic and wrong. Mara sounds like every other fictional character. The brother has the wrong name. The prose has none of the rhythm of your first eleven chapters, because the AI has never seen them.

Same kind of model. Wildly different results. The difference is not intelligence. It is that the programmer's AI is working inside a repository, and yours is working in a blank room.

This article explains, from the ground up, why that matters: what is happening in the model, in the software wrapped around it, and in the text it actually reads. Once you see the mechanism, you can apply it to any kind of work, whatever tool you use.

Start with the human brain

Think about how an experienced professional actually produces good work.

A senior copywriter does not write a product launch email from pure talent. They remember the last three launches, which subject lines worked, how the brand talks, the phrases the founder hates. A novelist on book three keeps a series bible: character names, eye colors, the way one character never uses contractions. A researcher returning to a project rereads their own notes before writing a single new sentence.

Cognitive science has a useful frame for this. Your working memory, the part of your mind holding what you are thinking about right now, is small. Research going back decades suggests it holds only a handful of chunks at once. Experts are not experts because their working memory is bigger. They are experts because they have a huge store of long-term memory organized so that the right piece surfaces at the right moment. The classic studies of chess masters showed exactly this: masters could recall real game positions at a glance, but did no better than novices on randomly scattered pieces. Their advantage was a library of patterns, not raw capacity.

So good human work is roughly:

  1. A small, focused working memory,
  2. fed by a large personal archive,
  3. with a good habit of pulling the relevant parts of that archive in before starting.

Hold on to that shape. AI follows the same one, almost exactly.

What the model knows, and what it does not

A large language model (LLM) like Claude, GPT or Gemini is trained on an enormous amount of text. During training, patterns from that text are compressed into billions of numbers called weights. The weights are the model's long-term memory: grammar, facts, styles, how arguments are structured, how a Python function usually looks.

Two properties of the weights matter for everything that follows.

They are general. The model has read millions of marketing emails, so it knows what a marketing email is in the average sense. It has never read your marketing emails. It knows how fantasy novels tend to go. It does not know that in your novel, magic costs memories.

They are frozen. Nothing you type into a conversation changes the weights. The model does not "learn" your book by chatting with you, the way a colleague would. When the conversation ends, nothing carries over unless some software deliberately carries it over.

So where does anything specific to you come from? Only one place: the context window.

The context window is the model's working memory

Every time you send a message, the model receives a long stretch of text, measured in tokens (roughly, pieces of words). That text includes hidden instructions from the app, the conversation so far, any files or documents the app attached, and your new message. This bundle is the context. The model reads all of it, then predicts its reply one token at a time.

The context window is the model's working memory. It is much larger than a human's (modern models accept hundreds of thousands of tokens, the length of several novels), but it has the same essential role: it is the only place where your specifics exist for the model.

Here is the part most people miss. Models are remarkably good at in-context learning. Show a model a few examples of a pattern inside the context, and it will continue that pattern, with no retraining at all. This was one of the headline findings when GPT-3 was introduced in 2020, in a paper literally titled "Language Models are Few-Shot Learners." Give the model three examples of your product descriptions, and the fourth comes out in your voice. Give it two scenes of Mara's dialogue, and her third scene sounds like her.

Mechanically, this works through attention. As the model generates each new token, it looks back across the whole context and weighs which earlier tokens are most relevant to what comes next. If your context contains Mara saying "I'm not angry. I'm keeping score," then when the model writes Mara's next line, the attention mechanism can lean heavily on that line's rhythm, vocabulary and attitude. Examples in context act like a gravitational pull on the output.

This is why examples beat instructions. You can write "use a dry, understated tone" and the model will produce its average idea of dry and understated. Show it 800 words that are your dry, understated tone, and it produces something far closer, because it is pattern-matching against the real thing rather than interpreting an adjective.

The pantograph below makes the same point with a machine. Its linkage never changes, the way the model's weights never change. All that changes is what the stylus is given to trace.

Pen and its ink: the model’s outputTemplate: an example placed in contextRound guide: the average shape the model already knowsThe linkage is fixed, like a model’s weights: the pen always draws whatever the stylus traces, at 2:1. With no template, the stylus rides the round guide, whose radius is the reference’s average, and the pen draws a clean, generic circle about 5 px RMS off the faint target. Slide the template in and the stylus follows its groove; within one loop the error falls to zero. Nothing about the machine changed, only what it was given to trace.

But the context also has limits worth knowing:

  • It is finite. Even a very large window cannot hold everything you have ever made, and costs and response time grow with size.
  • Position matters. Research on long contexts (for example the 2023 study "Lost in the Middle") found that models use information at the beginning and end of a long context more reliably than material buried in the middle.
  • Noise dilutes signal. If the context is stuffed with loosely related material, attention spreads thin, and the useful examples pull less hard. More context is not automatically better context.

So the quality of the output depends heavily on a question the model cannot answer by itself: what goes into the context?

The harness decides what the model sees

The model on its own is a function: text in, text out. Everything else, including which text goes in, is decided by the software around it. Engineers call that software the harness.

A plain chat app is a minimal harness. It sends a system prompt, your conversation history and whatever you pasted. That is all.

A modern coding agent is a rich harness. When you give it a task, it runs a loop:

  1. Read the task.
  2. Search. It uses tools to list folders, search for keywords and open files across the project.
  3. Read what it found. Relevant files are pulled into the context.
  4. Read the rules. Many projects contain a file of conventions (often named something like AGENTS.md or CLAUDE.md) that the harness loads automatically: "we name things this way, never do that, test with this command."
  5. Act, writing code that now has dozens of real examples sitting in its working memory.
  6. Check and repeat, running the tests, reading the errors, adjusting.

Notice what the harness is doing. It is playing the role of the expert's habit from earlier: before starting, pull the relevant parts of the archive into working memory. The model supplies the intelligence. The harness supplies the memory retrieval. The codebase supplies the archive.

That combination is why AI coding has improved so dramatically in practice. The models got better, but a large share of the leap came from harnesses that let models go and read the project before they write.

Here is that loop as a bench instrument. The drawer is the project, the gripper is the harness, and the small holder is the context window. Leave it alone and it fetches what is relevant on its own; click a card to hand it a specific reference.

CONTEXT
Gripper: the harness, fetching from the projectTabbed cards: on-task for “write Mara’s next scene”Six-slot holder: the context window the model readsLeft alone, the gripper reads the room: it fetches the seven tabbed cards that matter for the task, one by one, which is ambient context. Click any card and it fetches that one next, which is pinpoint context. The holder has six slots, so a seventh card sends the oldest back to the drawer, the way a finite context window forces a choice. The dial reads the tokens in the holder against a 30k scale, and the readout counts how many of the cards in it are on-task.

Why the codebase is such a good archive

Software projects happen to be almost perfectly shaped for this.

  • Everything is in one place. A repository holds every file of the project in one folder tree.
  • It is plain text. The model can read all of it directly.
  • It is full of precedent. Need a new page? There are twenty existing pages to imitate. Need to handle an error? The project already handles errors in a particular way, dozens of times.
  • It is searchable. Names are consistent, so a search for "invoice" finds every relevant piece.
  • It compounds. Every feature that gets added becomes an example for the next one. Increasingly, a lot of that code was written by AI and then corrected by humans, so the archive steadily encodes the team's corrections.

That last point is the quiet superpower. A codebase is a record of every decision the team made about how things should be done. Each new AI task benefits from all of them, for free, because the harness can go and look.

Knowledge work has no repository

Now look at how most writing, marketing, research and strategy work is stored.

The brand voice lives in a PDF from two years ago. The best-performing emails are buried in an email tool. Chapter drafts are spread across three documents, one of them called "FINAL final v2". Research notes are in a notes app, sources in a browser bookmark folder, and the clever thing you figured out last Tuesday is in a chat thread you will never find again.

And when you open a chat app to get help, the AI starts from zero. It has its frozen, general knowledge and whatever you remember to paste in. Some apps add a "memory" feature, but that is usually a short list of facts about you, like "prefers British spelling", not your actual body of work. A list of facts about a writer is not the same as reading the writer.

So non-engineers end up doing the harness's job by hand: hunting for old examples, copying them in, re-explaining the project, every single time. Or, more often, they skip it, and conclude that AI output is generic. It is generic. It has nothing specific to be specific about.

What a repository for knowledge work looks like

The fix is not a smarter model. It is giving the model the same thing programmers give it: a place where all the work for a project lives together, that the AI can read from.

Concretely, a knowledge-work repository would hold:

  • Finished work. Published posts, final chapters, shipped campaigns, approved reports.
  • Work in progress. Drafts, outlines, half-formed ideas.
  • Source material. Interviews, articles, transcripts, data, competitor pages.
  • Rules and taste. A style guide, a character bible, a "words we never use" list. The equivalent of a codebase's conventions file.
  • The conversations themselves. Past AI sessions where you argued with the model, rejected drafts, and explained why. Those corrections are some of the most valuable material of all.

Then picture the same workflow as the coding agent:

The novelist. You have eleven chapters, a character bible and a few scenes you wrote by hand to nail Mara's voice. You ask for the confrontation scene. Instead of writing from its average idea of a confrontation, the AI reads the character bible (so the brother's name is right), reads the scenes where Mara speaks (so her dialogue has her clipped, wry rhythm), reads the last chapter (so the scene picks up where things left off) and then writes. You still edit it. But you are editing something that sounds like your book, instead of rewriting something that sounds like the internet.

The marketer. Your project holds the last twelve launch emails, their open rates, the brand voice doc and the new product's spec. You ask for a launch sequence. The AI can see which subject-line patterns worked, how your brand handles pricing language, and the feature names exactly as the product team spells them.

The researcher. Your project holds forty papers, your annotations, and two earlier literature reviews you wrote. You ask for a summary of where the field disagrees. The AI works from your sources and your framing, and can cite the actual documents in front of it rather than half-remembered general knowledge.

In every case, the model is identical. What changed is the archive and the harness's ability to pull from it.

Two ways to feed context: ambient and pinpoint

There are two distinct ways a project's past work can shape the output, and good knowledge work needs both.

Ambient context is the AI being aware of everything in the project and deciding for itself what to read. This is what a coding agent does when it searches the repository. You do not have to specify anything; the project as a whole shapes the output. It is great for consistency: names, facts, general voice.

Pinpoint context is you choosing exactly which pieces the AI reads for this particular task. Programmers do this too, by pointing the agent at a specific file: "do it like the billing page." For knowledge work, this is where the real craft lives:

  • "Write this scene, and use this earlier scene as the model for how they argue."
  • "Draft the announcement in the voice of this post, not the others."
  • "Summarize the debate using only these three papers."

Pinpoint context matters because ambient context averages. If your project holds both your punchy social posts and your formal investor updates, an AI reading everything may blend them into something in between. Pointing at the right two examples gives the attention mechanism a strong, clean signal instead of a blurry one. It also keeps the context small, which, as we saw, helps the model use it well.

A good setup lets you move between the two freely: let the AI read the room by default, and reach in to hand it the exact reference when precision matters.

The compounding effect

Here is why this is more than a convenience.

In a chat app, using AI more does not make it better at your work. Session one hundred starts from the same blank room as session one.

In a repository, every piece of work that lands in the project becomes material for the next one. The scene you rewrote by hand becomes the voice reference for the next scene. The campaign that performed well becomes the template the next one learns from. The draft where you told the AI "no, never open with a question" becomes a correction it can read next time.

And it does not matter whether a given piece was written by you or by the AI. What matters is that it was accepted: edited, approved, kept. The project becomes a growing record of your taste, built partly from your own writing and partly from AI work you shaped into your own. The more you use it, the more the output sounds like you, because there is more of you in the archive.

This is the same loop that makes AI coding feel like it is getting smarter inside a mature codebase. It is not the model getting smarter. It is the archive getting richer.

The last figure runs the loop forward. Every accepted draft goes back into the drawer, so each session starts with one more example of your work than the one before.

Gripper: files each accepted draft back into the projectTabbed cards: AI drafts you edited and keptRatchet: one tooth per session, never backwardsThe drawer starts with 12 cards you wrote. Each session the press drafts one card from what is in the drawer; once you accept it, the gripper files it at the end and the ratchet turns one tooth. Session n reads 12 + n − 1 cards, so every session has one more example of your work than the last. In a chat app nothing is filed back, so session 18 reads what session 1 did. After 18 sessions the drawer is full and the figure starts a new project.

Where this goes wrong

A repository is not magic, and it has failure modes worth knowing.

  • Garbage in, imitated out. The AI copies what it sees. If the project is full of weak drafts you never cleaned up, it will happily imitate those. Delete or separate what you would not want copied.
  • Stale material. If the old pricing page is still in the project, the AI may quote old prices. Keep a clear line between current and archived.
  • Too much at once. Stuffing everything into the context dilutes the signal. This is exactly when pinpoint context earns its keep.
  • Rules nobody wrote down. Your taste only reaches the AI if it is in the project somewhere: as examples, as a style note, or as a recorded correction. Taste that lives only in your head stays there.
  • Privacy. Whatever the AI reads may be sent to the model provider. Know what is in your project before you point a cloud model at it.

How to start, in any tool

Even without special software, you can capture most of the benefit:

  1. Pick one project and gather its best finished work into a single place.
  2. Write a one-page rules file: voice, banned words, names, recurring facts. Treat it like a codebase's conventions file.
  3. Before every request, attach the two or three most relevant examples, not everything.
  4. Save accepted outputs back into the project, along with any correction you had to make.
  5. Prune regularly. Remove what you would not want imitated.

You will notice the difference within a week. You will also notice how much manual shuffling it takes, which is the problem a harness exists to solve.

Why Slashspace is built this way

Slashspace was designed around this exact idea: each canvas is a project's repository, and the AI works inside it. Your drafts, notes, documents, web pages, videos, images and past conversations sit side by side as nodes, and the canvas is saved as a plain folder on your computer that you own. By default, a chat on a canvas gets a summary of everything there, and in Agent mode it can open any node and read it in full: that is the ambient context. When you want precision, you draw a connection from a specific scene, email or paper to the chat, or @-mention it, and the chat reads exactly that: the pinpoint context. Groups let you hand over a whole set of references at once, and context flows through chains, so a branch inherits everything its parent conversation could see. Every chat the AI has, and every edit you make, stays on the canvas as material for the next one. You can run it on the AI you already have, whether that is your Claude or ChatGPT plan, your own API keys or local models.

Programmers stopped prompting into a void years ago. Their AI reads the project first. There is no reason your writing, marketing or research should get less: give the AI a place to read your work, and it starts sounding like you.

Read next

Prompt Engineering vs Context Engineering

Understanding the difference between prompt engineering and context engineering

3 min read