L Loach Docs
Ctrl K

Custom instructions

Custom instructions are the system prompt Loach sends with your messages. You can write them globally, for a single chat or for a whole Space - but they don’t merge: exactly one set applies to a chat, so it’s worth knowing which one wins.

Where to set them

Precedence

Loach picks one set of instructions per chat, in this order:

  1. The Space’s instructions, if the chat is in a Space that has any. They replace both the global and the chat’s own instructions.
  2. Otherwise the chat’s own instructions, if its field isn’t empty.
  3. Otherwise your global custom instructions.

Because a new chat starts with a copy of your global instructions in its own field, editing the global ones later changes the chats you start from then on, not the ones you already have. To make an existing chat follow the current global instructions, empty its field (or run /instructions clear).

The context bar counts whichever set wins, so in a Space with instructions it measures the Space’s.

Space instructions win

In a Space with instructions, a chat’s own Additional instructions are ignored. Put anything that should apply there into the Space’s instructions - or leave the Space’s instructions empty so each chat’s own (or the global ones) apply.

What else goes into the system prompt

The winning instructions are the core of the system prompt, but not all of it. Around them, Loach adds:

Private Chat skips most of this: it ignores your custom instructions, memory, Spaces, the Library, template variables and the date preamble, and sends only the persona and instructions set in its own panel, plus its tone (or your default tone).

Compaction summaries

When you compact a chat, Loach stores the summary at the top of the chat’s own instructions field, between [Loach: earlier conversation summary] and [End of Loach summary] markers. It doesn’t count as your instructions: it goes in front of whichever instructions win, so a compacted chat with no instructions of its own still follows your global ones, and a compacted chat in a Space keeps both the summary and the Space’s instructions. /instructions shows and replaces only your own text and keeps the summary. If you edit the field in the Parameters panel, leave the marked block in place - deleting it deletes the summary.

Project instructions (LOACHFILE.md)

When a chat works in a folder (with Settings → Tools → Workspace files on), a LOACHFILE.md at the folder’s root is added to every message: how to run the tests, what not to touch, house style. It’s read fresh each time, so an edit applies to your next message, and only its first 32 KB is used. It’s added at the very start of the system prompt - ahead of the persona and your instructions - rather than replacing them, in Spaces too, and the model is told it comes from the project, not from you: when it conflicts with your instructions, yours win, and it can’t give the model extra permissions.

Template variables

Global instructions, Space instructions and per-chat instructions can use these placeholders; Loach substitutes them each time it sends a message. Snippet bodies can use them too - there they’re filled in when the snippet runs. Placeholders typed into an ordinary message, or inside a source, are sent as written. The Variables panel on the Snippets page lists these under Built in - filled in automatically, each with the value it would have right now.

See also Temporal awareness, which automatically prepends a short date preamble when your prompt doesn’t already use the {{CURRENT_*}} placeholders.

Examples