88. Why a Working Directory?

Understand why creating a dedicated working directory before starting any long project is the single most valuable preparation step, and what it saves you from later.

By Jacques Botte, founder of Toptronic®. Last updated 19 September 2026.

The lesson

Every long project — an application, a hardware build, a documentation set, a research effort — generates files. Source files, notes, plans, logs, downloads, drafts, backups. If you start working before deciding where all of that lives, the files scatter: some land in Downloads, some on the Desktop, some in whatever folder happened to be open at the time. Two weeks later you cannot say with confidence which copy of a file is the real one. A working directory is the cure, and it costs you about thirty seconds to create.

A working directory is simply one dedicated folder that the project owns completely. Everything the project produces goes inside it, and nothing unrelated is ever written there. The name should be descriptive and stable — for example `Jacques_Working_Directory` or a project-specific folder such as `TPEE_Dev_1` — because you, your tools, and your LLM sessions will all refer back to this exact path many times over the life of the project.

The most important benefit is context for the LLM. When you open a session and tell the model "the project lives at this path", the assistant can read the previous files, follow the naming patterns, respect the existing structure, and continue the work instead of starting from a blank slate each time. Without a fixed directory, every session begins with archaeology: hunting for the last version, re-explaining the layout, and hoping nothing important was saved somewhere else.

A dedicated directory also makes the project portable and safe to back up. One folder means one thing to copy, one thing to zip, one thing to point a backup tool or a git repository at. Contrast that with a project spread across five locations: backup becomes guesswork, and moving to a new machine becomes a small disaster. The Toptronic® conventions even formalise this with a `WORKING_DIRECTORY_AND_PATH` entry, so every convention file and handover refers to the same anchor.

Structure inside the directory is the second half of the win. Once everything is in one place, you can impose an obvious layout — sources, docs, data, logs, and a history area — and that layout becomes a map that both humans and LLMs can navigate. Tools behave better too: linters, builds, and search run cleanly because they operate on a well-defined root instead of accidentally sweeping up unrelated files from a shared folder.

There is a safety dimension as well. If the LLM is ever instructed to modify, delete, or reorganise files, you want the blast radius contained. Work confined to a dedicated directory cannot touch your personal documents, your other projects, or system folders. That containment only works if the directory exists and is named in advance — which is exactly why you create it before the first prompt, not after the first accident.

A working directory also improves the quality of the project history. The Toptronic® LLM Rules assume that history files, inventories, and handovers are written inside the working directory. When those records accumulate in one place, the directory itself becomes the project's memory: you can read the folder listing and reconstruct what happened, in what order, without opening a single file.

Finally, the discipline is cheap and the regret is expensive. Making the folder costs nothing; retrofitting one after files have spread everywhere costs a careful migration, a re-check of every reference, and usually one lost file. Professionals do this instinctively for the same reason they label their components drawers before starting a build: the sorting is trivial at the start and painful in the middle.

The habit to adopt is simple. Before you write the first prompt of any long project: create the working directory, give it a clear name, decide its internal structure, and state its path in your very first message to the LLM. Everything else in the following lessons — bounded work, memory systems, and handovers — assumes this folder exists.

Check yourself

Question 1: Why should a working directory be created before the first prompt of a long project?
  1. Because operating systems require a project folder to run a compiler
  2. Because it costs nothing at the start, while retrofitting one after files have scattered is expensive and error-prone — correct
  3. Because LLMs refuse to answer questions without a project folder
  4. Because it doubles as the project's backup automatically

Answer: Because it costs nothing at the start, while retrofitting one after files have scattered is expensive and error-prone

Creating the folder takes seconds and anchors every later convention; migrating scattered files later costs a careful reorganisation and usually a lost file.

Question 2: What is the most important benefit of a fixed working directory for LLM sessions?
  1. It makes the LLM generate code faster
  2. It lets each new session read previous files and continue the work instead of starting from zero — correct
  3. It increases the model's context window size
  4. It prevents the model from ever making mistakes

Answer: It lets each new session read previous files and continue the work instead of starting from zero

With a known path, a new session can read prior files, follow naming patterns, and pick up the work; without one, every session begins with archaeology.

Question 3: What makes a working directory safer when an LLM modifies or deletes files?
  1. It encrypts all project files automatically
  2. It contains the blast radius: work confined to the directory cannot touch personal files, other projects, or system folders — correct
  3. It blocks the LLM from using any file tools
  4. It automatically reverts bad changes

Answer: It contains the blast radius: work confined to the directory cannot touch personal files, other projects, or system folders

A dedicated directory contains any accidental damage, which is why it should exist and be named before the first session, not after the first accident.

← Previous lesson · All 91 lessons · Next lesson →

The full course — 91 lessons and 273 quiz questions — ships inside the app. Get TPEE to study it offline.