L Loach Docs
Ctrl K

Work in folders

Give a chat a folder and the model can work in it the way a coding assistant does - list, find, read and search the files, and, once you approve each change, write, edit, move and delete them. Everything stays inside that folder, and there is no shell.

Adding a folder

Click the + button next to the message box and choose Add directory, then pick a folder in the system dialog. The same menu’s Add files is something else: it attaches file contents to one message (see Attachments), while a directory gives the model tools over a folder for the rest of the chat.

The “Working in” notice

For the rest of the chat, the message box reads Working in folder just above where you type, with the full path in its tooltip. Click the folder’s name to open it in your file manager, or remove it with the × beside it; the + menu now offers Change directory. While a reply is running in the chat, the folder can’t be changed or removed - that turn keeps the folder it started with.

The notice shows a LOACHFILE.md badge when the folder has project instructions, and turns amber with tools off if you later switch Workspace files off: while it is off, the model gets neither the tools nor the folder’s instructions.

Forking a chat carries its folder over. Backups and exports never include it - a path means nothing on another machine. If the folder is moved or deleted, the notice still shows it, but the model gets no file tools and no project instructions until you pick the folder again.

What the model can do

Eight tools appear in the model’s catalogue only while the chat has a folder; without one, the model never sees them. All paths are relative to the folder.

find_files and search_files go at most eight levels below where they start, and both give up after looking at 50,000 entries. Every tool that stops early says so, so the model can narrow its search rather than conclude a file isn’t there. The skipped dependency and build directories can still be read or searched when the model names one directly.

Deliberately absent: a shell, a recursive delete, and any way to point the tools at a folder other than through the system picker. When something needs a command run - the tests, a build - the model can only tell you which one; the sample LOACHFILE.md asks it to do just that.

Approving changes

Listing, finding, reading and searching never ask. The four tools that change files - write_file, edit_file, move_file and delete_file - pause the reply and ask first, unless you’ve allowed that tool for the chat. The card asks “Allow the model to …?” with the file’s path inside the folder written out in full, and shows the change itself rather than raw arguments:

Characters that would otherwise display as nothing or reorder the text around them - zero-width spaces, text-direction marks, control characters - are drawn in paths and contents as visible U+… tags, so what you approve reads the way it will be written. Whatever the card cuts for length, the whole change is what gets applied, and the same preview stays in the reply’s tool-call block afterwards.

A card left unanswered for 10 minutes isn’t run, and Stop cancels the reply as usual - though a write, edit, move or delete already running when you press it is let finish, and its real result is recorded before the reply stops.

How far “for this chat” reaches

The answer is kept in memory, never saved, and is tied to the folder it was given for. It ends when you change or remove the chat’s folder, delete the chat, switch Workspace files off, or quit Loach. It covers only Loach’s own tool - never an MCP server’s tool of the same name - and never anything git takes commands from: a .git directory (where a change also shows in no git status or diff), the .husky and .githooks hook folders, a .pre-commit-config.yaml, or a folder laid out as a bare repository (HEAD beside objects and refs), including the change that would complete one. A hook or setting there runs commands the next time you use git, so those always ask.

Staying inside the folder

Line endings and encodings

Line endings are preserved: editing or overwriting a CRLF file keeps it CRLF. So is the text encoding. Files that aren’t UTF-8 - Windows-1250 or another legacy code page, or UTF-16 with a byte-order mark (what PowerShell 5.1 writes by default) - are read, searched and edited in their own encoding and written back in it, byte-order mark included; only the edited text changes.

Project instructions (LOACHFILE.md)

If the folder has a LOACHFILE.md at its root, its contents are added to the system prompt on every turn - the same idea as a CLAUDE.md or AGENTS.md: the project’s own notes on how to work in it, such as how to run the tests, what not to touch and the house style. A sample is available to start from.

Privacy and Private Chat

The tools run inside Loach, but what they read becomes part of the conversation: with a cloud provider, those file contents are sent to it like any other message. The model is also told the folder’s full path, so it knows which project it is working in. Private Chat never gets a folder or the file tools.

Choosing a model

The model has to support tool calling to use the folder at all. One reply gets at most 10 rounds with the model, so pointing it at the right files up front - or in LOACHFILE.md - saves rounds spent searching. See “Stopped after 10 tool-use turns”.