Intent Guardian
Never lose your train of thought again.
Intent Guardian continuously monitors your desktop activity, builds a real-time understanding of what you're working on, and detects when you've been derailed by an interruption and forgotten your original task. When that happens, it nudges you back on track.
The Problem
Knowledge workers are interrupted every 3 minutes on average. After an interruption, it takes ~23 minutes to return to the original task -- and often, you never return at all. Not because the task isn't important, but because you simply forgot.
Intent Guardian solves this by maintaining a task stack -- a living model of what you're doing, what you were doing, and what got interrupted -- so you don't have to.
When to Use
- - You are a multi-tasker who frequently context-switches between apps and tasks
- You often finish replying to a message and think "wait, what was I doing?"
- You want an AI companion that understands your work rhythm, not just your commands
- You want to build long-term awareness of your own focus patterns
Core Capabilities
1. Real-Time Activity Sensing
Polls the active window title and application name to build a continuous activity stream.
macOS:
CODEBLOCK0
With ActivityWatch (richer data):
CODEBLOCK1
With Screen Capture (optional, requires vision model):
CODEBLOCK2
2. Task Stack Maintenance
The agent maintains a task stack in memory/skills/intent-guardian/task_stack.json:
CODEBLOCK3
3. Interruption & Forgetting Detection
The agent analyzes the task stack to detect potential forgetting:
Signals that suggest forgetting:
- - A suspended task has not been resumed for longer than INLINECODE1
- The user has moved through 2+ unrelated contexts since the suspension
- The user shows "wandering" behavior: rapid app-switching without sustained focus
- The suspended task had low completion estimate (was in the middle of something)
Signals that suggest deliberate abandonment (do NOT remind):
- - The user explicitly closed the application associated with the task
- The task was at a natural completion point (e.g., finished sending an email)
- The user started a clearly intentional new deep-work session
4. Gentle Reminders
When forgetting is detected, the agent sends a non-intrusive reminder:
Simple reminder:
"You were working on the product requirements doc (section 3) about 25 minutes ago, before the Slack interruption. Want to go back to it?"
Smart reminder (with context carried forward):
"You left the product requirements doc to look up the useEffect cleanup pattern for Li Si's bug. The answer is: return a cleanup function in useEffect. Ready to bring this back to the doc?"
The second form is more powerful -- it doesn't just remind you what you forgot, it completes the reason you left, so you can return to your main task with the answer in hand.
5. Long-Term Pattern Learning
Over time, the agent builds a focus profile in memory/skills/intent-guardian/focus_profile.json:
CODEBLOCK4
This profile is used to personalize detection thresholds and reminder timing.
Architecture
CODEBLOCK5
Heartbeat Integration
Add to your HEARTBEAT.md:
CODEBLOCK6
Cron Integration
Add a daily focus report:
CODEBLOCK7
Setup
Minimal Setup (macOS, no dependencies)
- 1. Install the skill:
CODEBLOCK8
- 2. The skill uses native macOS commands (
osascript) to get the active window.
No additional software required.
- 3. Add the Heartbeat integration above to your
HEARTBEAT.md.
Enhanced Setup (with ActivityWatch)
- 1. Install ActivityWatch for richer window-level tracking.
- Set
activitywatch_enabled: true in skill config. - ActivityWatch provides detailed per-window timelines including URLs and document titles.
Full Setup (with Screen Capture)
- 1. Set
screen_capture_enabled: true and configure vision_model. - Requires a vision-capable model (Claude, Gemini, Qwen3-VL).
- Screenshots are captured locally, analyzed locally or via API, and never stored permanently.
Privacy & Security
- - All data stays local. Activity logs, task stacks, and focus profiles are stored as local files in your OpenClaw memory directory.
- No raw screenshots are persisted. If screen capture is enabled, frames are analyzed and immediately discarded. Only the semantic summary is kept.
- Excluded apps are respected. Configure
excluded_apps to prevent tracking specific applications. - Working hours enforced. Sensing only runs during configured
working_hours_start to working_hours_end. - You own the data. All files are human-readable JSON/JSONL. Review, edit, or delete at any time.
Configuration Reference
| Key | Type | Default | Description |
|---|
| INLINECODE12 | int | 5 | How often to check the active window |
| INLINECODE13 |
int | 5 | Minutes before a suspended task is flagged as potentially forgotten |
|
reminder_cooldown_minutes | int | 3 | Minimum time between reminders to avoid nagging |
|
max_stack_depth | int | 20 | Maximum tasks to track in the stack |
|
screen_capture_enabled | bool | false | Enable periodic screenshot analysis |
|
screen_capture_interval_seconds | int | 30 | Interval for screenshots (if enabled) |
|
vision_model | string | "" | Model for screenshot analysis (e.g., "gemini", "claude") |
|
activitywatch_enabled | bool | true | Use ActivityWatch for richer activity data |
|
activitywatch_url | string | "http://localhost:5600" | ActivityWatch server URL |
|
notification_channel | string | "system" | Where to send reminders ("system", "telegram", "slack", etc.) |
|
working_hours_start | string | "09:00" | Start of active tracking window |
|
working_hours_end | string | "18:00" | End of active tracking window |
|
excluded_apps | list | ["Finder", "SystemPreferences", "loginwindow"] | Apps to ignore |
Example Interactions
User: "What was I doing before I got sidetracked?"
Agent reads task_stack.json, responds:
"Before the Slack interruption at 14:31, you were writing section 3 of the product requirements doc in Google Docs. You were about 60% through. Want to jump back?"
User: "Show me my task stack"
Agent responds with current stack visualization:
CODEBLOCK9
User: "How's my focus today?"
Agent reads activity log and focus profile:
"Today you've had 6 deep work sessions averaging 18 minutes each. You were interrupted 11 times, mostly by Slack (7 times). You forgot to return to your original task 4 times -- I caught 3 of those. Your peak focus was 09:30-10:45."
Proactive (via Heartbeat):
"Heads up -- you've been away from the quarterly report (Excel) for 40 minutes since that phone call. It's due tomorrow. Want to wrap up the current task and go back to it?"
Integration with Other Skills
Intent Guardian works well alongside these existing skills:
| Skill | Integration |
|---|
| INLINECODE25 | Feed focus_profile data into analytics for richer weekly reports |
| INLINECODE26 |
Include task completion stats and interruption counts in daily reviews |
|
deepwork-tracker | Auto-start deepwork timer when sustained focus is detected |
|
screen-monitor | Use screen_analyze for richer context when vision model is configured |
|
rememberall | Convert suspended tasks into time-based reminders as fallback |
|
get-focus-mode | Suppress reminders when macOS Focus mode is active |
Roadmap
- - [ ] Cross-device sync (remind on phone about tasks left on laptop)
- [ ] Team mode (with consent: "Zhang San is waiting for your review, 2 days now")
- [ ] Proactive task delegation ("I can draft that email reply while you focus on the doc")
- [ ] Calendar-aware urgency ("The quarterly report meeting is in 2 hours, and you're only 60% done")
- [ ] Intent hierarchy (L1-L4 goal tracking, not just immediate tasks)
License
MIT
意图守护者
再也不会忘记你的思路。
意图守护者持续监控你的桌面活动,实时构建对你当前工作内容的理解,并检测你是否因干扰而偏离原任务并忘记了最初的目标。当这种情况发生时,它会轻轻地将你拉回正轨。
问题所在
知识工作者平均每3分钟被打断一次。每次被打断后,需要约23分钟才能回到原任务——而且很多时候,你根本不会再回去。不是因为任务不重要,而是因为你真的忘了。
意图守护者通过维护一个任务栈来解决这个问题——这是一个关于你正在做什么、你之前做了什么以及什么被打断了的实时模型——这样你就不必自己记住了。
何时使用
- - 你是一个多任务处理者,经常在应用和任务之间切换上下文
- 你经常回复完一条消息后想等等,我刚才在做什么?
- 你想要一个理解你工作节奏的AI伴侣,而不仅仅是你的指令
- 你想要建立对自己专注模式的长期认知
核心能力
1. 实时活动感知
轮询活动窗口标题和应用程序名称,构建连续的活动流。
macOS:
bash
bash command:scripts/sense_activity.sh
使用ActivityWatch(更丰富的数据):
bash
bash command:scripts/sense_activitywatch.sh
使用屏幕截图(可选,需要视觉模型):
bash
bash command:scripts/sense_screen.sh
2. 任务栈维护
代理在 memory/skills/intent-guardian/task_stack.json 中维护一个任务栈:
json
{
stack: [
{
id: task_001,
intent: 编写产品需求文档,第3节,
app: Google Docs,
window_title: 产品需求 v2 - Google Docs,
started_at: 2026-02-26T14:28:00,
status: suspended,
suspended_at: 2026-02-26T14:31:00,
suspended_by: 来自李四的Slack通知,
completion_estimate: 0.6
},
{
id: task_002,
intent: 回复李四关于API错误的问题,
app: Slack,
window_title: Slack - #engineering,
started_at: 2026-02-26T14:31:00,
status: completed,
completed_at: 2026-02-26T14:35:00
},
{
id: task_003,
intent: 查找React useEffect清理模式,
app: Chrome,
window_title: Stack Overflow - React useEffect cleanup,
started_at: 2026-02-26T14:35:00,
status: active
}
],
currentfocus: task003,
forgottencandidates: [task001]
}
3. 中断与遗忘检测
代理分析任务栈以检测潜在的遗忘:
表明遗忘的信号:
- - 一个挂起的任务在超过 interruptionthresholdminutes 后仍未恢复
- 用户自挂起以来已经切换了2个以上不相关的上下文
- 用户表现出游荡行为:快速切换应用而没有持续专注
- 挂起的任务完成度估计较低(正在做某事的中途)
表明有意放弃的信号(不要提醒):
- - 用户明确关闭了与任务关联的应用程序
- 任务处于自然的完成点(例如,发送完邮件)
- 用户开始了一个明确意图的新深度工作会话
4. 温和提醒
当检测到遗忘时,代理会发送一个非侵入式的提醒:
简单提醒:
大约25分钟前,在Slack中断之前,你正在编写产品需求文档(第3节)。想回去继续吗?
智能提醒(携带上下文):
你离开产品需求文档去为李四的错误查找useEffect清理模式。答案是:在useEffect中返回一个清理函数。准备好把这个答案带回文档了吗?
第二种形式更强大——它不仅提醒你忘记了什么,还完成了你离开的原因,这样你就可以带着答案回到主要任务。
5. 长期模式学习
随着时间的推移,代理会在 memory/skills/intent-guardian/focus_profile.json 中构建一个专注档案:
json
{
user_id: default,
updated_at: 2026-02-26,
patterns: {
avgfocusduration_minutes: 12,
interruption_sources: {
Slack: { count: 45, forget_rate: 0.78 },
Mail: { count: 22, forget_rate: 0.18 },
Chrome: { count: 31, forget_rate: 0.42 }
},
peakfocushours: [09:00-11:00, 14:00-16:00],
highrisktransitions: [
{ from: VSCode, to: Slack, forget_rate: 0.82 },
{ from: Google Docs, to: Chrome, forget_rate: 0.55 }
],
reminder_effectiveness: {
accepted: 34,
dismissed: 8,
ignored: 5
}
}
}
这个档案用于个性化检测阈值和提醒时机。
架构
你的桌面
|
v
[感知层] ---- scripts/sense_activity.sh (窗口标题,每N秒)
| scripts/sense_activitywatch.sh (ActivityWatch API)
| scripts/sense_screen.sh (可选截图 + 视觉)
v
[活动日志] ---- memory/skills/intent-guardian/activity_log.jsonl
|
v
[理解] ---- LLM在每个心跳时分析活动流:
| - 将活动分段为逻辑任务
| - 推断每个任务的意图
| - 检测中断和上下文切换
v
[任务栈] ---- memory/skills/intent-guardian/task_stack.json
|
v
[检测] ---- 将栈状态与遗忘启发式规则进行比较
| 参考 focus_profile.json 获取个性化阈值
v
[提醒] ---- 通过配置的通知渠道发送提醒
| 记录用户响应以形成反馈循环
v
[学习] ---- 用新模式更新 focus_profile.json
心跳集成
添加到你的 HEARTBEAT.md:
markdown
意图守护者检查
每次心跳,运行意图守护者循环:
- 1. 从 memory/skills/intent-guardian/activitylog.jsonl 读取最新活动
- 用新活动更新 taskstack.json
- 检查遗忘的任务(挂起超过阈值,未恢复)
- 如果检测到遗忘任务,发送提醒
- 将任何提醒响应记录到 focus_profile.json
Cron集成
添加每日专注报告:
bash
openclaw cron add --name intent-guardian-daily --schedule 0 18 * \
--prompt 使用意图守护者数据生成我的每日专注报告
设置
最小设置(macOS,无依赖)
- 1. 安装技能:
bash
npx playbooks add skill openclaw/skills --skill intent-guardian
- 2. 该技能使用原生macOS命令(osascript)获取活动窗口。
无需额外软件。
- 3. 将上述心跳集成添加到你的 HEARTBEAT.md。
增强设置(使用ActivityWatch)
- 1. 安装 ActivityWatch 以获得更丰富的窗口级跟踪。
- 在技能配置中设置 activitywatchenabled: true。
- ActivityWatch 提供详细的每个窗口时间线,包括URL和文档标题。
完整设置(使用屏幕截图)
- 1. 设置 screencaptureenabled: true 并配置 vision_model。
- 需要支持视觉的模型(Claude、Gemini、Qwen3-VL)。
- 截图在本地捕获,在本地或通过API分析,从不永久存储。
隐私与安全
- - 所有数据保留在本地。 活动日志、任务栈和专注档案作为本地文件存储在你的OpenClaw内存目录中。
- 不保留原始截图。 如果启用了屏幕捕获,帧会被分析并立即丢弃。只保留语义摘要。
- 排除的应用得到尊重。 配置 excludedapps 以防止跟踪特定应用程序。
- 工作时间强制执行。 感知仅在配置的 workinghoursstart 到 workinghours_end 期间运行。
- 你拥有数据。 所有文件都是人类可读的JSON/JSONL