Skip to main content

Module reminders

Module reminders 

Source
Expand description

System reminder infrastructure for agent guidance.

This module implements the <system-reminder> pattern used by Anthropic’s Claude SDK. System reminders provide contextual hints to the AI agent without cluttering the main conversation. Claude is trained to recognize these tags and follow the instructions inside them without mentioning them to users.

§Example

use agent_sdk::reminders::{wrap_reminder, append_reminder, ReminderTracker};
use agent_sdk::ToolResult;

// Wrap content in system-reminder tags
let reminder = wrap_reminder("Consider verifying the output.");
assert!(reminder.contains("<system-reminder>"));

// Append a reminder to a tool result
let mut result = ToolResult::success("File written successfully.");
append_reminder(&mut result, "Consider reading the file to verify changes.");
assert!(result.output.contains("<system-reminder>"));

§Integration status

wrap_reminder and append_reminder are the wired primitives — callers and the primitive tools use them directly. Per-tool ToolReminders are driven by the agent loop when a ReminderConfig is installed via AgentLoopBuilder::with_reminders: after each tool batch completes in the turn’s inline execution path, every reminder whose ReminderTrigger fires is appended to the tool result the model sees. Results that are not assembled by that inline path — e.g. a confirmation-suspended tool resumed on a later turn, or externally handed-off executions — do not get reminders applied.

The periodic ReminderTracker machinery is not yet driven by the agent loop: the run loop does not call ReminderTracker::record_tool_use, ReminderTracker::advance_turn, or ReminderTracker::get_periodic_reminders. SDK users who want periodic reminders must drive the tracker themselves (record tool uses, advance turns, and append the returned reminders to tool results).

Modules§

builtin
Built-in reminder content for primitive tools.

Structs§

ReminderConfig
Configuration for the reminder system.
ReminderTracker
Tracks tool usage for periodic reminder generation.
ToolReminder
A custom reminder for a specific tool.

Enums§

ReminderTrigger
Determines when a tool reminder should be shown.

Functions§

append_reminder
Appends a system reminder to a tool result’s output.
wrap_reminder
Wraps content with system-reminder XML tags.