The Context Window Lie: Why AI Agents Fail Without a Persistent Filesystem
Ask an LLM to build a small web app in a chat interface, and it feels like magic for the first 20 minutes. Then you realize every time the conversation restarts (or the token limit hits, or you close the tab) the agent has forgotten the directory structure, the installed dependencies, the failing test you just spent an hour debugging. That forgetfulness is not a token problem. It’s a state problem, and a larger context window papers over it without solving the root cause.
The Context Window Isn’t Real Memory
A 200k token context window can keep a lot of code in the same request. That’s useful for reading a whole repository at once, but it doesn’t persist anything across invocations. The moment the model stops generating, that state evaporates. There is no file on disk, no running process, no environment that survives. The context window is just a scratchpad that gets torn up after every turn.
Real programming tasks are stateful. You npm install a package and expect it to be there five minutes later. You edit three files, run pytest, and need the agent to interpret the output and patch the right line, not re-derive the entire project from first principles. Stateless chat interfaces force you to repeatedly paste logs, re-upload files, and spell out what changed since you last talked to the thing. You’re effectively working as the agent’s short-term memory, and that overhead kills velocity.
Stateless Sessions: The Invisible Wall
Tools based on chat completions (including many “agent” frameworks) wrap the model inside a request/response cycle. They may carry a conversation history in the prompt, but they have no real access to a shared filesystem that outlives the HTTP call. If the agent generates a script, runs it, and the script creates a file, the next turn needs a whole new invocation that has to be re-informed of that file’s existence. You end up with brittle workflows where the agent either hallucinates the state or demands you describe the environment again.
This is why “AI coding” demos look brilliant on a greenfield project that fits in one prompt, but falter on day two when the agent needs to remember that you switched branches, added a lint rule, and configured a database container. Without a persistent home directory and a running shell, the model cannot maintain its own tool cache, cannot leave background tasks running, and cannot preserve working state between your coffee breaks.
What a Persistent Filesystem Actually Gets You
A terminal based agent that lives inside a persistent remote shell solves this by giving the model a real $HOME. It’s not storing memories in some vector database gimmick; it’s writing files to disk, running commands in a shell that stays up, and reading from the same working tree you see. When the agent creates a virtualenv, installs pytest, and writes a failing test, all of that is still there the next morning. You can ask “run the test suite again” and it just works, because the agent’s state is the literal filesystem.
# Agent creates project in its persistent home
mkdir bug-tracker && cd bug-tracker
python3 -m venv .venv && source .venv/bin/activate
pip install flask black pytest
git init && git add -A && git commit -m "Initial scaffold"
A day later, you ask for a new feature. The agent doesn’t need a history dump; it can ls, git log --oneline, and pytest --last-failed to understand where it left off. That’s how a human programmer works, and it’s why autonomous coding only starts to feel reliable when the model can trust the environment it built.
borg Doesn’t Just Chat, It Lives in a Shell
At xShellz, we built borg to operate exactly this way. It’s an AI coding agent that gets its own persistent Linux shell, hosted on our infrastructure. When borg writes files, they’re on a real ext4 filesystem. When it starts a development server, it can leave it running, and you can curl it from anywhere later. You connect over SSH or through our browser terminal, give it a task, and walk away. The state remains because the shell was never torn down.
That’s fundamentally different from an IDE plugin that needs your machine awake and your session alive. A persistent shell agent can run overnight, handle long compilations, and survive your laptop going to sleep. It’s a remote junior developer that never forgets what’s in /home/borg/project because that’s where it actually lives.
Of course, borg isn’t magic. It still makes mistakes, gets stuck in loops, and occasionally needs a nudge. But because it operates on a real filesystem, you can inspect its work exactly as you would a teammate’s: pull the repo, read the logs, and steer it without re-uploading context.
The Real Payoff: From Prompt to Deploy Without Repeating Yourself
Once you stop treating an AI coder like a chat widget and give it a home directory, the interaction model changes. Instead of single shot prompts, you assign tasks: “Add user registration with email verification, run the tests, and push to a staging branch.” You come back later and see a commit history, not a trail of pasted JSON responses. The agent becomes a long running process, not a series of expensive stateless requests.
This is where the “context window lie” becomes clear. A large context window helps the model see more on a single pass. But real coding workflows span days, decisions, and runtime state that no prompt can capture in full. The missing ingredient is not more tokens; it’s persistence. Give your agent a shell and a filesystem, and you’ll stop babysitting its memory. You’ll start handing it real work.