Yeda AI Tips · #211

Español

Editing Your Rules Mid-Session Does Nothing

You're mid-conversation. The agent does something you'd rather it didn't, so you open the rules file and add a line forbidding it. You go back to the chat. It does the same thing again. This one wastes a lot of time before anyone explains it, because the obvious interpretation — the agent is ignoring me — is wrong.

Read once, then held in memory

Rules files are loaded at the start of a conversation. Not per message, not on change: once, at startup, after which the content lives in the session's context. Nothing is watching the file for edits.

So a mid-session edit lands on disk and stays there. The running conversation holds the version that existed when it began. From the agent's side there is no new instruction to ignore, because from its side nothing about the file has changed.

This produces a symptom that reads as gaslighting if you don't know the mechanism: the identical rule works perfectly in a fresh session and does nothing in the one you're in. Same file. Same text. Different load time.

Three ways to reload

Any of these makes the file take effect:

Compaction deserves emphasis. The project-root rules file survives it: after a compact, it is re-read from disk and re-injected into the session. So compacting is the option that picks up your edit without throwing away the conversation you're in the middle of. If you've just added a rule and don't want to start over, that's the move.

Note: The re-read isn't uniform across every file. Nested rules files in subdirectories and path-scoped rules reload as the agent reads files they apply to, rather than immediately on compaction. If an instruction is still missing afterwards, check whether it lives in a nested file that hasn't been triggered yet.

The corollary: instructions given only in chat don't persist

The same mechanism explains a second complaint. You tell the agent something mid-conversation — always use this helper, never touch that directory — and after a compact it seems to forget.

It did. Compaction summarises the conversation, and a detail mentioned once in passing is exactly the kind of thing a summary drops. The root rules file is re-read from disk precisely because it's the durable channel; a sentence you typed at message forty is not.

So the practical split is: corrections you want to survive the session belong in the file, not the chat. If you find yourself typing the same correction you typed last session, that's the signal to write it down permanently rather than repeat it.

A workflow that avoids the whole trap

Rather than editing mid-flight and wondering whether it took, batch it:

This is faster than the alternative because it stops you interleaving file edits with work and repeatedly testing whether the edit landed. It also produces better rules: written at a break, with the whole session's evidence in view, instead of hastily mid-task.

The takeaway

Your rules file isn't live. It's a snapshot taken when the session started, and edits after that point are invisible until you restart, clear, or compact. Compact is usually the one you want, because it reloads the file from disk without costing you the conversation.

Building an AI feature? Yeda AI designs, audits, and ships production LLM systems.

Talk to us · Read the blog