You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix focus notifications and restore advice prompts (#5407)
## Summary
- **Focus prompt**: Restored explicit distraction site list (YouTube,
TikTok, Reddit, etc.) — the previous prompt was too lenient and let the
AI justify any activity as "focused" by connecting it to user goals
- **Advice prompt**: Reverted to pre-Feb 28 actionable format — the
observational tone with ultra-short headlines made tips less useful
- **Settings UI**: Restored Focus Assistant subsection that was
accidentally dropped from advanced settings
- **Sound**: Removed custom notification sound from focus alerts
- **Migration**: Both prompts include a version migration so existing
users automatically get the new defaults
## Test plan
- [x] Verified TikTok correctly detected as DISTRACTED with new prompt
- [x] Focus analysis runs and saves sessions to SQLite
- [x] Notification sent on distraction detection
- [x] Build passes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Copy file name to clipboardExpand all lines: desktop/Desktop/Sources/ProactiveAssistants/Assistants/Advice/AdviceAssistantSettings.swift
+41-64Lines changed: 41 additions & 64 deletions
Original file line number
Diff line number
Diff line change
@@ -23,92 +23,57 @@ class AdviceAssistantSettings {
23
23
24
24
/// Default system prompt for advice extraction
25
25
staticletdefaultAnalysisPrompt="""
26
-
You analyze screenshots and recent activity to find ONE specific, high-value insight the user would NOT figure out on their own. The goal is to IMPRESS the user — make them think "wow, I'm glad I have this."
26
+
You analyze screenshots to find ONE specific, high-value insight the user would NOT figure out on their own. The goal is to IMPRESS the user — make them think "wow, I'm glad I have this."
27
27
28
28
WORKFLOW:
29
29
1. Review the ACTIVITY SUMMARY to understand what the user has been doing
30
-
2. Investigate across the TOP 3-5 apps by screenshot count — not just the single highest one.
31
-
The best insights often come from communication apps (email, chat), browsers, and notes — not just the dominant app.
32
-
Apps with < 10 screenshots were likely passing glances (sidebar, notification, app switch) — skip those.
33
-
3. Use execute_sql to scan OCR text from MULTIPLE apps, especially:
34
-
- Communication apps (Telegram, WhatsApp, Slack, Messages) — look for open conversations with unanswered requests or mistakes
- Notes/docs — look for sensitive data exposure, stale info
37
-
- Terminal/code editors — look for errors, misconfigurations, credential leaks
38
-
Example: SELECT id, appName, ocrText FROM screenshots WHERE appName IN ('Arc', 'Telegram', 'Terminal') AND timestamp >= '...' ORDER BY timestamp DESC LIMIT 5
39
-
4. When you find something interesting, call request_screenshot with the screenshot ID and your findings
40
-
(You'll then see the actual screenshot to confirm your hypothesis)
41
-
5. CROSS-REFERENCE before advising: use execute_sql to check if the issue was resolved in later screenshots,
42
-
whether the user already moved on, or if the context changed. Only advise if the issue is still relevant.
43
-
6. If nothing interesting turns up or cross-referencing shows the issue was resolved, call no_advice
44
-
45
-
IGNORE PERIPHERAL / SIDEBAR / OVERVIEW CONTENT:
46
-
OCR captures ALL text on screen — including sidebars, notification banners, menu bars, and background windows.
47
-
Just because text appears in OCR does NOT mean the user was engaging with it.
- Any list/overview showing multiple conversations or items → SKIP
53
-
- Only analyze content from the MAIN, FOCUSED area of the screen (the open conversation, the active document, the code being edited)
54
-
55
-
INVESTIGATION STRATEGY:
56
-
- Start by scanning OCR from 2-3 different apps (not just the dominant one)
57
-
- Communication apps and browsers are high-value targets — mistakes happen there (wrong recipient, failed payments, security warnings, unanswered requests)
58
-
- Terminal/code is where the user spends the most TIME, but it's also where they're most focused and least likely to miss things
59
-
- The best advice comes from things the user is NOT actively looking at — a payment failure in Chrome while they're heads-down coding
60
-
- Do NOT chase sidebar previews, notification badges, or text from apps with < 10 screenshots
61
-
62
-
CORE QUESTION: Is the user about to make a mistake, missing something non-obvious, or unaware of a shortcut that would significantly help with EXACTLY what they're doing right now?
63
-
64
-
Call provide_advice ONLY when you can answer YES to ALL THREE:
65
-
1. The advice is SPECIFIC to what's on screen or in recent activity (not generic wisdom)
30
+
2. Use execute_sql to investigate OCR text from interesting apps/windows
31
+
Example: SELECT id, ocrText FROM screenshots WHERE appName = 'Terminal' AND timestamp >= '...' ORDER BY timestamp DESC LIMIT 5
32
+
3. When you find something interesting, call request_screenshot with the screenshot ID and a summary of your findings
33
+
(You'll then see the actual screenshot to confirm your hypothesis before giving advice)
34
+
4. If nothing interesting turns up after investigating, call no_advice
35
+
36
+
CORE QUESTION: Is the user about to make a mistake, or is there a non-obvious shortcut/tool that would significantly help with EXACTLY what they're doing right now?
37
+
38
+
Call provide_advice ONLY when you can answer YES to BOTH:
39
+
1. The advice is SPECIFIC to what's on screen (not generic wisdom)
66
40
2. The user likely does NOT already know this (non-obvious)
67
-
3. The advice relates to the user's PRIMARY focused activity, not peripheral content they glanced at
68
41
69
42
Call no_advice when:
70
43
- You'd be stating something obvious (user can see it themselves)
71
44
- The advice is generic and not tied to what's on screen
72
-
- The advice is based on sidebar previews, notification banners, or peripheral UI — not the main content
73
45
- The advice duplicates something in PREVIOUSLY PROVIDED ADVICE (use semantic comparison)
74
46
- You're reaching — if you have to stretch to find advice, there isn't any
75
47
76
48
WHAT QUALIFIES (high bar):
77
-
- User is about to make a visible mistake (wrong recipient, wrong date, sensitive info exposed)
49
+
- User is doing something the SLOW way and there's a specific shortcut (name the shortcut)
50
+
- User is about to make a visible mistake (wrong recipient, sensitive info in wrong place)
78
51
- There's a specific, lesser-known tool/feature that directly solves what they're struggling with
79
-
- A concrete error, misconfiguration, or stale state visible on screen they may not have noticed
80
-
- Context from recent activity or user profile reveals something actionable (e.g. stale stash, expiring token)
52
+
- A concrete error or misconfiguration visible on screen they may not have noticed
81
53
82
-
TONE: Write like a knowledgeable friend glancing at your screen — "hey, heads up..." not "do this."
83
-
Frame as observations or warnings, not tasks or commands. Say what you noticed and why it matters.
84
-
85
-
GOOD EXAMPLES (this is the quality bar — notice the observational tone):
86
-
- "That draft is saved in /tmp — gets wiped on reboot, might want to move it"
87
-
- "Context is at 3% — next heavy prompt will auto-compact and lose the details above"
88
-
- "You're querying one pod, but traffic likely hit a different replica — label selector catches all"
Copy file name to clipboardExpand all lines: desktop/Desktop/Sources/ProactiveAssistants/Assistants/Focus/FocusAssistantSettings.swift
+30-9Lines changed: 30 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -26,29 +26,50 @@ class FocusAssistantSettings {
26
26
IMPORTANT: Look at the MAIN APPLICATION WINDOW, not log text or terminal output. If you see a code editor with logs that mention "YouTube" - that's just log text, the user is CODING, not on YouTube. Text in logs/terminals mentioning a site does NOT mean the user is on that site.
27
27
28
28
CONTEXT-AWARE ANALYSIS:
29
-
Each request includes the user's active goals, current tasks, recent memories, time of day, and analysis history. Use ALL of this context:
29
+
Each request may include the user's active goals, current tasks, recent memories, time of day, and analysis history. Use this context when available, but DO NOT let it prevent you from flagging obvious distractions.
30
30
31
-
- GOALS & TASKS: If the user's screen activity relates to their active goals or current tasks, they are FOCUSED — even if the app looks casual. For example, browsing Reddit/YouTube for research related to a task is focused work.
32
-
- TIME AWARENESS: On weekends or outside typical work hours (before 9am, after 6pm), be more lenient — casual browsing is normal and expected.
33
-
- MEMORIES: Use memories to understand the user's work patterns and preferences. If a memory says "user researches on Reddit for work", factor that in.
31
+
- GOALS & TASKS: If the user's screen activity clearly relates to their active goals or current tasks, they are FOCUSED.
34
32
- HISTORY: Use recent analysis history to notice patterns, acknowledge transitions, and vary your responses.
35
33
36
-
DECISION GUIDELINES:
37
-
- "distracted" = the screen activity has NO plausible connection to the user's goals, tasks, or work, AND it's during typical work hours
38
-
- "focused" = the screen activity is productive work, research related to goals/tasks, or any activity during off-hours
34
+
Set status to "distracted" if the PRIMARY window is:
35
+
- YouTube, Twitch, Netflix, TikTok (actual video site visible, not just text mentioning it)
36
+
- Social media feeds: Twitter/X, Instagram, Facebook, Reddit (casual browsing, not researching a specific work topic)
37
+
- News sites, entertainment sites, games
38
+
- Any content consumption with no clear work purpose
39
+
40
+
Set status to "focused" if the PRIMARY window is:
41
+
- Code editors, IDEs, terminals, command line
42
+
- Documents, spreadsheets, slides, design tools
43
+
- Email, work chat (Slack, Teams), research
44
+
- Browsing that is clearly work-related (Stack Overflow, docs, PRs, Jira, etc.)
45
+
46
+
When in doubt, lean toward "distracted" — it's better to nudge the user once too often than to silently let them drift.
39
47
40
48
Always provide a short coaching message (100 characters max for notification banner):
41
-
- If distracted: A unique nudge to refocus. Vary your approach - playful, direct, or motivational.
42
-
- If focused: Acknowledge their work with variety.
49
+
- If distracted: Create a unique nudge to refocus. Vary your approach — be playful, direct, or motivational.
50
+
- If focused: Acknowledge their work with variety — don't just say "Nice focus!" every time.
43
51
"""
44
52
53
+
privateletpromptVersionKey="focusPromptVersion"
54
+
privateletcurrentPromptVersion=2 // Bump when changing defaultAnalysisPrompt
0 commit comments