Browse Source

refactor: Remove submodules, consolidate commands as canonical source

- Remove git submodules (session-manager, g-slave)
- Archive deprecated session-manager to commands/archive/
- Add evolved session commands: sync, loadplan, saveplan, showplan
- Flatten g-slave from submodule to direct file
- Update README with new command structure and workflow
- This repo is now the canonical source, deploys to ~/.claude/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
0xDarkMatter 5 months ago
parent
commit
a180730303

+ 0 - 6
.gitmodules

@@ -1,6 +0,0 @@
-[submodule "commands/g-slave"]
-	path = commands/g-slave
-	url = https://github.com/0xDarkMatter/g-slave.git
-[submodule "commands/session-manager"]
-	path = commands/session-manager
-	url = https://github.com/0xDarkMatter/session-manager.git

+ 23 - 20
README.md

@@ -19,23 +19,22 @@ claude-mods/
 
 **Linux/macOS:**
 ```bash
-git clone --recursive https://github.com/0xDarkMatter/claude-mods.git
+git clone https://github.com/0xDarkMatter/claude-mods.git
 cd claude-mods
 ./install.sh
 ```
 
 **Windows (PowerShell):**
 ```powershell
-git clone --recursive https://github.com/0xDarkMatter/claude-mods.git
+git clone https://github.com/0xDarkMatter/claude-mods.git
 cd claude-mods
 .\install.ps1
 ```
 
 ### Manual Install
 
-Clone with submodules:
 ```bash
-git clone --recursive https://github.com/0xDarkMatter/claude-mods.git
+git clone https://github.com/0xDarkMatter/claude-mods.git
 ```
 
 Then symlink or copy to your Claude directories:
@@ -49,14 +48,17 @@ Then symlink or copy to your Claude directories:
 
 | Command | Description |
 |---------|-------------|
-| [g-slave](commands/g-slave/) | Dispatch Gemini CLI to analyze large codebases. Gemini does the grunt work, Claude gets the summary. |
-| [agent-genesis](commands/agent-genesis.md) | Generate Claude Code expert agent prompts for any technology platform. |
-| [save](commands/save.md) | Save session state before ending. Creates claude-state.json and claude-progress.md for session continuity. |
-| [load](commands/load.md) | Load session context from saved state. Shows what changed, suggests next action. |
+| [sync](commands/sync.md) | Session bootstrap - read project context (README, AGENTS, docs, skills, agents). Quick orientation. |
+| [loadplan](commands/loadplan.md) | Restore plan session state. Loads TodoWrite tasks, plan progress from saved state. |
+| [saveplan](commands/saveplan.md) | Save plan session state. Persists TodoWrite tasks, current plan step, and git context. |
+| [showplan](commands/showplan.md) | Show plan status: progress, active tasks, git state. Quick read-only view. |
 | [plan](commands/plan.md) | Create and persist project plans. Captures Plan Mode state and writes to git-trackable PLAN.md. |
+| [g-slave](commands/g-slave.md) | Dispatch Gemini CLI to analyze large codebases. Gemini does the grunt work, Claude gets the summary. |
+| [agent-genesis](commands/agent-genesis.md) | Generate Claude Code expert agent prompts for any technology platform. |
 | [review](commands/review.md) | Code review staged changes or specific files. Analyzes bugs, security, performance, style. |
 | [test](commands/test.md) | Generate tests with automatic framework detection (Jest, Vitest, pytest, etc.). |
 | [explain](commands/explain.md) | Deep explanation of complex code, files, or concepts. Architecture, data flow, design decisions. |
+| [init-tools](commands/init-tools.md) | Initialize and verify CLI tool dependencies for skills. |
 
 ### Skills
 
@@ -133,7 +135,7 @@ just stats        # Count extensions
 just list-agents  # List all agents
 ```
 
-## Session Continuity: `/save` + `/load`
+## Session Continuity
 
 These commands fill a gap in Claude Code's native session management.
 
@@ -141,7 +143,7 @@ These commands fill a gap in Claude Code's native session management.
 
 TodoWrite tasks are stored at `~/.claude/todos/[session-id].json` and deleted when the session ends. This is intentional.
 
-**The solution:** `/save` and `/load` implement the pattern from Anthropic's [Effective Harnesses for Long-Running Agents](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents):
+**The solution:** `/saveplan` and `/loadplan` implement the pattern from Anthropic's [Effective Harnesses for Long-Running Agents](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents):
 
 > "Every subsequent session asks the model to make incremental progress, then leave structured updates."
 
@@ -154,23 +156,26 @@ TodoWrite tasks are stored at `~/.claude/todos/[session-id].json` and deleted wh
 | TodoWrite tasks | **No** | Deleted on session end |
 | Plan Mode state | **No** | In-memory only |
 
-### How `/save` + `/load` Works
+### Session Workflow
 
 ```
 Session 1:
+  /sync                              # Bootstrap - read project context
   [work on tasks]
-  /save "Stopped at auth module"    # Writes .claude/claude-state.json + claude-progress.md
+  /saveplan "Stopped at auth module" # Writes .claude/claude-state.json
 
 Session 2:
-  /load                              # Restores TodoWrite, shows git diff, suggests next action
+  /sync                              # Read project context
+  /loadplan                          # Restore TodoWrite, show what changed
   → "In progress: Auth module refactor"
   → "Notes: Stopped at auth module"
+  /showplan                          # Quick status check anytime
 ```
 
 ### Why Not Just Use `--resume`?
 
-| Feature | `--resume` | `/save` + `/load` |
-|---------|------------|-------------------|
+| Feature | `--resume` | `/saveplan` + `/loadplan` |
+|---------|------------|---------------------------|
 | Conversation history | Yes | No |
 | TodoWrite tasks | **No** | Yes |
 | Git context | No | Yes |
@@ -179,17 +184,15 @@ Session 2:
 | Works across machines | No | Yes (if committed) |
 | Team sharing | No | Yes |
 
-**Use both together:** `claude --resume` for conversation context, `/load` for task state.
+**Use both together:** `claude --resume` for conversation context, `/loadplan` for task state.
 
 ## Updating
 
-Pull updates including submodules:
 ```bash
