Prompt Enhancer
The prompt enhancer automatically prepends contextual information to each user prompt before it reaches the model: git status, recently accessed files, and LSP diagnostics.
Prompt enhancement is enabled by default when [options.prompt_enhancer] or
enabled is omitted. Set enabled = false to disable the user-message
<context> block explicitly.
System vs user injection
Section titled “System vs user injection”- System prompt: Base template plus runtime appendages. The current contract is layered: invariants first, then active mode and workflow phase, then tool-specific guidance. Runtime appendages include tool inventory, taxonomy, shared tool contract, session/workspace/model context, mode and phase, permissions/tool gates, summaries, capabilities, and a compact one-line user-message context hint/summary when live enhancer context is available.
- User message only: All heavy enhancer content (git status, recent files, LSP, repo map, memory, flow, context retriever when enabled) is injected into the user message in a
<context>block. The system prompt only gets counts/presence, not the full blocks. - Codebase context (default on): Metadata-only workspace snapshots run once per user turn and can suppress risky injections when stale under
options.codebase_context.stale_policy. See Codebase context snapshots.
For appendage order and the system-prompt hint/summary contract, see prompt-enhancer.md.
Prompt artifact annotations
Section titled “Prompt artifact annotations”Prompt docs and review artifacts use the annotation model from the Prompt Artifact Annotation Spec: authoring source, rendered docs, compiled prompt, and eval metadata are separate surfaces. The metadata block says whether a block is sent to the model, which role owns it, and which trust boundary applies.
role: developersource_kind: static_instructionsend_to_model: trueauthority: hightrust_boundary: instructionalannotations: - CRITICAL - ASSERTUse prompt assertions for behavior that should map to evals:
[ASSERT: prompt_context_stays_user_scoped]
For practical prompt-writing guidance and alternate prompt shapes, see Prompt Engineering Patterns. For the full maintained artifact format, see the Prompt Artifact Annotation Spec.
How workspace state changes the next prompt
Section titled “How workspace state changes the next prompt”The practical effect is simple: the agent does not receive only your last typed sentence. It receives that sentence plus a bounded snapshot of the same workspace state you just changed, so the next turn can react to the current branch, touched files, and active diagnostics without you restating them.
Configuration
Section titled “Configuration”[options.prompt_enhancer]enabled = trueinclude_git = trueinclude_recent_files = trueinclude_lsp = truemax_recent_files = 10Options
Section titled “Options”| Option | Default | Description |
|---|---|---|
enabled | true | Enable prompt enhancement; explicit false disables |
include_git | true | Include git status output in enhanced prompts |
include_recent_files | true | Include a list of recently accessed files |
include_lsp | true | Include current LSP diagnostics (errors, warnings) |
max_recent_files | 10 | Maximum number of recent files to include (1–50) |
System prompt enrichment ([options])
Section titled “System prompt enrichment ([options])”These top-level options.* keys inject lines into the system prompt (separate from the prompt-enhancer <context> block). They default on when omitted (nil-guard in config); set false to disable.
| Option | Default | Description |
|---|---|---|
include_git_state | true | Compact git summary (branch, modified/staged/untracked counts) in the system prompt |
include_last_turn_summary | true | Short excerpt of the last user+assistant turn |
include_recent_tool_calls | true | Last N tool names from recent history (recent_tool_calls_count) |
When to use
Section titled “When to use”Enable the prompt enhancer when you find yourself frequently having to tell the agent “there are errors in the build” or “I was just working on these files.” It makes the agent’s starting context richer with no extra effort.
For richer timeline context (file change events + terminal summary), see Flow Awareness. For outcome-based selection of which enhancer content to include in long sessions, see Adaptive Context.
Another way to read the diagram above: changing the workspace is part of the conversation. A file edit, a failed build, or a new diagnostic shifts the context BMO can lawfully attach to the next prompt.
Related
Section titled “Related”- How BMO thinks and acts - the higher-level coordination model that prompt enhancement feeds into.
- Flow Awareness - timeline-style file and terminal context.
- Adaptive Context - chooses which enhancer content to include when sessions get longer.