Skip to content

Prompt Reminders (/reminder & /reminder-global) ​

Long agentic sessions accumulate dozens of tool outputs, compactions, and process restarts. Critical standing instructions — "always run focused tests before claiming a fix", "never edit generated files", "stay on the existing branch" — can easily fade into early transcript history.

Prompt Reminders keep high-signal instructions attached directly to outbound user turns as a structured <kompile_reminders> block, and — when The Judge is enabled — promote those same reminders from prompt hints into enforceable constraints.


Two Scopes & Storage Layout ​

Reminders are stored in two independent scopes that are merged automatically on every eligible turn:

ScopeSlash commandStorage pathBehavior
Session/reminder~/.kompile/conversations/<sessionId>.reminders.jsonFollows a single conversation across /resume and /reset, and is inherited on session handoff/fork.
Project-global/reminder-global<projectRoot>/.kompile/chat-reminders.jsonShared by every chat rooted in the same Kompile project folder; included in Kompile cloud settings bundles.

Both files use schema version 1 JSON (schemaVersion, optional interval, and reminders array) and are updated safely:

  • Concurrent-safe atomic writes: updates acquire a cross-process ManagedFileLock plus an in-JVM monitor and write via a temporary file + atomic rename.
  • Validation & bounds: duplicates are ignored automatically; each scope holds up to 64 reminders, each up to 8,000 characters, with a 512 KiB file cap. Symlinks and unsafe ISO control characters (other than \n and \t) are rejected.
  • Fault isolation: a damaged file in one scope will not block chat or hide reminders from the other scope.

Commands & Syntax ​

/reminder (session scope) and /reminder-global (project scope) share the exact same grammar and work in both Standard Chat and Managed Passthrough:

text
# Inspect configured reminders
/reminder
/reminder list
/reminder-global list

# Add a reminder (bare text or explicit `add`)
/reminder Always run the focused tests before answering.
/reminder add Never claim a build passed without checking the log.
/reminder-global Do not edit generated files under target/ or dist/.

# Clear all reminders in that scope
/reminder clear
/reminder-global clear

# Inspect or configure injection pacing
/reminder interval
/reminder interval 5
/reminder-global interval every 3
/reminder interval off
/reminder interval reset
  • A bare /reminder (or /reminder-global) lists the active reminders in that scope.
  • Any argument other than list, add, clear, or interval is treated directly as reminder text to add.

Injection Pacing (interval) & Precedence ​

By default, Kompile injects the <kompile_reminders> block on every user message (interval = 1). In long sessions with a large reminder list, you can pace prompt repetition without losing Judge enforcement:

ValueEffect
1, on, eachInject on every user message (default).
n or every n (2–10000)Inject on the first user message of the session, then every n-th user message.
0, off, neverDisable both prompt injection and Judge enforcement of configured reminders.
reset, defaultRemove the stored interval for this scope so it falls back to the enclosing scope.

Resolution Order ​

When deciding whether a turn is due for configured reminders, Kompile resolves the effective interval in strict order:

  1. Session stored interval (/reminder interval ...)
  2. Project stored interval (/reminder-global interval ...)
  3. JVM system property -Dkompile.chat.reminder.interval=<n> (note: KOMPILE_CHAT_REMINDER_INTERVAL is not used)
  4. Default: 1 (every user message)

Run /reminder interval with no arguments to inspect the effective interval, which layer supplied it, and the stored values for both scopes.


How Prompt Injection Works ​

When a turn is eligible, Kompile attaches a single <kompile_reminders> block in a fixed priority order — [system] → [project] → [session]:

xml
<kompile_reminders>
The user configured these reminders. Apply them to this prompt:
1. [project] Do not edit generated files under target/ or dist/.
2. [session] Always run the focused tests before answering.
</kompile_reminders>

Fix the OAuth token refresh race and add regression tests.

Key runtime behaviors:

  • Idempotent decoration: decorateUserTurn ticks the session turn counter once per user prompt and skips any prompt that already contains <kompile_reminders>, so a dispatcher and its downstream runner never double-wrap the same turn.
  • Transport-aware placement: reminders are prepended before the user message by default. For transports that expect the user's raw text first (such as ACP-backed agents like Antigravity/agy and certain direct-LLM prompt formats), Kompile automatically moves the <kompile_reminders> block to the end of the prompt.
  • Exact transcripts, clean titles: the decorated turn is recorded in the session transcript exactly as sent to the model so audits and replays reflect what the model saw, while session-title derivation and clean exports automatically strip the <kompile_reminders> block.

Automatic One-Shot Session-Resume Reminder ​

When you resume a conversation in a new Kompile CLI process (after an exit, crash, or /restart), Kompile schedules an automatic, process-local [system] reminder for the very next user prompt:

This conversation was resumed in a new Kompile CLI process, possibly after an exit, crash, or restart. Do not assume previously running commands, tools, agents, builds, background work, or other in-memory state survived; verify current state before continuing.

This one-shot [system] notice:

  • Bypasses configured reminder intervals (it fires even when interval > 1 or interval off is set for your user reminders).
  • Is consumed once on the first prompt after resume and never persisted to disk.
  • Appears as item 1. [system] ... ahead of any [project] and [session] reminders if both are included on that turn.

Enforcement by the Judge (EnforcerJudge) ​

Prompts alone are guidance — models can still forget or skim them during complex multi-tool turns. When an LLM-backed project Judge is active, Kompile feeds every non-disabled [project] and [session] reminder into the Judge as explicit enforceable constraints across:

  1. Full-turn response evaluation
  2. Streaming / mid-turn enforcement
  3. Pre-execution MCP tool-call review

Important nuances:

  • Interval pacing only affects prompt repetition: setting /reminder interval 5 reduces token overhead on the main model while the active Judge still checks your configured reminders on every reviewed turn.
  • Explicit opt-outs: /reminder interval off (0), /judge off, and /judge global off disable Judge enforcement of reminders.
  • Rule precedence: explicit Enforcer rules take precedence over reminders if the two conflict.
  • Keyword-only Enforcer mode: deterministic keyword/tool rules continue to fire normally, but keyword-only mode does not attempt to semantically interpret free-form reminder prose.

Kompile provides several complementary ways to keep agents aligned. Pick the lightest mechanism that matches your intent:

MechanismBest forEnforcement stylePersisted where
Reminders (/reminder, /reminder-global)Short, high-priority standing instructions you want visible right inside user turns and checked by the Judge.Prompt injection (<kompile_reminders>) + LLM Judge constraints on every reviewed turn.~/.kompile/conversations/<id>.reminders.json & .kompile/chat-reminders.json
Policy Audits (/policy-enforce)Periodic deep audits of long, repeatedly compacted sessions by an independent task subagent (Standard Chat only).Subagent audits transcript every N turns or duration and interrupts on drift.~/.kompile/conversations/<id>.policies.json & .kompile/chat-policies.json
The Enforcer (/concepts/enforcer)Hard mechanical invariants (read-before-edit, dedicated tool usage, lock ownership, resource admission).Deterministic pre-tool block/redirect before execution; cannot be talked past..kompile/enforcer-config.json & built-in rules
Persistent Memory (/concepts/memory)Architectural context, past debugging lessons, user preferences, and environment notes recalled by relevance.Advisory <memory_context> + explicit memory search/recall.~/.kompile/memory/ & .kompile/memory/
AGENTS.mdRepository-wide engineering handbook versioned in Git for every contributor and agent.Loaded once into session instructions at bootstrap.Checked into the repository (AGENTS.md)

Released under the Apache-2.0 License.