Context Switcher
A skill that shifts your entire OpenClaw experience based on the mode of life you're in. Not just a label — each mode reshapes priorities, filters notifications, loads the right memory, and auto-restores when the session ends.
External Endpoints
| Endpoint | Purpose | Data Sent |
|---|
| None | This skill is fully local | Nothing leaves your machine |
This skill does not call any external APIs. All state is stored locally in ~/.openclaw/skills/context-switcher/.
Security & Privacy
- - No external calls. Zero data is sent outside your machine.
- No credentials required. No API keys, tokens, or env vars needed.
- Local state only. Mode state is written to
current-context.json on your local filesystem. - Notification control relies on OpenClaw's built-in notification layer — no third-party access.
- Calendar reading uses OpenClaw's existing calendar integration if connected — this skill does not add new calendar permissions.
Trust Statement: This skill operates entirely on your local machine. No data is transmitted to any external service. Install with confidence.
Model Invocation Note
This skill may be invoked autonomously by OpenClaw when a trigger phrase is detected in your messages, or when a calendar event title matches a known mode keyword. You can disable auto-invocation at any time by saying "turn off context-switcher auto-trigger".
Modes
🧠 Work / Focus
Trigger phrases: "work mode", "focus mode", "I need to focus", "starting deep work", "heads down", "switch to work"
Behavior:
- - Mute all non-urgent notifications (personal messages, social, news)
- Surface today's work tasks, open threads, and meeting schedule from INLINECODE2
- Load work memory: current projects, deadlines, blockers, team context
- Respond concisely — task-oriented, no small talk, bullet points are fine
- Proactively flag time conflicts or approaching deadlines if detected
- Set auto-restore timer to next calendar event end time, or user-specified duration
Auto-trigger from calendar: event titles containing "standup", "sprint", "review", "interview", "deadline", "sync", "planning"
🏠 Personal
Trigger phrases: "personal mode", "personal time", "I'm off the clock", "home mode", "family time", "done for the day"
Behavior:
- - Mute work-related notifications (work Slack, GitHub, work email)
- Surface personal tasks: errands, upcoming events, health goals from INLINECODE3
- Load personal memory: household tasks, personal goals, important people
- Respond warmly and conversationally — no corporate tone
- Do not proactively surface work items unless explicitly asked
Auto-trigger from calendar: event titles containing "gym", "dinner", "family", "personal", "vacation", "appointment", "errand"
🎨 Creative
Trigger phrases: "creative mode", "creative session", "I'm creating", "brainstorm mode", "ideation time", "let's build"
Behavior:
- - Mute all notifications — zero interruptions
- Surface creative context from
modes/creative.md: active projects, saved ideas, references - Load creative memory: current projects, style notes, open creative loops
- Respond expansively — "yes, and..." style, encourage tangents and exploration
- Never filter or critique ideas unless explicitly asked
- Offer unexpected connections and lateral thinking prompts
Auto-trigger from calendar: event titles containing "writing", "design", "recording", "art", "brainstorm", "creative", "draft"
🔕 Do Not Disturb
Trigger phrases: "DND", "do not disturb", "going dark", "don't bother me", "full silence", "leave me alone"
Behavior:
- - Mute ALL notifications without exception
- Do not proactively surface anything
- Only respond if directly addressed by name or keyword
- Log all incoming messages and tasks silently to
snapshots/dnd-log.json for review on exit - No auto-restore unless user sets an explicit timer
Auto-trigger from calendar: event titles containing "blocked", "deep work", "no meetings", "offline", "focus block", "DND"
Switching Logic
When a context switch is detected (via phrase or calendar):
- 1. Identify target mode from trigger phrase or calendar event title
- Save current state — snapshot active memory focus to INLINECODE6
- Apply mode profile — load the correct
modes/*.md, apply notification rules, set response style - Confirm switch with a brief, mode-appropriate message (see Confirmation Messages below)
- Set auto-restore — use calendar event end time, or ask user for duration if unclear
- On restore — un-mute, reload previous state, deliver catch-up summary
Confirmation Messages
Short and mode-appropriate:
- - Work/Focus: "Focus mode on. Notifications muted. Here's what needs your attention: [task summary]. I'll restore at [time]."
- Personal: "Personal mode on. Work notifications paused. Here's your afternoon: [personal summary]."
- Creative: "Creative mode. Silence on. Let's build something. What are we working on?"
- DND: "DND on. I'll log everything. See you on the other side."
Auto-Restore
When a session ends (timer fires or calendar event ends):
- 1. Un-mute notifications and restore previous memory context
- Deliver a brief "while you were away" summary — messages received, tasks that came in, anything time-sensitive
- Ask if user wants to stay in current mode or switch back
Example Interactions
CODEBLOCK0
File Structure
CODEBLOCK1
Setup
On first run, OpenClaw will prompt you to:
- 1. Customize each mode profile in
modes/*.md — add your actual projects, priorities, and people - Set default durations per mode (fallback if no calendar event found)
- Optionally connect your calendar for auto-trigger support
You can re-run setup at any time by saying: "reconfigure context-switcher".
上下文切换器
一项根据您当前生活模式切换整个OpenClaw体验的技能。这不仅仅是一个标签——每种模式都会重新调整优先级、过滤通知、加载相应的记忆,并在会话结束时自动恢复。
外部端点
| 端点 | 用途 | 发送的数据 |
|---|
| 无 | 本技能完全本地运行 | 没有任何数据离开您的设备 |
本技能不调用任何外部API。所有状态均存储在本地 ~/.openclaw/skills/context-switcher/ 目录中。
安全与隐私
- - 无外部调用。 零数据被发送到您的设备之外。
- 无需凭证。 无需API密钥、令牌或环境变量。
- 仅本地状态。 模式状态写入本地文件系统中的 current-context.json 文件。
- 通知控制 依赖OpenClaw内置的通知层——无第三方访问。
- 日历读取 如果已连接,则使用OpenClaw现有的日历集成——本技能不添加新的日历权限。
信任声明: 本技能完全在您的本地设备上运行。没有任何数据传输到任何外部服务。请放心安装。
模型调用说明
当在您的消息中检测到触发短语,或日历事件标题与已知模式关键词匹配时,OpenClaw可能会自主调用本技能。您随时可以通过说关闭上下文切换器自动触发来禁用自动调用。
模式
🧠 工作/专注
触发短语: 工作模式、专注模式、我需要专注、开始深度工作、埋头苦干、切换到工作
行为:
- - 静音所有非紧急通知(个人消息、社交、新闻)
- 从 modes/work.md 中展示今日工作任务、进行中的讨论和会议安排
- 加载工作记忆:当前项目、截止日期、障碍、团队上下文
- 简洁回应——以任务为导向,不闲聊,可使用要点形式
- 如检测到时间冲突或即将到来的截止日期,主动标记
- 设置自动恢复计时器至下一个日历事件结束时间,或用户指定的时长
从日历自动触发: 事件标题包含站会、冲刺、评审、面试、截止日期、同步、规划
🏠 个人
触发短语: 个人模式、个人时间、我下班了、家庭模式、家庭时间、今天结束了
行为:
- - 静音工作相关通知(工作Slack、GitHub、工作邮件)
- 展示个人任务:杂事、即将到来的活动、健康目标(来自 modes/personal.md)
- 加载个人记忆:家务任务、个人目标、重要人物
- 温暖且对话式地回应——不使用职场语气
- 除非明确询问,否则不主动展示工作事项
从日历自动触发: 事件标题包含健身、晚餐、家庭、个人、假期、预约、杂事
🎨 创意
触发短语: 创意模式、创意时段、我在创作、头脑风暴模式、构思时间、让我们创造
行为:
- - 静音所有通知——零干扰
- 从 modes/creative.md 中展示创意上下文:进行中的项目、保存的想法、参考资料
- 加载创意记忆:当前项目、风格笔记、未完成的创意循环
- 扩展式回应——是的,而且...风格,鼓励发散和探索
- 除非明确要求,否则从不过滤或批评想法
- 提供意想不到的联系和横向思维提示
从日历自动触发: 事件标题包含写作、设计、录制、艺术、头脑风暴、创意、草稿
🔕 请勿打扰
触发短语: 免打扰、请勿打扰、隐身、别烦我、完全静音、让我一个人待着
行为:
- - 静音所有通知,无一例外
- 不主动展示任何内容
- 仅在被直接称呼姓名或关键词时回应
- 将所有传入消息和任务静默记录到 snapshots/dnd-log.json 中,供退出时查看
- 除非用户设置明确计时器,否则不自动恢复
从日历自动触发: 事件标题包含已屏蔽、深度工作、无会议、离线、专注时段、免打扰
切换逻辑
当检测到上下文切换时(通过短语或日历):
- 1. 识别目标模式 从触发短语或日历事件标题
- 保存当前状态 — 将活动记忆焦点快照到 snapshots/pre-switch-state.json
- 应用模式配置 — 加载相应的 modes/*.md,应用通知规则,设置回应风格
- 确认切换 使用简短且符合模式的提示信息(见下方确认消息)
- 设置自动恢复 — 使用日历事件结束时间,或如果不明确则询问用户时长
- 恢复时 — 取消静音,重新加载之前的状态,提供补录摘要
确认消息
简短且符合模式:
- - 工作/专注: 专注模式已开启。通知已静音。以下是您需要关注的事项:[任务摘要]。我将在[时间]恢复。
- 个人: 个人模式已开启。工作通知已暂停。以下是您的下午安排:[个人摘要]。
- 创意: 创意模式。静音已开启。让我们创造点什么。我们在做什么?
- 免打扰: 免打扰已开启。我会记录一切。回头见。
自动恢复
当会话结束时(计时器触发或日历事件结束):
- 1. 取消静音通知并恢复之前的记忆上下文
- 提供简短的您不在时摘要——收到的消息、新来的任务、任何时间敏感事项
- 询问用户是否想保持在当前模式或切换回去
交互示例
切换到专注模式2小时
→ 静音通知,展示工作任务,设置2小时恢复计时器
创意模式——我在写小说
→ 加载创意记忆,静音一切,扩展式回应
免打扰直到下一个会议
→ 读取日历,设置恢复到下一个事件开始,完全静音
个人时间,我今天结束了
→ 暂停工作频道,展示晚间个人任务
我现在是什么模式?
→ 报告当前模式、活动时长、计划恢复时间
提前退出专注模式
→ 恢复之前状态,提供补录摘要
文件结构
context-switcher/
├── SKILL.md ← 您在此处
├── README.md ← 安装指南
├── current-context.json ← 实时模式状态跟踪器
├── modes/
│ ├── work.md ← 自定义您的工作配置
│ ├── personal.md ← 自定义您的个人配置
│ └── creative.md ← 自定义您的创意配置
├── scripts/
│ ├── switch.sh ← 核心切换逻辑
│ ├── restore.sh ← 自动恢复处理器
│ └── summarize.sh ← 补录摘要生成器
└── snapshots/
├── pre-switch-state.json ← 每次切换前保存的状态
└── dnd-log.json ← 免打扰期间记录的消息
设置
首次运行时,OpenClaw将提示您:
- 1. 自定义 modes/*.md 中的每个模式配置——添加您实际的项目、优先级和人员
- 设置每种模式的默认时长(如果未找到日历事件时的回退值)
- 可选地连接您的日历以支持自动触发
您可以随时通过说重新配置上下文切换器来重新运行设置。