| name | schedule |
| description | Discover files with trigger_phrase and/or refresh frontmatter, let the user choose which to schedule for periodic re-injection via CronCreate. Prevents behavioral drift by keeping core rules and goals fresh in context. |
| user-invocable | true |
Schedule — Periodic Trigger and Rule Injection
Overview
Scan the agent's loaded context for files with trigger_phrase and/or refresh frontmatter. Present candidates to the user in batches of 5. For each selected file, create a CronCreate job that periodically re-injects the trigger phrase (or re-reads the file) to prevent behavioral drift during long sessions.
Why This Exists
During long sessions, core rules and goals fade as context compresses. Agents stop following guidance they loaded 2 hours ago — not because they disagree, but because the content lost attention weight. Periodic re-injection of trigger phrases (5 tokens that reactivate 1000 tokens of rules) keeps agents calibrated without expensive full re-reads.
Frontmatter Schema
Files opt into scheduling with these frontmatter fields:
---
name: some-rule
description: "..."
trigger_phrase:
opus: "broken windows zero tolerance"
sonnet: "quality gate enforcement"
haiku: "no broken windows"
refresh: 15m
---
trigger_phrase — model-scoped phrases generated by total-recall. The schedule injects the phrase matching the current session's model. Cheap (~5 tokens).
refresh — suggested interval for re-injection. User can override during scheduling. Supports: 5m, 10m, 15m, 20m, 30m, 1h.
- Both fields are optional. A file needs at least one to be discovered.
Process
1. Discover Candidates
Scan for .md files that have trigger_phrase and/or refresh in their YAML frontmatter. Search these locations:
.claude/rules/ — project rules
CLAUDE.md — project root instructions
- Loaded skills — any skill
.md files in the current plugin paths
.claude/*.md — any markdown files in the .claude directory
For each file found:
- Read the YAML frontmatter
- Check for
trigger_phrase and/or refresh fields
- If either exists, add to the candidate list
Determine the current model by checking which model this session is running. Use this to select the right trigger phrase from the model-scoped trigger_phrase field.
2. Present to User
If no candidates are found, report: "No files with trigger_phrase or refresh frontmatter found. Run /total-recall:write to add trigger phrases to files, or add refresh: 15m to any rule's frontmatter."
Present candidates in batches of up to 5 via AskUserQuestion (multi-select).
For each candidate, show:
- File path
- Trigger phrase for current model (or "none — will re-read file" if no trigger_phrase)
- Suggested interval from
refresh field (or "no default — you choose")
Example:
"These files can be scheduled for periodic refresh. Select which to activate:"
.claude/rules/broken-windows.md — trigger: "broken windows zero tolerance" — interval: 15m
.claude/rules/error-handling.md — trigger: "boundary validation fail fast" — interval: 20m
plugins/zenflow/skills/collab/SKILL.md — trigger: "collaborative session partnership" — interval: 30m
CLAUDE.md — no trigger, will re-read — interval: 10m
3. Confirm Intervals
After the user selects files, present the intervals for confirmation via AskUserQuestion:
"Confirm intervals for selected files (or adjust):"
For each selected file, show the default interval and let the user override. If no refresh field exists, suggest 20m as a default.
4. Create Schedules
For each confirmed file, create a CronCreate job:
If trigger_phrase exists for the current model:
The injection prompt is compact — just the trigger phrase with minimal framing:
Re-internalize this core rule: "{trigger_phrase}"
Briefly acknowledge what this rule means and confirm you're following it. One sentence.
If no trigger_phrase (only refresh):
The injection prompt re-reads the file:
Re-read and internalize {file_path}. This is a core rule/skill that must stay fresh in your working context.
Briefly confirm you've re-read it and state the key principle. Two sentences max.
CronCreate parameters:
cron: Convert the interval to a cron expression. Avoid :00 and :30 marks (per CronCreate best practices).
prompt: The injection prompt above.
recurring: true
5. Report Created Schedules
After all jobs are created, summarize:
Scheduled refreshes active:
ID File Interval Type
──────── ──────────────────────────────── ──────── ──────────
abc12345 .claude/rules/broken-windows.md 15m trigger
def67890 .claude/rules/error-handling.md 20m trigger
ghi24680 CLAUDE.md 10m re-read
3 refresh jobs active. They'll fire while the session is idle.
Use "cancel the broken-windows refresh" or CronDelete to stop any job.
Jobs expire after 7 days (CronCreate limitation).
Managing Schedules
After initial setup, the user can manage schedules with natural language:
- "What scheduled tasks do I have?" → triggers
CronList
- "Cancel the broken-windows refresh" → triggers
CronDelete
- "Change the CLAUDE.md refresh to every 30 minutes" → delete + recreate
The skill does not need to handle these — Claude's built-in cron management covers them. Just inform the user of the option.
Interval Guidelines
| Content type | Suggested interval | Rationale |
|---|
| Core rules (broken-windows, error-handling) | 10-15m | High-value, small injection cost |
| Skill philosophy (collab, build) | 20-30m | Important but less likely to drift |
| CLAUDE.md | 10-20m | Project-wide instructions, critical |
| Reference docs | 30m-1h | Informational, less calibration-sensitive |
These are suggestions for when users ask. The refresh frontmatter in each file is the authoritative suggestion.
Session Scope
All schedules are session-scoped:
- They die when the session exits
- They only fire while Claude is idle (not mid-response)
- They auto-expire after 7 days
- Re-run
/zenflow:schedule in each new session to re-activate
For cross-session persistence, users should set up Desktop scheduled tasks or Routines (outside this skill's scope).
What Not to Do
- Don't schedule without asking. Every file goes through
AskUserQuestion.
- Don't schedule too aggressively. Injections every 2 minutes flood context. Minimum practical interval is 5m.
- Don't re-read large files on tight intervals. If a file is > 200 lines and has no trigger_phrase, suggest the user run
/total-recall:write first to generate a cheap trigger.
- Don't create duplicate schedules. Check
CronList before creating. If a job already exists for a file, ask the user if they want to replace it.
- Don't inject silently. The injection prompt asks the agent to briefly acknowledge — this makes the refresh visible in the conversation.