-git pull --recurse-submodules
-git submodule update --remote
+git pull
 ```
 
-Then re-run the install script.
+Then re-run the install script to update your global Claude configuration.
 
 ## License
 

+ 21 - 0
commands/archive/session-manager/LICENSE

@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2025
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 310 - 0
commands/archive/session-manager/README.md

@@ -0,0 +1,310 @@
+# Session Manager
+
+Unified session management for Claude Code. Persist state, track progress, resume seamlessly.
+
+## The Problem
+
+Claude Code doesn't persist everything across sessions:
+
+```
+┌─────────────────────────────────────────────────────────────┐
+│                What Persists?                                │
+├──────────────────────────┬──────────────────────────────────┤
+│ ✓ Conversation history   │ Use: claude --resume             │
+│ ✓ CLAUDE.md context      │ File: ./CLAUDE.md                │
+├──────────────────────────┼──────────────────────────────────┤
+│ ✗ TodoWrite tasks        │ Deleted on session end           │
+│ ✗ Plan Mode thinking     │ In-memory only                   │
+│ ✗ "Where was I?"         │ Lost context                     │
+└──────────────────────────┴──────────────────────────────────┘
+```
+
+## The Solution
+
+Three commands that work together:
+
+```
+┌─────────────────────────────────────────────────────────────┐
+│                  Session Lifecycle                           │
+├─────────────────────────────────────────────────────────────┤
+│                                                             │
+│     START              WORK                END              │
+│       │                  │                  │               │
+│       ▼                  ▼                  ▼               │
+│   ┌──────┐          ┌────────┐         ┌──────┐            │
+│   │/load │ ───────▶ │/status │ ──────▶ │/save │            │
+│   └──────┘          └────────┘         └──────┘            │
+│       │                  │                  │               │
+│   Restore            Dashboard          Persist             │
+│   context             view              state               │
+│                                                             │
+└─────────────────────────────────────────────────────────────┘
+```
+
+## Commands
+
+### `/status` - Dashboard View
+
+See everything at a glance:
+
+```
+📊 Project Status
+
+┌─ Plan ─────────────────────────────────────────┐
+│ Goal: Add user authentication with OAuth2      │
+│                                                │
+│ ✓ Step 1: Research OAuth providers [S]         │
+│ ✓ Step 2: Set up Google OAuth app [S]          │
+│ ◐ Step 3: Implement OAuth flow [M]  ← CURRENT  │
+│ ○ Step 4: Add token refresh [S]                │
+│ ○ Step 5: Write integration tests [M]          │
+│                                                │
+│ Progress: ██████░░░░ 40% (2/5)                 │
+└────────────────────────────────────────────────┘
+
+┌─ Active Tasks ─────────────────────────────────┐
+│ ◐ Fix callback URL handling                    │
+│ ○ Add token refresh logic                      │
+└────────────────────────────────────────────────┘
+
+┌─ Git ──────────────────────────────────────────┐
+│ Branch: feature/auth                           │
+│ Uncommitted: 3 files (+45/-12)                 │
+└────────────────────────────────────────────────┘
+```
+
+### `/save` - Persist State
+
+Save before ending your session:
+
+```
+/save "Stopped at callback URL issue"
+
+✓ Session saved
+
+┌─ Saved State ──────────────────────────────────┐
+│ Plan: Step 3/5 (40%) - Implement OAuth flow    │
+│ Tasks: 1 completed, 1 in progress, 1 pending   │
+│ Git: 3 uncommitted files                       │
+└────────────────────────────────────────────────┘
+
+Restore with: /load
+```
+
+### `/load` - Restore Context
+
+Pick up where you left off:
+
+```
+/load
+
+📂 Session Loaded
+
+┌─ Plan Context ─────────────────────────────────┐
+│ Goal: Add user authentication with OAuth2      │
+│ Current: ◐ Step 3 - Implement OAuth flow       │
+│ Progress: ██████░░░░ 40% (2/5)                 │
+└────────────────────────────────────────────────┘
+
+┌─ Restored Tasks ───────────────────────────────┐
+│ ◐ Fix callback URL handling                    │
+│ ○ Add token refresh logic                      │
+└────────────────────────────────────────────────┘
+
+┌─ Notes ────────────────────────────────────────┐
+│ "Stopped at callback URL issue"                │
+└────────────────────────────────────────────────┘
+
+Suggested: Continue with "Fix callback URL handling"
+```
+
+## Architecture
+
+```
+┌─────────────────────────────────────────────────────────────┐
+│                      Commands                                │
+├─────────────┬─────────────┬─────────────────────────────────┤
+│   /status   │   /save     │   /load                         │
+│   (read)    │   (write)   │   (read + restore)              │
+└──────┬──────┴──────┬──────┴──────┬──────────────────────────┘
+       │             │             │
+       │             ▼             │
+       │    ┌────────────────┐     │
+       │    │ .claude/       │     │
+       │    │ claude-state   │◄────┤
+       │    │ .json          │     │
+       │    ├────────────────┤     │
+       │    │ {              │     │
+       │    │   todos: {},   │     │
+       │    │   plan: {},    │     │
+       │    │   git: {},     │     │
+       │    │   notes: ""    │     │
+       │    │ }              │     │
+       │    └────────────────┘     │
+       │             │             │
+       │             │             │
+       ▼             ▼             ▼
+┌─────────────────────────────────────────────────────────────┐
+│                    docs/PLAN.md                              │
+│  (Strategic plan - managed by /plan command)                │
+└─────────────────────────────────────────────────────────────┘
+```
+
+## State File Format
+
+`.claude/claude-state.json`:
+
+```json
+{
+  "version": "2.0",
+  "timestamp": "2025-11-27T10:30:00Z",
+
+  "todos": {
+    "completed": ["Set up OAuth credentials"],
+    "in_progress": ["Fix callback URL handling"],
+    "pending": ["Add token refresh"]
+  },
+
+  "plan": {
+    "file": "docs/PLAN.md",
+    "goal": "Add user authentication with OAuth2",
+    "current_step": "Step 3: Implement OAuth flow",
+    "progress_percent": 40
+  },
+
+  "git": {
+    "branch": "feature/auth",
+    "last_commit": "abc123f",
+    "uncommitted_count": 3
+  },
+
+  "notes": "Stopped at callback URL issue"
+}
+```
+
+## Workflow Examples
+
+### Daily Workflow
+
+```
+Morning:
+  $ claude
+  > /load                    # See where you left off
+  > /status                  # Check current state
+
+Work:
+  > (make changes)
+  > /status                  # Quick check anytime
+
+End of day:
+  > /save "Finished auth, starting tests tomorrow"
+```
+
+### Context Switch
+
+```
+Working on Feature A:
+  > /save "Pausing for urgent bug"
+
+Switch to Bug Fix:
+  > git checkout hotfix/bug
+  > (fix bug)
+  > git checkout feature-a
+
+Resume Feature A:
+  > /load                    # Restore Feature A context
+```
+
+### Team Handoff
+
+```
+Developer 1:
+  > /save "Implemented OAuth, needs review" --commit
+  > git push
+
+Developer 2:
+  > git pull
+  > /load                    # See exactly where they stopped
+```
+
+## Integration with /plan
+
+These commands integrate with the `/plan` command:
+
+```
+┌─────────────────────────────────────────────────────────────┐
+│                 Unified State Model                          │
+├─────────────────────────────────────────────────────────────┤
+│                                                             │
+│   Strategic (Big Picture)          Tactical (Right Now)    │
+│   ────────────────────────         ───────────────────────  │
+│                                                             │
+│   docs/PLAN.md                     .claude/claude-state.json│
+│   ├─ Project goal                  ├─ TodoWrite tasks       │
+│   ├─ Implementation steps          ├─ Current plan step ref │
+│   ├─ Progress markers              ├─ Git context           │
+│   └─ Decision log                  └─ Session notes         │
+│                                                             │
+│         ▲                                   ▲               │
+│         │                                   │               │
+│         │         ┌───────────┐             │               │
+│         └─────────│  /status  │─────────────┘               │
+│                   │ (unified  │                             │
+│                   │   view)   │                             │
+│                   └───────────┘                             │
+│                                                             │
+└─────────────────────────────────────────────────────────────┘
+```
+
+## Why Not Just Use `--resume`?
+
+| Feature | `claude --resume` | Session Manager |
+|---------|-------------------|-----------------|
+| Conversation history | ✓ | - |
+| TodoWrite tasks | ✗ | ✓ |
+| Plan context | ✗ | ✓ |
+| Git state | ✗ | ✓ |
+| Human-readable | ✗ | ✓ |
+| Git-trackable | ✗ | ✓ |
+| Works across machines | ✗ | ✓ |
+| Team sharing | ✗ | ✓ |
+
+**Use both together:** `claude --resume` for conversation, `/load` for task state.
+
+## Installation
+
+This is a submodule of [claude-mods](https://github.com/0xDarkMatter/claude-mods).
+
+```bash
+# Via claude-mods (recommended)
+git clone --recursive https://github.com/0xDarkMatter/claude-mods.git
+cd claude-mods
+./install.sh  # or .\install.ps1 on Windows
+
+# Standalone
+git clone https://github.com/0xDarkMatter/session-manager.git
+# Copy *.md files to ~/.claude/commands/
+```
+
+## Command Reference
+
+| Command | Purpose | Modifies Files |
+|---------|---------|----------------|
+| `/status` | Dashboard view | No (read-only) |
+| `/save [notes]` | Persist state | Yes (.claude/) |
+| `/load` | Restore state | Yes (TodoWrite) |
+
+| Flag | Command | Effect |
+|------|---------|--------|
+| `--brief` | /status | Single-line output |
+| `--commit` | /save | Git commit state files |
+| `--no-restore` | /load | Preview without restoring |
+| `--clear` | /load | Clear state after loading |
+
+## License
+
+MIT
+
+---
+
+*Part of the [claude-mods](https://github.com/0xDarkMatter/claude-mods) collection.*

+ 249 - 0
commands/archive/session-manager/load.md

@@ -0,0 +1,249 @@
+---
+description: "Restore session context with plan awareness. Shows plan progress, restores TodoWrite tasks, displays what changed since last save."
+---
+
+# Load - Restore Session Context
+
+Restore your session context from a previous save. Shows plan progress, restores tasks, and displays what's changed.
+
+## Architecture
+
+```
+/load
+    │
+    ├─→ Read .claude/claude-state.json
+    │     ├─ TodoWrite tasks
+    │     ├─ Plan context
+    │     └─ Git context at save time
+    │
+    ├─→ Analyze changes since save
+    │     ├─ New commits
+    │     ├─ File modifications
+    │     └─ Plan updates
+    │
+    ├─→ Restore TodoWrite state
+    │     └─ Populate with saved tasks
+    │
+    └─→ Display unified summary
+          ├─ Plan context
+          ├─ Restored tasks
+          ├─ What changed
+          └─ Suggested next action
+```
+
+## Output Format
+
+```
+📂 Session Loaded
+
+┌─ Time ─────────────────────────────────────────────────────────────────────────────────────────┐
+│ Saved: 2 hours ago (2025-11-27 10:30 AM)                                                       │
+│ Branch: feature/auth                                                                           │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+
+┌─ Plan Context ─────────────────────────────────────────────────────────────────────────────────┐
+│ Goal: Add user authentication with OAuth2                                                      │
+│                                                                                                │
+│ ✓ Step 1: Research OAuth providers                                                             │
+│ ✓ Step 2: Set up Google OAuth app                                                              │
+│ ◐ Step 3: Implement OAuth flow  ← YOU WERE HERE                                                │
+│ ○ Step 4: Add token refresh                                                                    │
+│ ○ Step 5: Write integration tests                                                              │
+│                                                                                                │
+│ Progress: ██████░░░░ 40% (2/5)                                                                 │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+
+┌─ Restored Tasks ───────────────────────────────────────────────────────────────────────────────┐
+│ ◐ Fix callback URL handling                                                                    │
+│ ○ Add token refresh logic                                                                      │
+│ ✓ Set up OAuth credentials                                                                     │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+
+┌─ Since Last Save ──────────────────────────────────────────────────────────────────────────────┐
+│ Commits: 0 new                                                                                 │
+│ Files: 3 still uncommitted (+45/-12)                                                           │
+│ Plan: unchanged                                                                                │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+
+┌─ Notes ────────────────────────────────────────────────────────────────────────────────────────┐
+│ "Stopped at callback URL issue - need to fix redirect"                                         │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+
+┌─ Suggested Next Action ────────────────────────────────────────────────────────────────────────┐
+│ Continue with: Fix callback URL handling                                                       │
+│                                                                                                │
+│ Context: You were implementing OAuth flow (Plan Step 3) and stopped at a redirect issue.       │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+```
+
+## Execution Steps
+
+### Step 1: Check for State Files
+
+```bash
+ls -la .claude/claude-state.json 2>/dev/null
+```
+
+If missing:
+```
+┌─ Session ──────────────────────────────────────────────────────────────────────────────────────┐
+│ ⚠  State: No saved state found in .claude/claude-state.json                                    │
+│                                                                                                │
+│    To create one, use: /save                                                                   │
+│    Or check current status: /status                                                            │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+```
+
+### Step 2: Read State
+
+Parse `.claude/claude-state.json`:
+- Extract todos (completed, in_progress, pending)
+- Extract plan context (goal, current step, progress)
+- Extract git context (branch, last commit)
+- Extract notes
+
+### Step 3: Calculate Time Since Save
+
+```bash
+# Compare timestamps
+# Format as: "2 hours ago", "3 days ago"
+```
+
+### Step 4: Analyze Changes
+
+```bash
+# Commits since save
+git log --oneline <saved_commit>..HEAD
+
+# Current uncommitted
+git status --porcelain
+
+# Check if plan was modified
+git log -1 --format="%H" -- docs/PLAN.md
+```
+
+### Step 5: Restore TodoWrite
+
+Use TodoWrite tool:
+```json
+{
+  "todos": [
+    {"content": "Fix callback URL handling", "status": "in_progress"},
+    {"content": "Add token refresh logic", "status": "pending"},
+    {"content": "Set up OAuth credentials", "status": "completed"}
+  ]
+}
+```
+
+### Step 6: Generate Suggestion
+
+Based on saved state:
+- If `in_progress` task exists → "Continue with: <task>"
+- If all complete → "Start next pending task"
+- If blocked → "Resolve blocker: <blocker>"
+
+## Edge Cases
+
+### Stale State (>7 days)
+
+```
+⚠ Saved state is 12 days old
+
+A lot may have changed since then.
+
+Options:
+  1. Load anyway (tasks may still be relevant)
+  2. Check current status: /status
+  3. Start fresh: /load --clear
+```
+
+### Branch Changed
+
+```
+⚠ Branch changed since save
+
+Saved on: feature/old-branch
+Current:  feature/new-branch
+
+The saved context may not apply. Options:
+  1. Switch back: git checkout feature/old-branch
+  2. Load anyway (some tasks may apply)
+  3. Clear and start fresh: /load --clear
+```
+
+### Plan Updated Since Save
+
+```
+ℹ Plan was updated since you saved
+
+Changes to docs/PLAN.md:
+  • Step 3 marked complete (was in-progress)
+  • Step 4 now in-progress
+
+Your saved context shows Step 3, but plan shows Step 4.
+Consider: /plan --review to see current state
+```
+
+## Flags
+
+| Flag | Effect |
+|------|--------|
+| `--verbose` | Show full git log since save |
+| `--no-restore` | Preview without restoring TodoWrite |
+| `--clear` | Clear saved state after loading |
+| `--force` | Load even if stale or branch mismatch |
+
+## Usage Examples
+
+```bash
+# Basic load
+/load
+
+# Preview without restoring
+/load --no-restore
+
+# Load with full git history
+/load --verbose
+
+# Load and clear state
+/load --clear
+```
+
+## Integration
+
+Part of the session management suite:
+
+```
+Session Lifecycle
+─────────────────────────────────────────────────────────────────────────────────────────────────
+
+  ┌──────────────────────────────────────────────────────────────────────────────────────────────┐
+  │                                                                                              │
+  │         ┌─────────┐                   ┌─────────┐                   ┌─────────┐              │
+  │         │  START  │                   │  WORK   │                   │   END   │              │
+  │         └────┬────┘                   └────┬────┘                   └────┬────┘              │
+  │              │                             │                             │                   │
+  │              ▼                             ▼                             ▼                   │
+  │         ┌────────┐                   ┌──────────┐                   ┌────────┐              │
+  │         │ /load  │──────────────────▶│ /status  │──────────────────▶│ /save  │              │
+  │         └────────┘                   └──────────┘                   └────┬───┘              │
+  │              │                             │                             │                   │
+  │           Restore                      Dashboard                      Persist               │
+  │           context                        view                          state                │
+  │              │                             │                             │                   │
+  │              └─────────────────────────────┴─────────────────────────────┘                   │
+  │                                            │                                                 │
+  │                                            ▼                                                 │
+  │                               .claude/claude-state.json                                      │
+  │                               docs/PLAN.md                                                   │
+  │                                            │                                                 │
+  └────────────────────────────────────────────┘                                                 │
+                                    Next Session                                                 │
+```
+
+## Notes
+
+- Automatically restores TodoWrite unless `--no-restore`
+- Shows plan context from saved state + current plan
+- Detects and warns about state/branch mismatches
+- Notes from `/save` are prominently displayed

+ 231 - 0
commands/archive/session-manager/save.md

@@ -0,0 +1,231 @@
+---
+description: "Save session state with plan awareness. Persists TodoWrite tasks, current plan step, and git context for session continuity."
+---
+
+# Save - Session State Persistence
+
+Save your current session state before ending work. Captures TodoWrite tasks, current plan step, and git context.
+
+## Architecture
+
+```
+/save "optional notes"
+    │
+    ├─→ Capture TodoWrite state
+    │     └─ completed, in_progress, pending tasks
+    │
+    ├─→ Capture plan context (NEW)
+    │     ├─ Current step from docs/PLAN.md
+    │     └─ Plan progress percentage
+    │
+    ├─→ Capture git context
+    │     ├─ Branch, last commit
+    │     └─ Uncommitted changes
+    │
+    └─→ Write state files
+          ├─ .claude/claude-state.json (machine)
+          └─ .claude/claude-progress.md (human)
+```
+
+## Why This Exists
+
+Claude Code's native features don't persist across sessions:
+
+| Feature | Persists? | Location |
+|---------|-----------|----------|
+| Conversation history | Yes | Internal (use `--resume`) |
+| CLAUDE.md context | Yes | `./CLAUDE.md` |
+| TodoWrite tasks | **No** | Deleted on session end |
+| Plan Mode state | **No** | In-memory only |
+
+This command bridges the gap by saving what Claude Code doesn't.
+
+## Output Files
+
+### .claude/claude-state.json (v2.0)
+
+```json
+{
+  "version": "2.0",
+  "timestamp": "2025-11-27T10:30:00Z",
+
+  "todos": {
+    "completed": ["Set up OAuth credentials"],
+    "in_progress": ["Fix callback URL handling"],
+    "pending": ["Add token refresh"]
+  },
+
+  "plan": {
+    "file": "docs/PLAN.md",
+    "goal": "Add user authentication with OAuth2",
+    "current_step": "Step 3: Implement OAuth flow",
+    "current_step_index": 3,
+    "total_steps": 5,
+    "progress_percent": 40
+  },
+
+  "git": {
+    "branch": "feature/auth",
+    "last_commit": "abc123f",
+    "last_commit_message": "feat: Add OAuth config",
+    "uncommitted_count": 3,
+    "uncommitted_files": [
+      "src/auth/oauth.ts",
+      "src/auth/callback.ts",
+      "tests/auth.test.ts"
+    ]
+  },
+
+  "notes": "Stopped at callback URL issue - need to fix redirect"
+}
+```
+
+### .claude/claude-progress.md
+
+```markdown
+# Session Progress
+
+**Saved**: 2025-11-27 10:30 AM
+**Branch**: feature/auth
+
+## Plan Context
+
+**Goal**: Add user authentication with OAuth2
+**Current Step**: ◐ Step 3 - Implement OAuth flow [M]
+**Progress**: ██████░░░░ 40% (2/5 steps)
+
+## Tasks
+
+### Completed
+- ✓ Set up OAuth credentials
+
+### In Progress
+- ◐ Fix callback URL handling
+
+### Pending
+- ○ Add token refresh
+
+## Git State
+
+- Last commit: `abc123f` feat: Add OAuth config
+- Uncommitted: 3 files
+
+## Notes
+
+> Stopped at callback URL issue - need to fix redirect
+
+---
+*Restore with: /load*
+```
+
+## Execution Steps
+
+### Step 1: Gather TodoWrite State
+
+Map current TodoWrite tasks by status:
+- `completed` → completed array
+- `in_progress` → in_progress array
+- `pending` → pending array
+
+### Step 2: Gather Plan Context (NEW)
+
+```bash
+# Check if plan exists
+cat docs/PLAN.md 2>/dev/null
+```
+
+Parse from docs/PLAN.md:
+- Goal line: `**Goal**:`
+- Current step: line with `◐` marker
+- Count `✓` for completed, total for progress
+
+### Step 3: Gather Git Context
+
+```bash
+git branch --show-current
+git log -1 --format="%h %s"
+git status --porcelain
+git diff --stat
+```
+
+### Step 4: Create Directory
+
+```bash
+mkdir -p .claude
+```
+
+### Step 5: Write State Files
+
+Write both:
+- `.claude/claude-state.json` - machine-readable
+- `.claude/claude-progress.md` - human-readable
+
+### Step 6: Confirm
+
+```
+✓ Session saved
+
+┌─ Saved State ──────────────────────────────────────────────────────────────────────────────────┐
+│ Plan: Step 3/5 (40%) - Implement OAuth flow                                                    │
+│ Tasks: 1 completed, 1 in progress, 1 pending                                                   │
+│ Git: 3 uncommitted files                                                                       │
+│ Notes: "Stopped at callback URL issue..."                                                      │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+
+Files:
+  • .claude/claude-state.json
+  • .claude/claude-progress.md
+
+Restore with: /load
+```
+
+## Usage Examples
+
+```bash
+# Basic save
+/save
+
+# Save with notes
+/save "Stopped at callback URL issue"
+
+# Save and commit state files
+/save --commit
+
+# Save with notes and commit
+/save "Ready for review" --commit
+```
+
+## Flags
+
+| Flag | Effect |
+|------|--------|
+| `--commit` | Git commit state files after saving |
+| `--force` | Overwrite without confirmation |
+| `--no-plan` | Skip plan context capture |
+
+## Integration
+
+Part of the session management suite:
+
+```
+┌────────────────────────────────────────────────────────────────────────────────────────────────┐
+│                                    Session Lifecycle                                           │
+├────────────────────────────────────────────────────────────────────────────────────────────────┤
+│                                                                                                │
+│          START                        WORK                          END                        │
+│            │                           │                             │                         │
+│            ▼                           ▼                             ▼                         │
+│         /load ─────────────→ /status (anytime) ─────────────→ /save                           │
+│            │                           │                             │                         │
+│         Restore                     Dashboard                     Persist                      │
+│         context                       view                        state                        │
+│                                                                                                │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+```
+
+## Notes
+
+- Always captures plan context if docs/PLAN.md exists
+- State files are gitignored by default
+- Use `--commit` to track state in git
+- Notes are preserved and shown on `/load`

+ 173 - 0
commands/archive/session-manager/status.md

@@ -0,0 +1,173 @@
+---
+description: "Dashboard view of project status: plan progress, active tasks, git state. Single command to see everything."
+---
+
+# Status - Project Dashboard
+
+Single dashboard view showing plan progress, active tasks, and git state.
+
+## What This Command Does
+
+```
+/status
+    │
+    ├─→ Read docs/PLAN.md
+    │     └─ Parse current step, progress, blockers
+    │
+    ├─→ Read TodoWrite state
+    │     └─ Get in-progress and pending tasks
+    │
+    ├─→ Read git state
+    │     └─ Branch, uncommitted changes, recent commits
+    │
+    └─→ Display unified dashboard
+```
+
+## Output Format
+
+```
+📊 Project Status
+
+┌─ Plan ─────────────────────────────────────────────────────────────────────────────────────────┐
+│ docs/PLAN.md (updated 2 hours ago)                                                             │
+│                                                                                                │
+│ Goal: Add user authentication with OAuth2                                                      │
+│                                                                                                │
+│ ✓ Step 1: Research OAuth providers [S]                                                         │
+│ ✓ Step 2: Set up Google OAuth app [S]                                                          │
+│ ◐ Step 3: Implement OAuth flow [M]  ← CURRENT                                                  │
+│ ○ Step 4: Add token refresh [S]                                                                │
+│ ○ Step 5: Write integration tests [M]                                                          │
+│                                                                                                │
+│ Progress: ██████░░░░ 40% (2/5)                                                                 │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+
+┌─ Active Tasks ─────────────────────────────────────────────────────────────────────────────────┐
+│ ◐ Fix callback URL handling                                                                    │
+│ ○ Add token refresh logic                                                                      │
+│ ✓ Set up OAuth credentials                                                                     │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+
+┌─ Git ──────────────────────────────────────────────────────────────────────────────────────────┐
+│ Branch: feature/auth                                                                           │
+│ Uncommitted: 3 files (+45/-12)                                                                 │
+│   • src/auth/oauth.ts               +32/-8                                                     │
+│   • src/auth/callback.ts            +13/-4                                                     │
+│   • tests/auth.test.ts              (new)                                                      │
+│                                                                                                │
+│ Recent commits:                                                                                │
+│   • abc123f feat: Add OAuth config                                                             │
+│   • def456a fix: Handle token expiry                                                           │
+│   • 789ghij refactor: Extract auth utils                                                       │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+
+┌─ Suggestions ──────────────────────────────────────────────────────────────────────────────────┐
+│ → 3 files ready to commit                                                                      │
+│ → Plan is 2 days stale, run: /plan --sync                                                      │
+│ → Save before leaving: /save                                                                   │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+```
+
+## Execution Steps
+
+### Step 1: Check for Plan
+
+```bash
+# Check if plan exists
+cat docs/PLAN.md 2>/dev/null
+```
+
+If no plan found:
+```
+┌─ Plan ─────────────────────────────────────────────────────────────────────────────────────────┐
+│ ⚠  Plan: No docs/PLAN.md found                                                                 │
+│    Create one with: /plan "your project goal"                                                  │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+```
+
+If no saved state but plan exists:
+```
+┌─ Session ──────────────────────────────────────────────────────────────────────────────────────┐
+│ ⚠  State: No saved state found in .claude/claude-state.json                                    │
+│ ✅  Plan: Project plan found at docs/PLAN.md                                                    │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+```
+
+### Step 2: Parse Plan
+
+Extract from docs/PLAN.md:
+- **Goal**: from `**Goal**:` line
+- **Steps**: lines starting with `✓`, `◐`, `○`, `⚠`
+- **Current step**: the one marked with `◐`
+- **Progress**: count completed vs total
+
+### Step 3: Get TodoWrite State
+
+Read current TodoWrite tasks:
+- `in_progress` → show with ◐
+- `pending` → show with ○
+- `completed` → show with ✓ (recent only)
+
+### Step 4: Get Git State
+
+```bash
+# Current branch
+git branch --show-current
+
+# Uncommitted changes with stats
+git diff --stat
+git diff --cached --stat
+
+# Count changes
+git status --porcelain
+```
+
+### Step 5: Generate Suggestions
+
+Based on state, suggest next actions:
+
+| Condition | Suggestion |
+|-----------|------------|
+| Uncommitted files > 0 | "X files ready to commit" |
+| Plan modified > 2 days ago | "Plan may be stale, run: /plan --sync" |
+| No saved state exists | "Save progress with: /save" |
+| In-progress task exists | "Continue: <task name>" |
+| All tasks complete | "Mark plan step complete: /plan --status" |
+
+## Flags
+
+| Flag | Effect |
+|------|--------|
+| `--brief` | Compact single-line summary |
+| `--plan` | Show only plan section |
+| `--tasks` | Show only tasks section |
+| `--git` | Show only git section |
+
+## Brief Mode
+
+```bash
+/status --brief
+```
+
+Output:
+```
+📊 Plan: 2/5 (◐ Step 3) │ Tasks: 1 active, 2 pending │ Git: 3 uncommitted
+```
+
+## Integration
+
+Works with the session management suite:
+
+| Command | Purpose |
+|---------|---------|
+| `/status` | See current state (this command) |
+| `/save` | Persist state before leaving |
+| `/load` | Restore state when returning |
+| `/plan` | Manage project plan |
+
+## Notes
+
+- Read-only command, never modifies files
+- Fast execution, can run frequently
+- Shows suggestions based on detected state
+- Works even without plan (shows tasks + git only)

+ 0 - 1
commands/g-slave

@@ -1 +0,0 @@
-Subproject commit 02b083bc92caf4ae13a4483d2a176003b43ca2fc

+ 297 - 0
commands/g-slave.md

@@ -0,0 +1,297 @@
+---
+description: Dispatch Gemini CLI to analyze large codebases. Gemini does the grunt work with its 1M token context, returns distilled intel to Claude.
+---
+
+# G-SLAVE: Gemini Large-context Analysis & Verification Engine
+
+You are dispatching Gemini CLI as a subordinate tool to analyze code that would bloat your context window. Gemini does the heavy lifting; you receive distilled intelligence.
+
+## Target
+
+$ARGUMENTS
+
+If no arguments provided, analyze current working directory.
+
+## Execution Protocol
+
+### Step 1: Verify Gemini CLI is Available
+
+```bash
+which gemini || echo "ERROR: Gemini CLI not installed. Install: https://github.com/google-gemini/gemini-cli"
+```
+
+### Step 2: Check for Agent Configuration Files
+
+Before analysis, check if the project has any agent instruction files that Gemini should respect:
+
+```bash
+# Check for common agent config files
+ls -la AGENTS.md GEMINI.md CLAUDE.md WARP.md COPILOT.md CURSOR.md CODEX.md README.md CONTRIBUTING.md .github/AGENTS.md .claude/CLAUDE.md 2>/dev/null
+```
+
+If found, inform the user:
+- **GEMINI.md**: Gemini CLI will automatically use this
+- **Other agent files**: Suggest including them in the prompt with `@AGENTS.md` etc. so Gemini respects the project conventions
+
+### Step 3: Parse Arguments & Determine Mode
+
+**Modes:**
+
+| Pattern | Mode | Description |
+|---------|------|-------------|
+| `/g-slave <path>` | **Analyze** | Full analysis of target |
+| `/g-slave ask "<question>"` | **Ask** | Direct question about codebase |
+| `/g-slave verify "<statement>"` | **Verify** | Yes/no verification check |
+| `/g-slave compare <path1> <path2>` | **Compare** | Diff analysis between two targets |
+
+**Flags:**
+
+| Flag | Effect |
+|------|--------|
+| `--arch` | Focus: Architecture, structure, design patterns |
+| `--security` | Focus: Security vulnerabilities, auth, injection risks |
+| `--deps` | Focus: Dependencies, imports, coupling analysis |
+| `--quality` | Focus: Code quality, tech debt, antipatterns |
+| `--test` | Focus: Test coverage, testing patterns, gaps |
+| `--perf` | Focus: Performance bottlenecks, optimization opportunities |
+| `--brief` | Output: ~500 char summary |
+| `--detailed` | Output: ~5000 char comprehensive breakdown |
+| `--raw` | Output: Unfiltered Gemini response (no distillation) |
+| `--save <file>` | Export: Save analysis to specified file |
+| `--exclude <patterns>` | Ignore: Comma-separated patterns (e.g., `node_modules,dist,.git`) |
+| `--prompt "<custom>"` | Custom: Use provided prompt instead of default |
+| `--all` | Scope: Use `--all_files` flag for entire project |
+
+### Step 4: Construct Default Exclusions
+
+Always recommend excluding these token-wasters unless user specifically needs them:
+- `node_modules/`, `vendor/`, `venv/`, `.venv/`, `__pycache__/`
+- `.git/`, `.svn/`, `.hg/`
+- `dist/`, `build/`, `out/`, `target/`
+- `*.lock`, `*.log`, `coverage/`
+
+Use the `--exclude` flag or advise user to add exclusions to their GEMINI.md.
+
+### Step 5: Execute Gemini Command
+
+**CRITICAL: Gemini must operate in READ-ONLY mode. No code execution, no file modifications.**
+
+Add to all prompts: `"IMPORTANT: This is a read-only analysis. Do not execute code or modify files."`
+
+---
+
+#### Mode: Analyze (default)
+
+```bash
+gemini -p "@<path>/ IMPORTANT: Read-only analysis only. Analyze this codebase. Focus: <focus_area>. Provide: 1) Architecture overview 2) Key patterns 3) Notable issues 4) Recommendations. Be thorough but concise."
+```
+
+#### Mode: Ask
+
+```bash
+gemini -p "@<path>/ IMPORTANT: Read-only analysis only. <user_question> Provide a direct, specific answer with file paths and line references where applicable."
+```
+
+#### Mode: Verify
+
+```bash
+gemini -p "@<path>/ IMPORTANT: Read-only analysis only. Verify: <statement>. Answer with: YES/NO followed by evidence (file paths, code snippets) supporting your answer."
+```
+
+#### Mode: Compare
+
+```bash
+gemini -p "@<path1>/ @<path2>/ IMPORTANT: Read-only analysis only. Compare these two codebases/directories. Identify: 1) Structural differences 2) Logic changes 3) Added/removed features 4) Potential issues from changes."
+```
+
+#### With Custom Prompt
+
+```bash
+gemini -p "@<path>/ IMPORTANT: Read-only analysis only. <custom_prompt>"
+```
+
+#### Full Project Scan
+
+```bash
+gemini --all_files -p "IMPORTANT: Read-only analysis only. <prompt>"
+```
+
+### Step 6: Detect Framework & Tailor Analysis
+
+Before executing, quickly identify the stack and adjust analysis focus:
+
+| Detected | Tailor Prompt To Include |
+|----------|--------------------------|
+| `package.json` | React/Vue/Node patterns, npm security |
+| `requirements.txt` / `pyproject.toml` | Django/Flask/FastAPI patterns, Python idioms |
+| `Cargo.toml` | Rust ownership patterns, unsafe usage |
+| `go.mod` | Go concurrency patterns, error handling |
+| `composer.json` | Laravel/Symfony patterns, PHP security |
+| `Gemfile` | Rails patterns, Ruby idioms |
+| `pom.xml` / `build.gradle` | Spring patterns, Java architecture |
+
+### Step 7: Distill Results
+
+**If `--raw` flag: Skip distillation, return full Gemini output.**
+
+Otherwise, extract and present based on verbosity:
+
+**--brief (~500 chars):**
+```markdown
+## Gemini Analysis: <target>
+<3-4 sentence executive summary covering architecture, main issues, top recommendation>
+```
+
+**Default (~2000 chars):**
+```markdown
+## Gemini Analysis: <target>
+
+**Scope:** <what was analyzed>
+**Focus:** <focus area or "general">
+
+### Architecture
+<concise 3-5 line summary>
+
+### Key Patterns
+- Pattern 1
+- Pattern 2
+
+### Issues (prioritized)
+1. **High:** <critical issue>
+2. **Medium:** <notable concern>
+3. **Low:** <minor item>
+
+### Recommendations
+1. <actionable recommendation>
+2. <actionable recommendation>
+
+---
+*Analysis via Gemini CLI (1M token context) | Distilled for Claude*
+```
+
+**--detailed (~5000 chars):**
+Include all of the above plus:
+- Detailed file-by-file breakdown of key components
+- Dependency analysis with version concerns
+- Security considerations
+- Performance observations
+- Testing gaps
+- Technical debt inventory
+
+### Step 8: Handle --save Flag
+
+If `--save <filename>` provided:
+1. Write the analysis output to the specified file
+2. Confirm save location to user
+3. Still display summary in conversation
+
+```bash
+# Example save
+echo "<analysis_output>" > <filename>
+```
+
+## Response Templates
+
+### For Ask Mode
+```markdown
+## Answer: <question summary>
+
+<direct answer>
+
+**Evidence:**
+- `path/to/file.py:42` - <relevant code/context>
+- `path/to/other.js:17` - <relevant code/context>
+
+---
+*Via Gemini CLI | Read-only analysis*
+```
+
+### For Verify Mode
+```markdown
+## Verification: <statement>
+
+**Result:** YES / NO / PARTIAL
+
+**Evidence:**
+- <supporting finding 1>
+- <supporting finding 2>
+
+**Location(s):** `file:line`, `file:line`
+
+---
+*Via Gemini CLI | Read-only analysis*
+```
+
+### For Compare Mode
+```markdown
+## Comparison: <path1> vs <path2>
+
+### Structural Differences
+- <difference 1>
+- <difference 2>
+
+### Logic Changes
+- <change 1>
+- <change 2>
+
+### Added/Removed
+| Added | Removed |
+|-------|---------|
+| <item> | <item> |
+
+### Risk Assessment
+<potential issues from changes>
+
+---
+*Via Gemini CLI | Read-only analysis*
+```
+
+## Error Handling
+
+| Error | Action |
+|-------|--------|
+| Gemini CLI not found | Provide install link: https://github.com/google-gemini/gemini-cli |
+| Path doesn't exist | Report error, ask for correct path |
+| Analysis timeout | Suggest narrower scope or `--exclude` patterns |
+| Output too large | Summarize more aggressively (unless `--raw`) |
+| Rate limited | Inform user, suggest waiting or reducing scope |
+| Permission denied | Check file permissions, suggest alternatives |
+
+## Usage Examples
+
+```bash
+# Basic analysis
+/g-slave src/
+
+# Direct question
+/g-slave ask "Where is user authentication implemented?"
+
+# Verification check
+/g-slave verify "All API endpoints have rate limiting"
+
+# Security audit with exclusions
+/g-slave . --security --exclude node_modules,dist,coverage
+
+# Compare branches (checkout both first)
+/g-slave compare ./main-branch ./feature-branch
+
+# Custom analysis saved to file
+/g-slave . --prompt "Find all API endpoints and document their HTTP methods, parameters, and auth requirements" --save api-docs.md
+
+# Quick overview
+/g-slave . --brief
+
+# Full deep-dive
+/g-slave . --detailed --save full-analysis.md
+
+# Raw Gemini output (no distillation)
+/g-slave . --arch --raw
+```
+
+## Remember
+
+1. **You are the commander.** Gemini is the grunt. Extract value, don't relay noise.
+2. **Read-only always.** Never let Gemini execute or modify.
+3. **Distill by default.** Only pass raw output when explicitly requested.
+4. **Check for agent files.** Respect project conventions.
+5. **Exclude junk.** Don't waste the 1M context on node_modules.

+ 251 - 0
commands/loadplan.md

@@ -0,0 +1,251 @@
+---
+description: "Restore plan session state. Loads TodoWrite tasks, plan progress, and notes from saved .claude/claude-state.json."
+---
+
+# LoadPlan - Restore Plan Session State
+
+Restore your session context from a previous save. Shows plan progress, restores tasks, and displays what's changed.
+
+## Architecture
+
+```
+/loadplan
+    │
+    ├─→ Read .claude/claude-state.json
+    │     ├─ TodoWrite tasks
+    │     ├─ Plan context
+    │     └─ Git context at save time
+    │
+    ├─→ Analyze changes since save
+    │     ├─ New commits
+    │     ├─ File modifications
+    │     └─ Plan updates
+    │
+    ├─→ Restore TodoWrite state
+    │     └─ Populate with saved tasks
+    │
+    └─→ Display unified summary
+          ├─ Plan context
+          ├─ Restored tasks
+          ├─ What changed
+          └─ Suggested next action
+```
+
+## Output Format
+
+```
+📂 Plan Session Loaded
+
+┌─ Time ─────────────────────────────────────────────────────────────────────────────────────────┐
+│ Saved: 2 hours ago (2025-11-27 10:30 AM)                                                       │
+│ Branch: feature/auth                                                                           │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+
+┌─ Plan Context ─────────────────────────────────────────────────────────────────────────────────┐
+│ Goal: Add user authentication with OAuth2                                                      │
+│                                                                                                │
+│ ✓ Step 1: Research OAuth providers                                                             │
+│ ✓ Step 2: Set up Google OAuth app                                                              │
+│ ◐ Step 3: Implement OAuth flow  ← YOU WERE HERE                                                │
+│ ○ Step 4: Add token refresh                                                                    │
+│ ○ Step 5: Write integration tests                                                              │
+│                                                                                                │
+│ Progress: ██████░░░░ 40% (2/5)                                                                 │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+
+┌─ Restored Tasks ───────────────────────────────────────────────────────────────────────────────┐
+│ ◐ Fix callback URL handling                                                                    │
+│ ○ Add token refresh logic                                                                      │
+│ ✓ Set up OAuth credentials                                                                     │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+
+┌─ Since Last Save ──────────────────────────────────────────────────────────────────────────────┐
+│ Commits: 0 new                                                                                 │
+│ Files: 3 still uncommitted (+45/-12)                                                           │
+│ Plan: unchanged                                                                                │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+
+┌─ Notes ────────────────────────────────────────────────────────────────────────────────────────┐
+│ "Stopped at callback URL issue - need to fix redirect"                                         │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+
+┌─ Suggested Next Action ────────────────────────────────────────────────────────────────────────┐
+│ Continue with: Fix callback URL handling                                                       │
+│                                                                                                │
+│ Context: You were implementing OAuth flow (Plan Step 3) and stopped at a redirect issue.       │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+```
+
+## Execution Steps
+
+### Step 1: Check for State Files
+
+```bash
+ls -la .claude/claude-state.json 2>/dev/null
+```
+
+If missing:
+```
+┌─ Session ──────────────────────────────────────────────────────────────────────────────────────┐
+│ ⚠  State: No saved state found in .claude/claude-state.json                                    │
+│                                                                                                │
+│    To create one, use: /saveplan                                                               │
+│    Or check current status: /dash                                                              │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+```
+
+### Step 2: Read State
+
+Parse `.claude/claude-state.json`:
+- Extract todos (completed, in_progress, pending)
+- Extract plan context (goal, current step, progress)
+- Extract git context (branch, last commit)
+- Extract notes
+
+### Step 3: Calculate Time Since Save
+
+```bash
+# Compare timestamps
+# Format as: "2 hours ago", "3 days ago"
+```
+
+### Step 4: Analyze Changes
+
+```bash
+# Commits since save
+git log --oneline <saved_commit>..HEAD
+
+# Current uncommitted
+git status --porcelain
+
+# Check if plan was modified
+git log -1 --format="%H" -- docs/PLAN.md
+```
+
+### Step 5: Restore TodoWrite
+
+Use TodoWrite tool:
+```json
+{
+  "todos": [
+    {"content": "Fix callback URL handling", "status": "in_progress"},
+    {"content": "Add token refresh logic", "status": "pending"},
+    {"content": "Set up OAuth credentials", "status": "completed"}
+  ]
+}
+```
+
+### Step 6: Generate Suggestion
+
+Based on saved state:
+- If `in_progress` task exists → "Continue with: <task>"
+- If all complete → "Start next pending task"
+- If blocked → "Resolve blocker: <blocker>"
+
+## Edge Cases
+
+### Stale State (>7 days)
+
+```
+⚠ Saved state is 12 days old
+
+A lot may have changed since then.
+
+Options:
+  1. Load anyway (tasks may still be relevant)
+  2. Check current status: /dash
+  3. Start fresh: /loadplan --clear
+```
+
+### Branch Changed
+
+```
+⚠ Branch changed since save
+
+Saved on: feature/old-branch
+Current:  feature/new-branch
+
+The saved context may not apply. Options:
+  1. Switch back: git checkout feature/old-branch
+  2. Load anyway (some tasks may apply)
+  3. Clear and start fresh: /loadplan --clear
+```
+
+### Plan Updated Since Save
+
+```
+ℹ Plan was updated since you saved
+
+Changes to docs/PLAN.md:
+  • Step 3 marked complete (was in-progress)
+  • Step 4 now in-progress
+
+Your saved context shows Step 3, but plan shows Step 4.
+Consider: /plan --review to see current state
+```
+
+## Flags
+
+| Flag | Effect |
+|------|--------|
+| `--verbose` | Show full git log since save |
+| `--no-restore` | Preview without restoring TodoWrite |
+| `--clear` | Clear saved state after loading |
+| `--force` | Load even if stale or branch mismatch |
+
+## Usage Examples
+
+```bash
+# Basic load
+/loadplan
+
+# Preview without restoring
+/loadplan --no-restore
+
+# Load with full git history
+/loadplan --verbose
+
+# Load and clear state
+/loadplan --clear
+```
+
+## Integration
+
+Part of the session management suite:
+
+```
+Session Lifecycle
+─────────────────────────────────────────────────────────────────────────────────────────────────
+
+  ┌──────────────────────────────────────────────────────────────────────────────────────────────┐
+  │                                                                                              │
+  │         ┌─────────┐                   ┌─────────┐                   ┌─────────┐              │
+  │         │  START  │                   │  WORK   │                   │   END   │              │
+  │         └────┬────┘                   └────┬────┘                   └────┬────┘              │
+  │              │                             │                             │                   │
+  │              ▼                             ▼                             ▼                   │
+  │      ┌───────────┐                   ┌──────────┐                 ┌───────────┐             │
+  │      │   /sync   │                   │  /dash   │                 │ /saveplan │             │
+  │      │     +     │──────────────────▶│          │────────────────▶│           │             │
+  │      │ /loadplan │                   └──────────┘                 └─────┬─────┘             │
+  │      └───────────┘                                                      │                   │
+  │           │                                                             │                   │
+  │        Restore                                                       Persist               │
+  │        context                                                        state                │
+  │           │                                                             │                   │
+  │           └─────────────────────────────────────────────────────────────┘                   │
+  │                                            │                                                │
+  │                                            ▼                                                │
+  │                               .claude/claude-state.json                                     │
+  │                               docs/PLAN.md                                                  │
+  │                                            │                                                │
+  └────────────────────────────────────────────┘                                                │
+                                    Next Session                                                │
+```
+
+## Notes
+
+- Automatically restores TodoWrite unless `--no-restore`
+- Shows plan context from saved state + current plan
+- Detects and warns about state/branch mismatches
+- Notes from `/saveplan` are prominently displayed

+ 231 - 0
commands/saveplan.md

@@ -0,0 +1,231 @@
+---
+description: "Save plan session state. Persists TodoWrite tasks, current plan step, and git context to .claude/claude-state.json."
+---
+
+# SavePlan - Session State Persistence
+
+Save your current session state before ending work. Captures TodoWrite tasks, current plan step, and git context.
+
+## Architecture
+
+```
+/saveplan "optional notes"
+    │
+    ├─→ Capture TodoWrite state
+    │     └─ completed, in_progress, pending tasks
+    │
+    ├─→ Capture plan context
+    │     ├─ Current step from docs/PLAN.md
+    │     └─ Plan progress percentage
+    │
+    ├─→ Capture git context
+    │     ├─ Branch, last commit
+    │     └─ Uncommitted changes
+    │
+    └─→ Write state files
+          ├─ .claude/claude-state.json (machine)
+          └─ .claude/claude-progress.md (human)
+```
+
+## Why This Exists
+
+Claude Code's native features don't persist across sessions:
+
+| Feature | Persists? | Location |
+|---------|-----------|----------|
+| Conversation history | Yes | Internal (use `--resume`) |
+| CLAUDE.md context | Yes | `./CLAUDE.md` |
+| TodoWrite tasks | **No** | Deleted on session end |
+| Plan Mode state | **No** | In-memory only |
+
+This command bridges the gap by saving what Claude Code doesn't.
+
+## Output Files
+
+### .claude/claude-state.json (v2.0)
+
+```json
+{
+  "version": "2.0",
+  "timestamp": "2025-11-27T10:30:00Z",
+
+  "todos": {
+    "completed": ["Set up OAuth credentials"],
+    "in_progress": ["Fix callback URL handling"],
+    "pending": ["Add token refresh"]
+  },
+
+  "plan": {
+    "file": "docs/PLAN.md",
+    "goal": "Add user authentication with OAuth2",
+    "current_step": "Step 3: Implement OAuth flow",
+    "current_step_index": 3,
+    "total_steps": 5,
+    "progress_percent": 40
+  },
+
+  "git": {
+    "branch": "feature/auth",
+    "last_commit": "abc123f",
+    "last_commit_message": "feat: Add OAuth config",
+    "uncommitted_count": 3,
+    "uncommitted_files": [
+      "src/auth/oauth.ts",
+      "src/auth/callback.ts",
+      "tests/auth.test.ts"
+    ]
+  },
+
+  "notes": "Stopped at callback URL issue - need to fix redirect"
+}
+```
+
+### .claude/claude-progress.md
+
+```markdown
+# Session Progress
+
+**Saved**: 2025-11-27 10:30 AM
+**Branch**: feature/auth
+
+## Plan Context
+
+**Goal**: Add user authentication with OAuth2
+**Current Step**: ◐ Step 3 - Implement OAuth flow [M]
+**Progress**: ██████░░░░ 40% (2/5 steps)
+
+## Tasks
+
+### Completed
+- ✓ Set up OAuth credentials
+
+### In Progress
+- ◐ Fix callback URL handling
+
+### Pending
+- ○ Add token refresh
+
+## Git State
+
+- Last commit: `abc123f` feat: Add OAuth config
+- Uncommitted: 3 files
+
+## Notes
+
+> Stopped at callback URL issue - need to fix redirect
+
+---
+*Restore with: /loadplan*
+```
+
+## Execution Steps
+
+### Step 1: Gather TodoWrite State
+
+Map current TodoWrite tasks by status:
+- `completed` → completed array
+- `in_progress` → in_progress array
+- `pending` → pending array
+
+### Step 2: Gather Plan Context
+
+```bash
+# Check if plan exists
+cat docs/PLAN.md 2>/dev/null
+```
+
+Parse from docs/PLAN.md:
+- Goal line: `**Goal**:`
+- Current step: line with `◐` marker
+- Count `✓` for completed, total for progress
+
+### Step 3: Gather Git Context
+
+```bash
+git branch --show-current
+git log -1 --format="%h %s"
+git status --porcelain
+git diff --stat
+```
+
+### Step 4: Create Directory
+
+```bash
+mkdir -p .claude
+```
+
+### Step 5: Write State Files
+
+Write both:
+- `.claude/claude-state.json` - machine-readable
+- `.claude/claude-progress.md` - human-readable
+
+### Step 6: Confirm
+
+```
+✓ Plan session saved
+
+┌─ Saved State ──────────────────────────────────────────────────────────────────────────────────┐
+│ Plan: Step 3/5 (40%) - Implement OAuth flow                                                    │
+│ Tasks: 1 completed, 1 in progress, 1 pending                                                   │
+│ Git: 3 uncommitted files                                                                       │
+│ Notes: "Stopped at callback URL issue..."                                                      │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+
+Files:
+  • .claude/claude-state.json
+  • .claude/claude-progress.md
+
+Restore with: /loadplan
+```
+
+## Usage Examples
+
+```bash
+# Basic save
+/saveplan
+
+# Save with notes
+/saveplan "Stopped at callback URL issue"
+
+# Save and commit state files
+/saveplan --commit
+
+# Save with notes and commit
+/saveplan "Ready for review" --commit
+```
+
+## Flags
+
+| Flag | Effect |
+|------|--------|
+| `--commit` | Git commit state files after saving |
+| `--force` | Overwrite without confirmation |
+| `--no-plan` | Skip plan context capture |
+
+## Integration
+
+Part of the plan management suite:
+
+```
+┌────────────────────────────────────────────────────────────────────────────────────────────────┐
+│                                    Session Lifecycle                                           │
+├────────────────────────────────────────────────────────────────────────────────────────────────┤
+│                                                                                                │
+│          START                        WORK                          END                        │
+│            │                           │                             │                         │
+│            ▼                           ▼                             ▼                         │
+│    /sync + /loadplan ─────────→ /showplan (anytime) ──────────→ /saveplan                     │
+│            │                           │                             │                         │
+│         Restore                      Status                       Persist                      │
+│         context                       view                        state                        │
+│                                                                                                │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+```
+
+## Notes
+
+- Always captures plan context if docs/PLAN.md exists
+- State files are gitignored by default
+- Use `--commit` to track state in git
+- Notes are preserved and shown on `/loadplan`

+ 0 - 1
commands/session-manager

@@ -1 +0,0 @@
-Subproject commit 9323225809184398343f030abcebdd4e46b9f171

+ 174 - 0
commands/showplan.md

@@ -0,0 +1,174 @@
+---
+description: "Show plan status: progress, active tasks, git state. Quick read-only view of current project state."
+---
+
+# ShowPlan - Plan Status View
+
+Quick read-only view showing plan progress, active tasks, and git state.
+
+## What This Command Does
+
+```
+/showplan
+    │
+    ├─→ Read docs/PLAN.md
+    │     └─ Parse current step, progress, blockers
+    │
+    ├─→ Read TodoWrite state
+    │     └─ Get in-progress and pending tasks
+    │
+    ├─→ Read git state
+    │     └─ Branch, uncommitted changes, recent commits
+    │
+    └─→ Display unified status view
+```
+
+## Output Format
+
+```
+📊 Plan Status
+
+┌─ Plan ─────────────────────────────────────────────────────────────────────────────────────────┐
+│ docs/PLAN.md (updated 2 hours ago)                                                             │
+│                                                                                                │
+│ Goal: Add user authentication with OAuth2                                                      │
+│                                                                                                │
+│ ✓ Step 1: Research OAuth providers [S]                                                         │
+│ ✓ Step 2: Set up Google OAuth app [S]                                                          │
+│ ◐ Step 3: Implement OAuth flow [M]  ← CURRENT                                                  │
+│ ○ Step 4: Add token refresh [S]                                                                │
+│ ○ Step 5: Write integration tests [M]                                                          │
+│                                                                                                │
+│ Progress: ██████░░░░ 40% (2/5)                                                                 │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+
+┌─ Active Tasks ─────────────────────────────────────────────────────────────────────────────────┐
+│ ◐ Fix callback URL handling                                                                    │
+│ ○ Add token refresh logic                                                                      │
+│ ✓ Set up OAuth credentials                                                                     │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+
+┌─ Git ──────────────────────────────────────────────────────────────────────────────────────────┐
+│ Branch: feature/auth                                                                           │
+│ Uncommitted: 3 files (+45/-12)                                                                 │
+│   • src/auth/oauth.ts               +32/-8                                                     │
+│   • src/auth/callback.ts            +13/-4                                                     │
+│   • tests/auth.test.ts              (new)                                                      │
+│                                                                                                │
+│ Recent commits:                                                                                │
+│   • abc123f feat: Add OAuth config                                                             │
+│   • def456a fix: Handle token expiry                                                           │
+│   • 789ghij refactor: Extract auth utils                                                       │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+
+┌─ Suggestions ──────────────────────────────────────────────────────────────────────────────────┐
+│ → 3 files ready to commit                                                                      │
+│ → Plan is 2 days stale, run: /plan --sync                                                      │
+│ → Save before leaving: /saveplan                                                               │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+```
+
+## Execution Steps
+
+### Step 1: Check for Plan
+
+```bash
+# Check if plan exists
+cat docs/PLAN.md 2>/dev/null
+```
+
+If no plan found:
+```
+┌─ Plan ─────────────────────────────────────────────────────────────────────────────────────────┐
+│ ⚠  Plan: No docs/PLAN.md found                                                                 │
+│    Create one with: /plan "your project goal"                                                  │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+```
+
+If no saved state but plan exists:
+```
+┌─ Session ──────────────────────────────────────────────────────────────────────────────────────┐
+│ ⚠  State: No saved state found in .claude/claude-state.json                                    │
+│ ✅  Plan: Project plan found at docs/PLAN.md                                                    │
+└────────────────────────────────────────────────────────────────────────────────────────────────┘
+```
+
+### Step 2: Parse Plan
+
+Extract from docs/PLAN.md:
+- **Goal**: from `**Goal**:` line
+- **Steps**: lines starting with `✓`, `◐`, `○`, `⚠`
+- **Current step**: the one marked with `◐`
+- **Progress**: count completed vs total
+
+### Step 3: Get TodoWrite State
+
+Read current TodoWrite tasks:
+- `in_progress` → show with ◐
+- `pending` → show with ○
+- `completed` → show with ✓ (recent only)
+
+### Step 4: Get Git State
+
+```bash
+# Current branch
+git branch --show-current
+
+# Uncommitted changes with stats
+git diff --stat
+git diff --cached --stat
+
+# Count changes
+git status --porcelain
+```
+
+### Step 5: Generate Suggestions
+
+Based on state, suggest next actions:
+
+| Condition | Suggestion |
+|-----------|------------|
+| Uncommitted files > 0 | "X files ready to commit" |
+| Plan modified > 2 days ago | "Plan may be stale, run: /plan --sync" |
+| No saved state exists | "Save progress with: /saveplan" |
+| In-progress task exists | "Continue: <task name>" |
+| All tasks complete | "Mark plan step complete: /plan --status" |
+
+## Flags
+
+| Flag | Effect |
+|------|--------|
+| `--brief` | Compact single-line summary |
+| `--plan` | Show only plan section |
+| `--tasks` | Show only tasks section |
+| `--git` | Show only git section |
+
+## Brief Mode
+
+```bash
+/showplan --brief
+```
+
+Output:
+```
+📊 Plan: 2/5 (◐ Step 3) │ Tasks: 1 active, 2 pending │ Git: 3 uncommitted
+```
+
+## Integration
+
+Part of the plan management suite:
+
+| Command | Purpose |
+|---------|---------|
+| `/sync` | Read project context at session start |
+| `/loadplan` | Restore TodoWrite + plan state from saved JSON |
+| `/showplan` | **This command** - Quick status view |
+| `/saveplan` | Persist state before leaving |
+| `/plan` | Create or manage project plans |
+
+## Notes
+
+- Read-only command, never modifies files
+- Fast execution, can run frequently
+- Shows suggestions based on detected state
+- Works even without plan (shows tasks + git only)

+ 165 - 0
commands/sync.md

@@ -0,0 +1,165 @@
+---
+description: "Session bootstrap - read project context (README, AGENTS, docs, skills, agents). Quick project orientation without full codebase exploration."
+---
+
+# Sync - Session Bootstrap
+
+Read yourself into this project. Loads essential context without exploring the full codebase.
+
+## CRITICAL: Cache-First Strategy
+
+### Step 1: Check Cache
+
+First, read `.claude/sync-cache.json`. If it exists and is valid, skip to Step 3.
+
+Cache is valid if ALL are true:
+- File exists
+- `readme_hash` matches current README.md hash
+- `agents_hash` matches current AGENTS.md hash
+- `plan_hash` matches current docs/PLAN.md hash (or both null if file missing)
+
+To check hashes, run ONE bash command:
+```bash
+md5sum README.md AGENTS.md docs/PLAN.md 2>/dev/null
+```
+
+### Step 2: Generate Cache (only if cache invalid/missing)
+
+**INVOKE THE TASK TOOL** with `subagent_type: "general-purpose"` and `model: "haiku"`:
+
+```
+Gather project context. Return markdown.
+
+READ (skip if missing):
+- README.md (full)
+- AGENTS.md (full)
+- CLAUDE.md (first 100 lines)
+- docs/PLAN.md (first 100 lines)
+
+GLOB:
+- docs/*.md
+- .claude/commands/*.md
+- .claude/skills/*/SKILL.md
+- .claude/agents/*.md
+
+RETURN THIS FORMAT:
+
+## Summary
+[1-2 paragraphs from README/AGENTS]
+
+## Quick Reference
+| Category | Items |
+|----------|-------|
+| **Project** | [name] - [purpose] |
+| **Docs** | [filenames] |
+| **Commands** | [names] or None |
+| **Skills** | [names] or None |
+| **Agents** | [names] or None |
+```
+
+Then WRITE `.claude/sync-cache.json`:
+```json
+{
+  "readme_hash": "[MD5 hash of README.md]",
+  "agents_hash": "[MD5 hash of AGENTS.md]",
+  "plan_hash": "[MD5 hash of docs/PLAN.md or null if missing]",
+  "content": "[the markdown output]"
+}
+```
+
+### Step 3: Display Output
+
+Read cache, then run ONE bash for live state:
+```bash
+git branch --show-current && git status --porcelain | wc -l && test -f .claude/claude-state.json && stat -c %Y .claude/claude-state.json 2>/dev/null
+```
+
+Output cached content + live git/plan/state info.
+
+## Output Format
+
+```
+🔄 Project Synced: [project-name]
+
+## Summary
+
+[1-2 paragraph narrative summary based on README.md and AGENTS.md:
+- What this project is and its purpose
+- Key conventions or guidelines from AGENTS.md
+- Current state (active plan, recent work, etc.)
+- Any special instructions from CLAUDE.md that affect how to work]
+
+## Quick Reference
+
+| Category | Items |
+|----------|-------|
+| **Project** | [name] - [one-line purpose from README] |
+| **Key Docs** | [list of docs/*.md filenames] |
+| **Commands** | [list of /command names from .claude/commands/] |
+| **Skills** | [list of skill names from .claude/skills/] |
+| **Agents** | [list of agent names from .claude/agents/] |
+| **Plan** | [Step X/Y - description] or "No active plan" |
+| **Saved State** | [timestamp] or "None" |
+| **Git** | [branch], [N] uncommitted files |
+
+## Recommended Next Steps
+
+Based on the current state, suggest 2-3 logical actions:
+
+1. **[Primary action]** - [why this makes sense given current state]
+2. **[Secondary action]** - [context]
+3. **[Tertiary action or "Ready for new task"]**
+
+Examples of recommendations:
+- If saved state exists: "Run `/loadplan` to restore your previous session tasks"
+- If plan exists and in-progress: "Continue with Step N: [description]"
+- If uncommitted changes: "Review and commit staged changes"
+- If no plan/state: "Ready for new task - no pending work detected"
+```
+
+## Edge Cases
+
+### No README.md
+```
+⚠ No README.md found - project overview unavailable
+```
+
+### No docs/ directory
+```
+ℹ No docs/ directory - documentation not set up
+```
+
+### First time in project (no .claude/ directory)
+```
+ℹ Fresh project - no Claude configuration found
+   Consider: /init to set up CLAUDE.md
+```
+
+## Integration with Other Commands
+
+| Command | Relationship |
+|---------|--------------|
+| `/sync` | **This command** - Read project context |
+| `/loadplan` | Restore TodoWrite + plan state from saved JSON |
+| `/saveplan` | Persist TodoWrite + plan state to JSON |
+| `/dash` | Quick status dashboard (read-only) |
+| `/plan` | Create or manage project plans |
+
+### Typical Session Flow
+
+```
+New Session
+────────────────────────────────────────────────────────────────────────
+  1. /sync              ← Read project context (always)
+  2. /loadplan          ← Restore saved tasks (if continuing work)
+  3. ... work ...
+  4. /dash              ← Check status anytime
+  5. /saveplan          ← Save before ending session
+```
+
+## Notes
+
+- This is a **read-only** command - never modifies files
+- Designed for **quick orientation**, not deep analysis
+- Works in any project, with or without Claude configuration
+- Does NOT invoke skills or subagents - pure file reading