A filesystem with history is a world model
The world is one big filesystem.
On my Mac, everything I know and every program I use hangs somewhere off one tree. The internet is the same idea at a larger scale. Every page has a path, just with worse folder names.
A tree that big is only useful if you can find things in it, and for the web that is what Google worked out. PageRank looked at who links to whom, later versions also looked at what people clicked, and from all of that Google produced an order.
When I search for something, millions of other people have already done the ranking for me and I only read the results. An agent working in a folder has nothing comparable. It runs grep, gets back forty matches in no particular order, and then has to work out on its own which of them matter, so in effect the agent has to be its own Google.
My claim in this post is that a folder gets you further than it looks. Together with its git history it is already most of what people call a world model: it holds what is true now and what was true before, and it lets you try things and take them back. What it does not have is any kind of ranking.
Storage
The usual answer to the finding problem has been more storage. A vector database embeds every chunk of text so that passages can be found by meaning. A knowledge graph pulls out entities and relations. A memory service sits in front of both and decides what to keep. All three are second copies of information that already lives somewhere else, and somebody has to keep the copy in sync with the original.
The agents that people actually get work out of are much plainer than that. A coding agent sits in a directory and lists, reads, searches and edits. It has no index and no graph.
That does not mean a plain folder is enough. Grep works great when the folders are well organised, because then the folder names do the ranking. Which is a bit like saying a library works great when someone has already put the right book on the front desk.
World Models
A world model is a picture of the world that is good enough to plan with. You know a glass pushed off the table will fall. You know your keys were in your jacket this morning. You can guess how the day goes if you take the bike instead of the train, without having to try it.
In machine learning the term goes back, in its current sense, to Ha and Schmidhuber’s 2018 paper World Models, where an agent learned a compressed version of a racing game and then practised inside its own simulation of it. The word has been stretched a lot since, but the core has stayed the same: a state of the world, plus rules for how the state changes.
Spelled out as operations, a state with rules for change has to support five things:
- Observe: turn what is out there into a state.
- Update: change the state when something happens.
- Remember: recover what the state was earlier, and when it changed.
- Predict: estimate what follows from an action.
- Imagine: try an action without committing to it, and drop it if it was a bad idea.
I am adding a sixth, Focus: decide which parts of the state matter right now. The usual definitions leave it out, because a racing game is small enough to take in whole.
The Filesystem as a World Model
Take an ordinary directory under version control and go down that list. Almost every operation already has a command.
| World model | Filesystem | What it looks like |
|---|---|---|
| State | The file tree | Everything that is true right now, as files |
| Observe | ls, cat, grep |
Look around, read, search |
| Update | Write a file, git commit |
A change is made and recorded |
| Remember | git log, git show,
git blame |
What a file said in July, who changed it, and why |
| Imagine | git branch, git worktree |
A second version of the world that leaves the first alone |
| Undo | git revert, git checkout |
Go back to an earlier state |
| Predict | Run the tests, the code, a simulator | What happens if this changes |
| Focus | (nothing) | Grep returns every match, in no particular order |
The mapping has limits. A directory does not learn anything by itself; the agent does the thinking, and the folder holds the state it thinks about along with a full record of how that state came to be. Still, that is more than most memory layers offer, and both people and agents can read it.
Method
Code is the one kind of world that already lives in a filesystem, so I started there, with three benchmarks built from public GitHub data:
- Fresh issues. 260 issues from 26 large open source projects in Python, Rust, Go and TypeScript, all opened after the models’ training cutoff so that nothing could be memorized. The agent has to name the file that needs to change, and the answer is the file the real fix changed.
- The past. 100 questions mined from real git history, such as “as of March 2025, what was the default value of this parameter?”. The answer is read from the code as it was on that date and always differs from today’s value.
- Duplicates. 204 issues that maintainers closed as duplicates of an earlier report: the same problem, described twice by different people.
Three agents ran them: Claude Code with Claude Haiku 5.5 and Claude Sonnet 5.5, and Codex with gpt-5-mini. Each run got a fresh sandbox, 4,076 runs in total. Answers are checked by code, never by another model, and the only thing that changed between conditions was how the agent could find things.
This is the second version of the benchmark. The first used a fictional company whose documents, questions and grading all came from the same family of models that was being tested. The results looked great and I did not believe them, so I threw it out.
Observe
On the fresh issues, plain grep found the right file 82% of the time. A semantic search tool made it 83%. Pushing the five most similar files into the prompt made it 84%, and hints from the commit history left it at 82%. I cannot tell any of these apart from noise.
In hindsight this makes sense, because a bug report usually names the thing that is broken (an error message, a function, a flag), and searching for an exact name is the one thing grep has always been good at.
Fresh GitHub issues
Codex on 260 issues opened after the training cutoff, 26 projects. Share where the first file named is the one the fix changed.
Thin lines are 95% confidence intervals; all overlap. The semantic search tool was running in all 260 runs and called in none.
Remember
Ask an agent what a piece of code looked like a year ago, and without version control it can only see today. So it answers with today’s value, quite confidently, as if nothing had ever been different. That happened in 30 to 46% of answers. I started calling it present bias.
With read-only access to git, every agent went from somewhere between
52 and 66% to somewhere between 92 and 100%. Haiku went from 58% to 98%,
and Sonnet got every question right. For the Claude models it was also
cheaper, because one git show replaces a long hunt for
clues in the current files.
Questions about past values
100 questions about past states of real code from 14 Python projects. Share answered exactly right.
grep only (sees today)grep + read-only git history
Focus
Google did not stop at links. It also recorded what people did with the results: which ones they clicked, and which ones they came straight back from to try another.
An agent run leaves similar records, namely which files it opened and which ones ended up in its answer. To see whether those records can rank a filesystem, I built three recommenders that sit outside the agent. Each reads the task, ranks the repository’s files, and puts its top five into the prompt before the agent starts, the way a search engine shows you results before you click.
| Recommender | How it ranks | Effect on accuracy |
|---|---|---|
| Embedding similarity | Files whose text most resembles the task | None; about 9% fewer tokens |
| Commit history | Files changed by past commits with similar messages | None |
| Earlier agents’ traces | Files that earlier agents cited on similar tasks | Positive, when the problem has come up before |
Every issue in the duplicates benchmark has an original report, and an earlier agent had already worked on that original. When the duplicate came in, I put the files that earlier agent had used at the top of the prompt. All three agents improved: Codex from 59% to 69%, Sonnet from 70% to 76%, Haiku from 65% to 69% (Haiku’s gain is within the margin of error; the other two are not). The commit-history hints made no difference.
Duplicate issues
204 real duplicate issues from 26 projects. Share where the first file named is the one the real fix changed.
grep, alone or with commit-history hintsgrep + earlier agents' traces
Thin lines are 95% confidence intervals. Numbers after the value are points gained over grep only.
Scored on their own, before any agent reads them, the traces put the right file first for 40% of the duplicates. Commit history managed 10%.
Ranking quality of each recommender
Scored directly against the files the real fix changed, before any agent sees the list.
right file ranked firstright file anywhere in the top 5
PageRank got better as the web grew, so I also replayed the ranking with only a share of the earlier traces available. Without any traces it cannot rank at all. With a quarter of them it puts the right file first 20% of the time, with half of them 31%, and with all of them 50%.
Ranking quality by amount of earlier work
Replayed offline on 203 real duplicate issues.
right file ranked firstright file in the top 5
Dotted line: the same ranking given every earlier trace except the one from the original report of the same problem, 5%.
I expected the ranking to pick up general knowledge about a codebase, and it turned out that it does not. If I remove the trace of the one original problem and keep all the others, the right file comes first only 5% of the time. Problems do come back often, though: in these projects alone I found 465 fixed bugs that somebody had reported twice.
I also expected that only successful visits should count, so the ranker weighted a file up when the earlier agent had been right and down when it had been wrong. When I tested that against simply counting every visit the same, there was no difference (57% either way).
Beyond Code
A digital twin is a running model of some real system (a city’s water and power, a forest, a factory) that is kept in step with the original so you can ask it questions and try things out.
I built two small simulated worlds and stored each as a git
repository. One is a city: five districts with populations and a
satisfaction score, a reservoir filled by rain and drained by water use,
and a power grid with a plant, some hydro power and a battery, so that
hot weeks cause blackouts in whichever districts the council ranked
last. The other is a forest reserve: five patches of vegetation, deer
that graze and wander when food runs short, wolves that hunt them, and
fires in hot dry weeks. Each world has a state/ folder with
one file per district or patch, a policies.json with the
current decisions, and a weather.csv with the forecast.
Every simulated week is a commit. So is every decision, with messages
like “rationing set to level 3 in every district (drought emergency
order)”.
A perfect twin
In the first version the agent got, in the best condition, the very
simulator that had produced the world. I asked one kind of question per
operation: remember a past value, say when something first happened,
predict a future value, undo a past decision and say what would be true
now, and choose between three interventions. Codex answered 152 of these
across 40 worlds, with only the current files, then with git history
added, then with a ./sim command as well.
Perfect twin, by question type
Codex on 40 simulated worlds (a city's utilities, a forest ecosystem), 152 questions, answers checked exactly. Overall: 13% with a snapshot, 63% with history, 97% with the simulator.
snapshot only (current files)+ git history+ simulator (./sim)
Overall accuracy went from 13% to 63% to 97%, but I would not lean on those numbers. A snapshot cannot contain last month’s reservoir level, and the simulator was the same program that had produced the world, so most of that staircase was guaranteed before I ran anything.
What was not guaranteed is how the agent went about the “what if”
questions. Asked what would be true today had the council never ordered
rationing in week 48, it checked out the world as it stood the week
before, deleted the decision from policies.json, ran the
simulator forward to the present and read off the answer. It did this in
26 of 32 cases, and nobody had told it how.
When the twin is wrong
Real twins are never perfect, so the second version makes the model
and the world disagree. In each of 80 new worlds, reality runs the
twin’s equations with every parameter off by up to 6%, plus one thing
the twin does not model at all. In the city that is a slow leak in the
reservoir, households using more water than assumed, a power plant
delivering less than its setting, or demand reacting harder to heat. In
the forest it is a deer disease, poorer soil, unrecorded poaching, or
wolves coming in from outside. The weather file holds what was observed
up to now and only a forecast after that, and the real future differs
from the forecast. Git records what really happened. The simulator’s
parameters sit in an editable model/params.json, set when
the twin was created.
I also made the questions hard on purpose. A forecasting question was kept only if three lazy answers all failed: today’s value, the recent trend carried forward, and whatever the twin says as shipped. It also had to be answerable by a twin with the true parameters.
Forecasting with a miscalibrated twin
Codex on 80 worlds where reality differs from the twin. 109 forecasting questions (predict, predict when, counterfactual), each one chosen so that today's value, the recorded trend and the shipped twin all give the wrong answer.
Correct means within 10% (values) or 3 steps (dates). The oracle shows how far a perfectly calibrated twin gets with only the forecast weather.
With only the current files, Codex got 8% of these right. Git history brought it to 16%. Adding the twin’s simulator took it to 0%, which sounds dramatic but is just the filter at work: every question was picked because the shipped twin gets it wrong, and the agents ran the twin and reported what it said.
I then added a ./sim backtest command that replays the
twin over the recorded past and prints where it disagrees with what was
measured. Accuracy stayed at 2%, because in 109 forecasting questions
the agent ran the backtest once. It was not that the agent could not use
the command, because when I asked directly which process the twin was
missing, it backtested and picked the right one about half the time,
twice what guessing would give.
After that I added a paragraph to the folder’s RULES.md:
before you simulate, backtest; if the replay does not match the record,
fix the parameters and try again. With that paragraph, agents edited the
parameters in 94 of 189 runs (it had been 22 of 192), and forecasting
accuracy rose to 31%. In the runs where the agent did recalibrate it was
right 44% of the time, compared with 10% in the runs where it did
not.
A twin with the true parameters gets 94%, so an agent calibrating a twin from its history is still a long way behind one that is already calibrated.
What Agents Actually Use
Across all of these experiments, agents acted on what was put directly in front of them, in the prompt or in the folder’s own documentation, and mostly left alone anything that was only available as an option.
- A semantic search tool was installed and running in all 260 of Codex’s runs on fresh issues. It was called zero times.
- In an earlier pilot I offered Claude the trace-based recommendations as an optional tool. It was called in 1 to 4% of runs. The same recommendations pasted into the prompt were read and used.
- The backtest command was run in 1 of 109 forecasting questions. Once the folder’s own rules file said to run it, calibration happened in half the runs.
- The simulator, which was described in that same rules file from the start, got used whenever a question called for it.
I had been treating tools as the way to give an agent a capability. Going by these results, the documentation inside the folder does more of that work than the tools do.
Conclusion
If you run agents on code, let them read version history; it is the cheapest world model there is and it is already in the repository. Keep a record of which files each run used, because that record ranks the folder better the more it is used. And put what the agent should know into its prompt or into the folder’s own documentation instead of offering it as an optional tool.
If you want agents to work on a city, a supply chain, a power grid or an ecosystem, I would start by writing its state to files, committing every step and every decision, shipping the simulator and its parameters in the same folder, and writing the procedures down in that folder too.
Such a folder still has no built-in focus, though the traces of earlier agents supply some of it for problems that come back. It also cannot supply the judgement about when to distrust the model, and there the gap is wide: 31% for an agent that calibrates, 94% for a twin that is already right. That gap is what I would work on next.
Measurement: 4,076 runs of Claude Code (Claude Haiku 5.5, Claude Sonnet 5.5) and Codex (gpt-5-mini) on real code, plus 454 Codex runs on 40 idealized and about 1,150 on 80 realistic simulated worlds, all in isolated sandboxes, with paired comparisons and 95% confidence intervals over tasks. On duplicates, the gain from earlier agents’ traces is clear for Codex (+9.8 points, CI +4 to +15) and Sonnet (+6.4, CI +2 to +11) and borderline for Haiku (+3.9, CI −0.5 to +8). On the realistic twins, the written procedure beats the backtest command alone by 29 points (CI +19 to +38) and history alone by 15 (CI +5 to +25). The Anthropic credit ran out partway through, so the fresh-issues benchmark and both twin studies have Codex only. The simulated worlds are ones I wrote, and the realistic questions were filtered to be hard, so those percentages describe hard cases. The code benchmarks, protocol and full tables are in the paper.