Appearance
System Prompts
The system prompt tells Iris who it is and what it knows about you. It's assembled dynamically for each request, combining a static persona with contextual information like memories, summaries, and calendar events.
How It Works
Every time you send a message, Iris renders a series of prompt classes in order. They split into two places in the request: the cached system prompt (stable content at the front) and the context tail (volatile per-request content prepended to your newest message):
SYSTEM PROMPT (cached)
┌─ Cached Group (1h TTL) ─────────────────────┐
│ IrisStaticPrompt ← Identity │
│ HumanizerPrompt ← Voice rules │
│ AutonomousExecutionPrompt ← Agent behavior │
│ SkillsPrompt ← Skills (BP #1) │
└──────────────────────────────────────────────┘
┌─ Cached Group (1h TTL) ─────────────────────┐
│ PinnedSkillsPrompt ← Pinned skills │
│ PinnedPromptsPrompt ← Pinned prompts │
│ SummaryPrompt ← Summaries (BP #2)│
└──────────────────────────────────────────────┘
CONVERSATION HISTORY (cached up to BP #3)
CONTEXT TAIL (not cached, prepended to your newest message)
┌─ <context> … </context> ────────────────────┐
│ CrossThreadContextPrompt ← Briefs │
│ MemoryPrompt ← Truths + memories│
│ CalendarPrompt ← Upcoming events │
│ WeatherPrompt ← Current conditions│
│ CurrentTimePrompt ← Current date/time│
└──────────────────────────────────────────────┘The split exists for prompt caching. Anthropic caches by prefix, so anything that changes between requests must sit after the stable content — otherwise it invalidates the cache for everything behind it. The system prompt holds content that's stable within a thread (identity, pinned skills, summaries) and gets cache breakpoints. The volatile prompts (time to the minute, per-message memory recall, other threads' activity) render into the context tail instead, so the cached system prompt and history stay byte-stable turn over turn.
The result is a personalized, context-aware prompt where the expensive, stable parts are reused from cache on every message.
The heartbeat system uses a separate, purpose-built prompt stack. See Heartbeat Prompt Stack for details.
Architecture
Prompts are self-contained: each prompt injects a RequestContext and any services it needs, then fetches its own context when content() is called. This provides:
- Uniform pattern: Core and custom prompts work identically
- Testability: Prompts can be tested in isolation
- Flexibility: Each prompt injects only what it needs
- Conditional rendering: Prompts can return empty content if they have nothing to contribute
Prompt Pipeline
Each prompt is a separate class rendered in order. The default pipeline splits them into cached system groups for stable content and a context tail for dynamic content. The cached groups map to cache breakpoint groups:
Cached Group 1: Static Content (1h TTL)
These four prompts form the first cache group. Their content rarely changes, so they share a single cache breakpoint with a 1-hour TTL.
Static Prompt — Core identity and behavior:
- Identity and personality
- Communication style
- Tool usage guidelines
- The truth and memory protocol: search before saying you don't know, update on corrections, store in-turn only what background extraction won't capture
Humanizer Prompt — Writing guidance that keeps Iris from sounding like a chatbot. It's built from Wikipedia's Signs of AI writing field guide and covers:
- Specific details over generic warmth and importance claims
- The assistant register: reflexive openers, closing offer menus, stock hedges
- Document formatting in chat (headers, bold-labelled bullets, emoji as decoration)
- Rhythm and punctuation, including both too many em dashes and the comma-and-period monotony newer models fall into
- A guard against over-correcting into bland prose
It lives in its own prompt so you can drop it, replace it, or reorder it in config/iris-custom.php.
Autonomous Execution Prompt — Behavioral guidance for autonomous tool usage:
- Make tool calls first and write the whole reply after the last one
- Iterate on errors instead of stopping after one failure
- Verify results before claiming success
- Execute multi-step plans without asking permission between steps
- Clear escalation criteria for when to ask vs. keep going
This applies to all tools — shell, filesystem, memory, calendar, etc. Tool-specific mechanics (path conventions, read-before-edit gates) live in the tool descriptions themselves.
The tool-calls-first rule exists because of how Claude Sonnet 5.5 returns text. Anything the model writes before or between tool calls comes back as an empty thinking block, so you'd only see the part of the reply written after the last tool call. If Iris drafted half an answer and then saved a memory, that first half would vanish.
Skills Prompt — Lists available agent skills for Iris to activate:
- Skill names and descriptions from
.agents/skills/ - Only renders when skills are enabled and available
- Content is loaded from disk files, not generated per-request
Cached Group 2: Pinned Content & Summaries (1h TTL)
These prompts form the second cache group. Their content is stable within a thread — it changes only when you pin or unpin skills or when a new summary is written — so they're cached with a 1-hour TTL, which also has to be at least as long as the history breakpoint that sits behind them (Anthropic requires non-increasing TTLs along the cached prefix).
Pinned Skills Prompt — Injects the full content of skills pinned to the active thread. Unlike the Skills Prompt above (which lists skill names for on-demand activation), this prompt loads each pinned skill's complete instructions into the system prompt so they're always active.
- Reads pinned skill names from the thread's settings
- Loads each skill's full content via the skill loader
- Each skill becomes a separate system message
- Only renders when the active thread has pinned skills
Pinned Prompts Prompt — Injects custom prompts pinned to the thread.
Because pinned content is loaded in full, it consumes context window space on every message. The thread settings modal shows a context consumption notice so you can see how much space your pinned skills use. If a pinned skill has been removed from disk, Iris shows a warning in the thread settings modal.
Summary Prompt — Injects recent conversation summaries for continuity:
- Narrative arc from previous conversations
- Emotional context and relationship dynamics
- Only renders when summaries exist
TIP
When no skills are pinned and no summaries exist, the prompts in this group return empty content. The group doesn't consume a cache breakpoint in that case — it's as if it doesn't exist.
The Context Tail
The prompts below render per-request and change on most turns, so they can't live in the cached system prompt. Instead they render into a single fenced block that's prepended to your newest user message at request-build time:
text
<context>
The following is ambient context for this turn (current time, recalled memory,
calendar, weather, cross-thread activity) — it is not part of the user's message.
It is rebuilt for every message, so your earlier replies were written with
different context.
...rendered context prompts...
</context>
...your actual message...This block is never replayed as history: it's added only to the newest message in the outgoing request. A copy is saved in the user message's context_prompt column so the message inspector can show what was sent, but history is always built from the original message text. That keeps the replayed history byte-stable so it stays cacheable. The fence tells the model this is ambient context, not something you typed, and that its earlier replies saw different context. Configure these prompts in iris.context_prompts; see Cache Breakpoints.
Cross-Thread Context Prompt — Injects thread briefs from other active threads:
- The most recently active threads (up to
briefs.max_threads, 5), limited to threads active in the lastbriefs.max_age_days(7) - Under each brief, the newest messages written after it (up to
briefs.recent_messages, 4, each cut tobriefs.recent_message_chars, 300), so a thread that moved on since its brief still reads as current. A thread with no brief yet can appear with its recent messages alone - Current thread is always excluded
- Only renders when
iris.briefs.enabledis true and another thread qualifies
Memory Prompt — Recalls relevant context for the current message:
- Truths: Stable, core facts ranked by relevance (pinned Truths always included), each shown as
[truth ID, date first recorded] - Memories: chosen by the recall pipeline, each shown with its ID and the date it was recorded
- What recall picked for the thread's last few messages, in its own subsection (see Carrying Recent Recall Forward)
- Only renders when there's something to show, or when recall failed (then it tells Iris that memory is unavailable this turn)
Calendar Prompt — Retrieves calendar events:
- Upcoming events for the next
calendar.event_horizondays (7) - Events from the past
calendar.event_lookbackdays (3) - Calendar names and default calendar info
- Only renders when events exist
Weather Prompt — Provides current weather conditions for the user's configured location. Only renders when weather data is available.
Current Time Prompt — Provides the current date and time in the user's timezone (falling back to the configured default). Always renders.
Heartbeat Prompt Stack
The heartbeat system uses a dedicated prompt stack configured separately from the conversation prompts. The heartbeat needs Iris's personality for consistent voice, but doesn't need conversation-scoped prompts like pinned skills, autonomous execution guidance, or the active thread's summary chapters.
Each tick makes a decision request, and sometimes a craft request to write the message. A user's ticks run every heartbeat.interval_minutes (30), so the decision request is laid out for the prompt cache: large, steady blocks first, each group ending in a 1-hour breakpoint, and everything that moves with the clock last:
DECISION REQUEST
┌─ Group 1 ─────────────────────────────────────────────────┐
│ PersonaPrompt ← Voice │
│ HumanizerPrompt ← Writing rules │
│ HeartbeatDecisionPrompt ← How to decide │
│ HeartbeatGuidancePrompt ← Your guidance BP1 │
└───────────────────────────────────────────────────────────┘
┌─ Group 2 ─────────────────────────────────────────────────┐
│ HeartbeatThreadsPrompt ← Briefs, summaries │
│ HeartbeatRecentActivityPrompt ← Recent briefs BP2 │
└───────────────────────────────────────────────────────────┘
┌─ Group 3 ─────────────────────────────────────────────────┐
│ CalendarPrompt ← Calendar BP3 │
└───────────────────────────────────────────────────────────┘
┌─ Group 4 ─────────────────────────────────────────────────┐
│ HeartbeatMemoryPrompt ← Truths, memories BP4│
└───────────────────────────────────────────────────────────┘
WeatherPrompt ← Current conditions
CurrentTimePrompt ← Current date/time
Heartbeat message (user turn) ← Time, thread activity,
follow-ups, next 2 hours
CRAFT REQUEST (tools first, no breakpoints)
PersonaPrompt · HumanizerPrompt · HeartbeatConversationContextPrompt
CalendarPrompt · HeartbeatMemoryPrompt · WeatherPrompt · CurrentTimePromptPersonaPrompt — The core Iris persona extracted as a standalone prompt. This gives the heartbeat a consistent voice when crafting proactive messages without the full IrisStaticPrompt (which includes tool invocation protocols and other conversation-specific guidance).
HumanizerPrompt — The same writing guidance the conversation stack uses. Proactive messages and follow-up drafts are the easiest place for canned chatbot phrasing to creep in ("Just checking in!"), and the heartbeat doesn't load IrisStaticPrompt, so it needs this on its own.
HeartbeatDecisionPrompt and HeartbeatGuidancePrompt — The decision instructions (priorities, when to give space, how to write a follow-up briefing) and your heartbeat guidance. Only the decision request uses them.
HeartbeatThreadsPrompt and HeartbeatRecentActivityPrompt — The user's most recently active threads (up to heartbeat.context_max_threads) with their briefs and latest summaries (narrative thread, emotional state, unresolved threads, active goals), plus the briefs of threads active in the last week, as read-only context. They're listed in thread order without activity times, so they change only when a brief or summary is regenerated. When each thread was last active, how many messages it has, and the pending follow-ups go in the heartbeat message, which is rebuilt every tick anyway.
HeartbeatConversationContextPrompt — The same thread context with each thread's last activity time inline. The craft request uses it in place of the decision-only prompts. The craft request isn't cached, so there's no reason to move the times out of it.
HeartbeatMemoryPrompt — Recalls truths and memories like MemoryPrompt, but without the planner model call. A tick has no user turn to plan against, so it searches with the triggering follow-up's briefing (if any) and the user's latest messages, one query each, up to memory.max_queries (4). Nothing is carried forward on a tick.
The heartbeat prompt stack is configured via iris.heartbeat.prompts and uses the same format as the main iris.prompts config (cache groups and standalone entries). The SystemPromptBuilder reads from this alternate config key when building heartbeat system messages, and heartbeat.cache_ttl sets the TTL for every heartbeat group.
Prompt Templates
Templates are Blade files in resources/views/prompts/:
prompts/
├── personas/
│ └── iris-static.blade.php # Core identity + protocols
├── persona.blade.php # Standalone persona definition
├── recalled-context.blade.php # Memory context
├── calendar-context.blade.php # Calendar events
├── weather-context.blade.php # Weather conditions
├── summary-context.blade.php # Conversation summaries
├── cross-thread-context.blade.php # Thread briefs
├── context-tail.blade.php # Fences the context tail
├── heartbeat-conversation-context.blade.php # Thread briefs + summaries (heartbeat craft)
├── heartbeat-decision.blade.php # Decision instructions (heartbeat)
├── heartbeat-guidance.blade.php # Heartbeat guidance
├── heartbeat-threads.blade.php # Thread briefs + summaries (heartbeat decision)
├── heartbeat-recent-activity.blade.php # Recent conversations (heartbeat decision)
├── heartbeat-message.blade.php # Craft request message (heartbeat)
└── heartbeat.blade.php # Per-tick heartbeat messageCustomizing Prompts
Create your own prompt classes to customize Iris's behavior. Each prompt is self-contained and injects the dependencies it needs.
The content() method can return either a string or a Blade view:
php
<?php
declare(strict_types=1);
namespace App\Extensions\Prompts;
use App\Prompts\Prompt;
use App\ValueObjects\RequestContext;
use Illuminate\View\View;
class WeatherPrompt extends Prompt
{
public function __construct(
protected RequestContext $requestContext,
protected WeatherService $weather,
) {}
// Return a Blade view for complex templates
public function content(): View
{
return view('prompts.extensions.weather', [
'forecast' => $this->weather->getForecast(
$this->requestContext->user()?->id
),
]);
}
}For simpler prompts, return a string directly:
php
<?php
declare(strict_types=1);
namespace App\Extensions\Prompts;
use App\Prompts\Prompt;
class TimezonePrompt extends Prompt
{
public function content(): string
{
return "## User Timezone\n\nThe user is in the Pacific timezone.";
}
}The RequestContext API
The RequestContext value object provides access to everything about the current request:
| Method | Returns | Description |
|---|---|---|
user() | User|null | The authenticated user model, or null if unauthenticated |
threadId() | int|null | The ID of the active thread for this request |
message() | string|null | The user's message text for this request |
images() | array | Array of attached image data (for multi-modal requests) |
recalledContext() | RecalledContext|null | The truths and memories MemoryPrompt recalled, once it has rendered |
Using RequestContext
Every prompt receives a RequestContext via constructor injection. Use it to customize prompt content based on the current request:
php
public function __construct(
protected RequestContext $requestContext,
) {}
public function content(): string
{
$user = $this->requestContext->user();
if (! $user) {
return ''; // No content for unauthenticated requests
}
// Customize based on user or message
$message = $this->requestContext->message() ?? '';
if (str_contains(strtolower($message), 'urgent')) {
return "## Priority Mode\n\nThe user has indicated urgency.";
}
return '';
}Registering Custom Prompts
Add your prompt to config/iris-custom.php. Both the prompts and context_prompts arrays replace the defaults entirely, so include the core prompts you want to keep. Put stable content in a cached prompts group; put dynamic, per-request content in context_prompts:
php
// config/iris-custom.php
return [
// Cached system prompt — stable content only
'prompts' => [
[
'cache' => ['type' => 'ephemeral', 'ttl' => '1h'],
'prompts' => [
App\Prompts\IrisStaticPrompt::class,
App\Prompts\HumanizerPrompt::class,
App\Prompts\AutonomousExecutionPrompt::class,
App\Prompts\SkillsPrompt::class,
],
],
[
'cache' => ['type' => 'ephemeral', 'ttl' => '1h'],
'prompts' => [
App\Prompts\PinnedSkillsPrompt::class,
App\Prompts\PinnedPromptsPrompt::class,
App\Prompts\SummaryPrompt::class,
],
],
],
// Context tail — dynamic per-request content, prepended to the newest message
'context_prompts' => [
App\Prompts\CrossThreadContextPrompt::class,
App\Prompts\MemoryPrompt::class,
App\Extensions\Prompts\WeatherPrompt::class, // Your custom prompt
App\Prompts\CalendarPrompt::class,
App\Prompts\CurrentTimePrompt::class,
],
];A dynamic custom prompt goes in context_prompts. If your prompt is static content that rarely changes, add it to a cached prompts group instead so it shares that group's breakpoint. See Cache Breakpoints for more on grouping strategies.
Prompt Ordering Considerations
Order matters, both within the cached system prompt and within the context tail:
- Cached Group 1 — Static identity and skills: Establishes who Iris is, how it behaves, and what skills are available. Cached with a 1h TTL because this content rarely changes.
- Cached Group 2 — Pinned content and summaries: Thread-specific skills and prompts plus conversation summaries. Cached with a 1h TTL since this content can change mid-session but doesn't change per-request.
- Conversation history: Loaded from the latest summary boundary forward (see Context Management) and cached up to the stable portion behind the protected recent turns.
- Context tail: Cross-thread briefs, memories, calendar, weather, and current time, prepended to your newest message. This is the only per-request content, and it sits after everything cached so it never invalidates the prefix.
This ordering maximizes prompt cache hit rates. Because Anthropic's caching is prefix-based, keeping every volatile byte in the tail lets the system prompt and history reuse cache on every message. See Cache Breakpoints for the full details on how groups map to breakpoints.
When adding a custom prompt, static content that rarely changes should go in a cached prompts group. Dynamic, per-request content like project status belongs in context_prompts.
Complete Custom Prompt Example
Here's a full example of creating and registering a custom prompt that injects work project context:
1. Create the Prompt Class
php
<?php
declare(strict_types=1);
namespace App\Extensions\Prompts;
use App\Models\User;
use App\Prompts\Prompt;
use App\Services\ProjectService;
use App\ValueObjects\RequestContext;
use Illuminate\View\View;
class WorkContextPrompt extends Prompt
{
public function __construct(
protected RequestContext $requestContext,
protected ProjectService $projectService,
) {}
public function content(): View|string
{
$user = $this->requestContext->user();
if (! $user) {
return '';
}
$projects = $this->projectService->getActiveProjects($user->id);
if ($projects->isEmpty()) {
return '';
}
return view('prompts.extensions.work-context', [
'projects' => $projects,
]);
}
}2. Create the Blade Template
blade
{{-- resources/views/prompts/extensions/work-context.blade.php --}}
## Current Work Projects
The user is currently working on these projects:
@foreach($projects as $project)
- **{!! $project->name !!}**: {!! $project->description !!}
- Status: {!! $project->status !!}
- Deadline: {{ $project->deadline?->format('F j, Y') ?? 'No deadline' }}
@endforeach
Use this context when the user asks about work or projects.Prompt templates are plain text for the model, not HTML for a browser. Blade's HTML-escapes its output, so a project called R&D "Phase 2" would reach the model as R&D "Phase 2". Use {!! !!} for any text that came from a person or a service, as the built-in prompt templates do, and keep for numbers and dates you format yourself.
3. Register the Prompt
php
// config/iris-custom.php
return [
'prompts' => [
[
'cache' => ['type' => 'ephemeral', 'ttl' => '1h'],
'prompts' => [
App\Prompts\IrisStaticPrompt::class,
App\Prompts\HumanizerPrompt::class,
App\Prompts\AutonomousExecutionPrompt::class,
App\Prompts\SkillsPrompt::class,
],
],
[
'cache' => ['type' => 'ephemeral', 'ttl' => '1h'],
'prompts' => [
App\Prompts\PinnedSkillsPrompt::class,
App\Prompts\PinnedPromptsPrompt::class,
App\Prompts\SummaryPrompt::class,
],
],
],
'context_prompts' => [
App\Prompts\CrossThreadContextPrompt::class,
App\Prompts\MemoryPrompt::class,
App\Extensions\Prompts\WorkContextPrompt::class, // After memories
App\Prompts\CalendarPrompt::class,
App\Prompts\CurrentTimePrompt::class,
],
];The WorkContextPrompt is dynamic (fetches active projects per request), so it goes in context_prompts rather than a cached group.
Caching Static Prompts
Prompt caching is managed through cache breakpoint groups in your config, not in individual prompt classes. To cache a prompt, place it inside a group with a cache key in the prompts config:
php
// config/iris-custom.php
'prompts' => [
[
'cache' => ['type' => 'ephemeral', 'ttl' => '1h'],
'prompts' => [
App\Prompts\IrisStaticPrompt::class,
App\Extensions\Prompts\YourStaticPrompt::class, // Cached with the group
],
],
],
'context_prompts' => [
App\Prompts\MemoryPrompt::class, // Dynamic — rendered into the context tail
],Individual prompt classes don't need to set providerOptions() for caching — any cacheType or cacheTtl values set by prompts are automatically stripped. The config is the single authority for where cache breakpoints are placed. See Cache Breakpoints for the full guide on configuring groups, TTL options, and the 4-breakpoint limit.