Context Settings
Context settings control what information the AI receives about your project. This is the most important section -- getting context right is the key to useful AI assistance.
Most settings here apply to both endpoints and harnesses. The exceptions are noted per section — see Harnesses.
Agent Prompts
Edit the instructions each agent runs on (Writer, Planner, Chat, Harness Edit). Changes apply to the next request — see Prompts.
Session Memory
margin remembers your recent conversation turns (questions and AI responses) to keep the discussion coherent.
- Max History Depth: Set between 1 and 10 turns. A higher number gives the AI more context but uses more tokens. The default of 5 works well for most conversations. Applies to endpoint chat turns and planner history only — harnesses keep their own conversation per session and continue it automatically (see Harnesses).
Reference Files
The Reference Files panel lets you control which files in your workspace the AI can read. Each file has three states:
| State | Icon | Behavior |
|---|---|---|
| Available (default) | The Planner can read this file if it decides the content is relevant. | |
| Pinned | This file is always included in every AI request. Good for style guides or world-building rules. | |
| Blocked | The AI is prevented from reading this file. Useful when smaller models struggle with too much context. |
Click a file's icon to cycle through the states.
You can also block an entire folder -- all files within it become inaccessible to the AI. Blocked folders are shown with a red strikethrough in the panel.
Include Document Structure
When enabled, the endpoint planner receives a structural outline (paragraph previews) of your active document. This helps the Planner understand the broader story flow, but consumes more tokens.
Endpoint planner only — harnesses read the workspace directly, so the checkbox disables while a harness is the default. For persistent style rules, edit the agent prompts above instead.
Consider turning this off if you're using a smaller local model. The outline can consume a significant portion of your context window.
