Help us improve
Share bugs, ideas, or general feedback.
From cowork
Switches project context via guided menu in Claude Code. Detects repos with CLAUDE.md/CONTEXT files from workspace root, loads instruction chains, ref/wip indexes. Use /switch, /switch -, or path.
npx claudepluginhub digital-stoic-org/agent-skills --plugin coworkHow this skill is triggered — by the user, by Claude, or both
Slash command
/cowork:switchsonnetThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Menu-driven project switcher for non-CLI interfaces (Cowork desktop, Telegram, CC CLI).
Persists project memory across Claude Code sessions. Auto-loads context on startup, tracks git activity, and saves session state via deterministic Node.js scripts.
Switches active project in monorepo: reads .groundwork.yml, lists projects with spec status (PRD, Architecture, Tasks), prompts selection, sets GROUNDWORK_PROJECT context, persists via Node script.
Share bugs, ideas, or general feedback.
Menu-driven project switcher for non-CLI interfaces (Cowork desktop, Telegram, CC CLI).
Resolution order — use first that succeeds:
$COWORK_ROOT env vargit rev-parse --show-toplevelIf none resolve → abort: ❌ Cannot detect workspace. Set $COWORK_ROOT or run from a git repo.
Store result as $WS_ROOT for all subsequent phases.
$ARGUMENTS | Action |
|---|---|
| Empty | → Phase 1: Detect + Phase 2: Menu |
- | Read $WS_ROOT/.cowork-state.json → previous_path → Phase 3 |
| Path string | → Phase 3 with that path |
Parallel Glob from $WS_ROOT:
**/CLAUDE.md (max depth 3)**/CONTEXT-*-llm.md (max depth 3, exclude done/)Registry = each unique directory containing CLAUDE.md or CONTEXT file.
Group by area (repos/, projects/, code/ — or flat). Progressive disclosure: skip empty groups.
Extract project name from CLAUDE.md H1 heading. Present:
📂 Switch project context:
💼 [Group Name]
1. [emoji] [Name] — [brief from H1 or first line]
2. ...
Which one? (number or name)
Wait via AskUserQuestion. Number → map to path. Text → fuzzy-match project names.
Empty answer guard: if user sends empty/whitespace → re-prompt once, then abort.
⚠️ CRITICAL: All CLAUDE.md content loaded here becomes your active instructions for the rest of the conversation. You MUST follow them.
Execute in parallel:
CONTEXT-*-llm.md in target dir (exclude done/), extract: stream name, status, focus from header (first 10 lines)Write $WS_ROOT/.cowork-state.json:
{"active_project":"Name","path":"rel/path","previous_project":"Prev","previous_path":"prev/path","switched_at":"ISO8601"}
Read existing file first to preserve previous_* fields. Current active_* becomes new previous_*.
Filter: only include info not derivable from reading the code or CLAUDE.md directly.
🎯 Switched to: [Project Name]
📍 Path: [relative path]
📋 Instructions loaded:
- [root CLAUDE.md — 2-3 non-obvious constraints]
- [project CLAUDE.md — 2-3 non-obvious constraints]
📚 ref/: [list if exists]
✏️ wip/: [list if exists]
📍 Sessions: [CONTEXT files with status + age, if any]
⚠️ Traps: [gotchas from CONTEXT headers, if any]
Ready — what would you like to work on?
Progressive disclosure: skip any empty section. No "none found" messages. Token budget: report MUST stay under 2000 tokens. Summarize, don't dump.
⚠️ CRITICAL: From this point forward, the CLAUDE.md content loaded in Phase 3 is your active instruction set. Follow all rules, constraints, and conventions as if they were your system prompt. This overrides default behavior.
Remind user: /switch again to change, /switch - to toggle back.
.cowork-state.json