Skip to content

feat: inject plan mode as system-reminder messages instead of system prompt#1179

Merged
lewis617 merged 1 commit into
mainfrom
plan-mode-system-reminder
Jun 1, 2026
Merged

feat: inject plan mode as system-reminder messages instead of system prompt#1179
lewis617 merged 1 commit into
mainfrom
plan-mode-system-reminder

Conversation

@lewis617
Copy link
Copy Markdown
Collaborator

@lewis617 lewis617 commented Jun 1, 2026

Move plan mode instructions from buildSystemPrompt() into transient
user messages injected via buildPlanModeMessages()
in AIManager. This preserves the cached system prompt prefix across
mode transitions, matching Claude Code's attachment pattern.

Key changes:

  • Add planModeReminders.ts with full/sparse/re-entry/exit reminders
  • Add hasExitedPlanMode and needsPlanModeExitAttachment flags to
    PermissionManager
  • Inject plan mode reminders every 5 human turns (full every 5th,
    sparse otherwise) with override language
  • Inject re-entry guidance when re-entering plan mode with existing
    plan file (one-time)
  • Inject exit notification when leaving plan mode (one-time)
  • Set flags in exitPlanMode.ts and planManager.ts on mode transitions
  • Remove planMode option from buildSystemPrompt()
  • Re-inject full plan mode reminder after compaction
  • Update specs 050, 021, 014, 022 with new user stories and FRs

…prompt

Move plan mode instructions from buildSystemPrompt() into transient
<system-reminder> user messages injected via buildPlanModeMessages()
in AIManager. This preserves the cached system prompt prefix across
mode transitions, matching Claude Code's attachment pattern.

Key changes:
- Add planModeReminders.ts with full/sparse/re-entry/exit reminders
- Add hasExitedPlanMode and needsPlanModeExitAttachment flags to
  PermissionManager
- Inject plan mode reminders every 5 human turns (full every 5th,
  sparse otherwise) with override language
- Inject re-entry guidance when re-entering plan mode with existing
  plan file (one-time)
- Inject exit notification when leaving plan mode (one-time)
- Set flags in exitPlanMode.ts and planManager.ts on mode transitions
- Remove planMode option from buildSystemPrompt()
- Re-inject full plan mode reminder after compaction
- Update specs 050, 021, 014, 022 with new user stories and FRs
@lewis617 lewis617 merged commit 71333cb into main Jun 1, 2026
1 check passed
@lewis617 lewis617 deleted the plan-mode-system-reminder branch June 1, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant