diff --git a/.gitignore b/.gitignore
index c912ee3cf..4410528fe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -480,3 +480,5 @@ docs/plans/
# Artefacts (served from artefact-store, not committed to source repo)
docs/artefacts/
+pytest-of-*/
+uv-*.lock
diff --git a/README.md b/README.md
index 27325eb3f..bca29863a 100644
--- a/README.md
+++ b/README.md
@@ -1,21 +1,39 @@
# Socratic Study Mentor
-> π§ An AuDHD-aware Socratic study mentor with AI session management
+> π§ An AuDHD-aware study toolkit: Socratic questioning, content pipelines, spaced repetition, and AI session tracking.




-## What is this?
+## What Does It Do?
-An open-source study toolkit designed specifically for AuDHD learners. It combines two CLI tools with AI mentor agents that teach through Socratic questioning rather than lectures β because our brains get dopamine from *discovering* answers, not being told them. The toolkit tracks your AI study sessions across 7 tools (Claude Code, Kiro CLI, Gemini, etc.) into a searchable database, then uses that history to power spaced repetition scheduling (1/3/7/14/30 day intervals), detect topics you're repeatedly struggling with, and show you concrete evidence of progress β because RSD and imposter syndrome mean we're terrible at recognising how far we've come. It also supports body doubling sessions, energy-adaptive study modes (low energy day? shorter chunks, more scaffolding), and hyperfocus guardrails. It also supports voice output β the mentor can speak questions aloud using high-quality local TTS, adding an auditory channel that helps AuDHD learners stay focused. The agents work with both kiro-cli and Claude Code, and the whole thing syncs across machines. If you're neurodivergent and self-teaching (especially career transitions), this might help β it's built by someone in exactly that position.
+Four things:
-## Who is this for?
+1. **Socratic AI sessions** β Body doubling with AI mentors that ask questions instead of giving answers. Energy-adaptive (low day? shorter chunks, more scaffolding).
+2. **Content pipeline** β Chunk eBooks and Obsidian notes into Google NotebookLM notebooks β generate audio overviews, quizzes, and flashcards.
+3. **Flashcard review** β Spaced repetition (SM-2) via a PWA web app. Works on phone, tablet, laptop.
+4. **Session tracking** β Export AI coding sessions (Claude Code, Kiro, Gemini, etc.) into a searchable SQLite database. Track trends, find struggle topics, search across sessions.
-- **AuDHD learners** who need structured, dopamine-friendly study approaches
-- **Self-taught developers** who benefit from Socratic questioning over passive reading
-- **Anyone** who wants to track AI study sessions and build spaced repetition into their learning
+Built by a neurodivergent learner transitioning from networking to data engineering. If you're self-teaching and AuDHD, this might help.
+
+## Quick Start
+
+```bash
+# Install
+pip install studyctl agent-session-tools
+
+# Configure
+studyctl setup # Interactive 3-question wizard
+studyctl doctor # Verify everything is healthy
+
+# Use
+studyctl content process SOURCE # Split PDF β upload to NotebookLM
+studyctl web # Launch flashcard/quiz PWA
+session-export # Export AI sessions to SQLite
+session-query search "decorators" # Search across all sessions
+```
## Architecture
@@ -23,7 +41,7 @@ An open-source study toolkit designed specifically for AuDHD learners. It combin
graph LR
subgraph "Study Materials"
OB[Obsidian Vault]
- NLM[NotebookLM optional]
+ NLM[NotebookLM]
end
subgraph "CLI Tools"
@@ -33,390 +51,124 @@ graph LR
end
subgraph "AI Agents"
- KA[kiro-cli]
CA[Claude Code]
+ KA[Kiro CLI]
GA[Gemini CLI]
OA[OpenCode]
- AA[Amp]
+ end
+
+ subgraph "Live Session"
+ IPC["IPC Files (state, topics, parking)"]
+ SSE["Web Dashboard (SSE + HTMX)"]
end
OB -->|sync| SC
SC -->|upload| NLM
SC -->|spaced repetition| DB
AST -->|export sessions| DB
- DB -->|query history| SC
- KA -->|Socratic sessions| DB
CA -->|Socratic sessions| DB
+ KA -->|Socratic sessions| DB
GA -->|Socratic sessions| DB
OA -->|Socratic sessions| DB
- AA -->|Socratic sessions| DB
+ CA -->|writes| IPC
+ IPC -->|polls| SSE
```
-## Features
-
-**studyctl** β Study pipeline management
-- Content pipeline β split PDFs by chapter, upload to NotebookLM, generate audio/video/flashcards
-- Syllabus workflow β chunked podcast generation with autopilot and progress tracking
-- Obsidian-to-NotebookLM β convert markdown notes to PDFs and upload in one step
-- Sync Obsidian notes to Google NotebookLM notebooks
-- Spaced repetition scheduling (1/3/7/14/30 day intervals)
-- Struggle topic detection from session history
-- Win tracking β see concepts you've mastered, fight imposter syndrome
-- Calendar time-blocking β generate `.ics` study blocks from your review schedule
-- Progress recording with confidence levels (struggling β learning β confident β mastered)
-- Concept graph β track how concepts relate (prerequisites, analogies, confusion risks)
-- Prerequisite chain traversal β find the root cause when you're stuck
-- Cross-machine state sync via SSH
-- Scheduled auto-sync (launchd on macOS, cron on Linux)
-
-**agent-session-tools** β AI session management
-- 7 source exporters: Claude Code, Kiro CLI, Gemini CLI, Aider, OpenCode, LiteLLM, RepoPrompt
-- FTS5 full-text search across all sessions
-- Hybrid semantic search (FTS + vector embeddings)
-- Session classification and deduplication
-- Study progress and energy tracking database
-- Cross-machine database sync via SSH
-
-**AI Agents** β Socratic mentoring
-- AuDHD-aware teaching methodology (questions > lectures)
-- Energy-adaptive sessions (low/medium/high adjusts difficulty and chunk size)
-- Emotional regulation check (calm/anxious/frustrated/flat/shutdown)
-- Transition support with grounding rituals
-- Parking lot for tangential thoughts
-- Sensory environment adaptation
-- Micro-celebrations for dopamine maintenance
-- Interleaved review sessions
-- End-of-session protocol: auto-record progress, suggest next review, offer calendar blocks
-- Break reminders at 25/50/90 minute intervals
-- Claude Code status line showing energy level, session timer, and context usage
-- NetworkβData Engineering concept bridges
-- Body doubling session support
-- Progress tracking across agents and machines
-- Voice output via study-speak (kokoro-onnx TTS, am_michael voice)
-- @speak-start/@speak-stop toggle for voice control
-- Configurable voice, speed, and backend
-
-**MCP Integrations** β Optional calendar and reminder support
-- Apple Calendar + Reminders (macOS) β native notifications for study time
-- Google Calendar (cross-platform) β time-blocking via built-in connector or MCP server
-- See [agents/mcp/README.md](agents/mcp/README.md) for setup
-
-## Quick Start
-
-### Install (pick one)
-
-```bash
-# PyPI (recommended)
-pip install studyctl
-
-# Homebrew (macOS)
-brew install NetDevAutomate/studyctl/studyctl
-
-# From source
-git clone https://github.com/NetDevAutomate/socratic-study-mentor.git
-cd socratic-study-mentor
-./scripts/install.sh
-```
-
-### 3 Steps to Start
-
-```bash
-studyctl setup # Interactive configuration wizard
-studyctl doctor # Verify everything is healthy
-studyctl web # Launch the study web app
-```
-
-### Verify your install
-
-`studyctl doctor` checks your entire installation β Python version, packages, config, databases, optional dependencies, and agent definitions. Run it any time something feels off:
-
-```bash
-studyctl doctor # Rich table with pass/warn/fail indicators
-studyctl doctor --json # Machine-readable output (used by AI agents)
-studyctl doctor --quiet # One-line summary
-```
-
-If issues are found, `studyctl upgrade` fixes what it can automatically:
-
-```bash
-studyctl update # Check what's available (no changes)
-studyctl upgrade # Apply fixes (packages, DB migrations, agents)
-studyctl upgrade --dry-run # Preview changes first
-```
-
-### AI-guided setup
-
-If you're using an AI coding assistant (Claude Code, Kiro, Gemini CLI, etc.), the **install-mentor agent** can walk you through the entire setup conversationally. It uses `studyctl doctor --json` to detect issues and fix them automatically. See [agents/shared/install-mentor.md](agents/shared/install-mentor.md).
-
-### Optional extras
-
-```bash
-pip install 'studyctl[all]' # Everything (web, tui, content, mcp, notebooklm)
-pip install 'studyctl[web]' # FastAPI web UI
-pip install 'studyctl[content]' # PDF splitting + NotebookLM content pipeline
-pip install 'studyctl[mcp]' # MCP server for AI coding assistants
-```
-
-### From source (advanced)
-
-The install script registers CLI tools globally, sets up agent definitions for any detected AI tools, and optionally downloads the voice model for TTS support.
-
-```bash
-./scripts/install.sh # Full install (interactive)
-./scripts/install.sh --non-interactive # For Ansible/CI
-./scripts/install.sh --tools-only # Just CLI tools
-./scripts/install.sh --agents-only # Just agent definitions
-```
-
-Then run the interactive setup wizard:
-
-```bash
-studyctl config init
-```
-
-This asks three core questions: whether to enable knowledge bridging (leveraging topics you already know), NotebookLM integration, and Obsidian vault path.
-
-## Documentation Site
-
-Browse the full docs locally with AuDHD-friendly design (OpenDyslexic font toggle, Nord colour scheme, reading preferences):
-
-```bash
-cd socratic-study-mentor
-uv run mkdocs serve
-# Open http://localhost:8000
-```
-
-## Agent Support
-
-| Platform | Agent | Description |
-|----------|-------|-------------|
-| kiro-cli | `study-mentor` | Full study session management with spaced repetition and NotebookLM |
-| Claude Code | `socratic-mentor` | Socratic questioning with AuDHD-aware pedagogy |
-| Claude Code | `mentor-reviewer` | Autonomous code review with scoring and tutorial generation |
-| Gemini CLI | `study-mentor` | Socratic study sessions with energy-adaptive teaching |
-| OpenCode | `study-mentor` | AuDHD-aware study mentor with spaced repetition |
-| Amp | (via AGENTS.md) | Socratic mentoring loaded automatically from project context |
-
-Start a session:
-
-```bash
-# kiro-cli
-kiro-cli chat --agent study-mentor
-
-# Claude Code
-/agent socratic-mentor
-
-# Gemini CLI (subagent auto-detected)
-gemini # then ask for study session
-
-# OpenCode
-opencode # Tab to switch to study-mentor
-
-# Amp
-amp # AGENTS.md loaded automatically
-```
-
-See [docs/agent-install.md](docs/agent-install.md) for setup details.
-
-## Optional Dependencies
-
-| Feature | Package | Install |
-|---------|---------|---------|
-| Content pipeline | `pymupdf`, `httpx` | `uv pip install studyctl[content]` |
-| NotebookLM sync | `notebooklm-py` | `uv pip install studyctl[notebooklm]` |
-| Semantic search | `sentence-transformers` | `uv pip install agent-session-tools[semantic]` |
-| Token counting | `tiktoken` | `uv pip install agent-session-tools[tokens]` |
-| TUI interface | `textual` | `uv pip install studyctl[tui]` |
-| TTS voice output | `kokoro-onnx` | `uv tool install "./packages/agent-session-tools[tts]"` |
-
## CLI Reference
### studyctl
```bash
-# Study & review
-studyctl review # Check spaced repetition due dates
-studyctl struggles --days 30 # Find recurring struggle topics
-studyctl wins --days 30 # Show your learning wins
-studyctl streaks # Show study streak and consistency
-studyctl resume # Where you left off β quick context reload
-studyctl progress CONCEPT -t TOPIC -c LEVEL # Record progress on a concept
-studyctl progress-map # Visual map of all tracked concepts
-studyctl teachback CONCEPT -t TOPIC -s SCORES --type TYPE # Record teach-back score
-studyctl teachback-history CONCEPT # Show teach-back score progression
-
-# Knowledge bridges
-studyctl bridge add SRC TGT -s DOMAIN -t DOMAIN # Add a knowledge bridge
-studyctl bridge list # List knowledge bridges
-
-# NotebookLM sync
-studyctl sync [TOPIC] --all --dry-run # Sync notes to NotebookLM
-studyctl status [TOPIC] # Show sync status
-studyctl topics # List configured topics
-studyctl audio TOPIC # Generate NotebookLM audio overview
-studyctl dedup [TOPIC] --all --dry-run # Remove duplicate notebook sources
-
-# Health & updates
-studyctl doctor # Check installation health
-studyctl doctor --json # Machine-readable diagnostics
-studyctl update # Check for available updates
-studyctl upgrade # Apply updates (packages, DB, agents)
-studyctl upgrade --dry-run # Preview what would change
-
-# Configuration & scheduling
-studyctl config init # Interactive setup wizard
-studyctl config show # Display current configuration
-studyctl schedule install|remove|list # Manage scheduled jobs
-studyctl schedule-blocks --start 14:00 # Generate .ics calendar study blocks
-studyctl state push|pull|status|init # Cross-machine state sync
-
-# Interfaces
-studyctl web [--port PORT] [--host HOST] # Launch study PWA web app
-studyctl tui # Launch interactive TUI dashboard
-studyctl docs serve|open|list|read # Browse and read documentation
+# Study sessions (tmux + AI agent + sidebar)
+studyctl study "topic" --energy 7 # Full tmux environment in one command
+studyctl study --resume # Resume conversation from history
+studyctl study --end # End session (quit Claude also works)
+studyctl park "question" # Park tangential topic
+
+# Content pipeline
+studyctl content split SOURCE # Split PDF by chapters
+studyctl content process SOURCE # Split + upload to NotebookLM
+studyctl content autopilot # Generate next pending episode
+studyctl content from-obsidian DIR # Markdown β PDF β NotebookLM
+
+# Review
+studyctl review # Check spaced repetition due dates
+studyctl struggles --days 30 # Find recurring struggle topics
+studyctl web # Launch flashcard/quiz PWA
+
+# Sync
+studyctl sync [TOPIC] --all # Sync notes to NotebookLM
+studyctl status # Show sync status
+studyctl topics # List configured topics
+
+# Health
+studyctl doctor # Check installation health
+studyctl setup # Interactive configuration
```
-### Web PWA (recommended for multi-device study)
-
-Launch the study web app with `studyctl web`. Accessible from any device on the network β phone, tablet, laptop. No extra dependencies.
+### agent-session-tools
```bash
-studyctl web # LAN accessible on port 8567
-studyctl web --port 9000 # Custom port
+session-export # Export AI sessions to SQLite
+session-query search QUERY # Full-text search across sessions
+session-query list --since 7d # List recent sessions
+session-query stats # Database statistics
+session-sync push/pull/sync HOST # Cross-machine sync
```
-**Features:**
-- Flashcard and quiz review with SM-2 spaced repetition
-- Source/chapter filter β study specific chapters
-- Card count limiter β choose 10/20/50/100/All per session
-- Due cards indicator on course picker
-- Session history with scores and 90-day study heatmap
-- Retry wrong answers mode
-- Pomodoro timer (25min study / 5min break with audio chime + notifications)
-- Voice output via Web Speech API β reads questions/answers aloud, works on any device
-- Voice selector dropdown β choose from all English voices available on your device
-- Read-once button (speaker icon on card) or auto-voice toggle (header)
-- OpenDyslexic font toggle for accessibility
-- Dark/light theme toggle
-- PWA installable β add to home screen on iOS/Android
-- Keyboard shortcuts: `Space` flip, `Y`/`N` answer, `T` read aloud, `V` auto-voice, `S` skip, `R` retry
-
-
-
-**Voice setup:** The PWA uses your device's built-in text-to-speech. For best quality, download enhanced voices: Settings β Accessibility β Spoken Content β Voices β English β download Samantha (Enhanced) or Siri voices.
-
-**Config:**
-
-```yaml
-# ~/.config/studyctl/config.yaml
-review:
- directories:
- - ~/Desktop/ZTM-DE/downloads
- - ~/Desktop/Python/downloads
-tui:
- theme: dracula # Textual theme (TUI only)
- dyslexic_friendly: true # Wider spacing in TUI
-```
-
-### TUI Dashboard (terminal)
-
-Launch the terminal dashboard with `studyctl tui`. Requires the `[tui]` extra (`uv pip install studyctl[tui]`).
+## Agent Support
-**Tabs:** Dashboard, Review, Concepts, Sessions, StudyCards
+| Platform | Agent | Start With |
+|----------|-------|------------|
+| Claude Code | `socratic-mentor` | `/agent socratic-mentor` |
+| Kiro CLI | `study-mentor` | `kiro-cli chat --agent study-mentor` |
+| Gemini CLI | `study-mentor` | `gemini` (auto-detected) |
+| OpenCode | `study-mentor` | Tab to switch agent |
-| Key | Action |
-|-----|--------|
-| `f` | Start flashcard session |
-| `z` | Start quiz session |
-| `space` | Flip card / submit answer |
-| `y` / `n` | Mark correct / incorrect |
-| `r` | Retry wrong answers (after session) |
-| `v` | Toggle voice output |
-| `o` | Toggle OpenDyslexic spacing |
-| `h` | Show hint (quiz mode) |
-| `q` | Quit |
+## Web PWA
-
+Launch with `studyctl web`. Accessible from any device on the network.
-### studyctl content
+**Flashcard review:**
+- SM-2 spaced repetition with source/chapter filter
+- Session history with 90-day study heatmap
+- Pomodoro timer, voice output, OpenDyslexic font toggle
+- PWA installable β add to home screen
-```bash
-# PDF splitting
-studyctl content split SOURCE [-o DIR] [-l LEVEL] # Split PDF by TOC bookmarks
-studyctl content split SOURCE --ranges '1-30,31-60' # Split by page ranges
-
-# Full pipeline (split + upload)
-studyctl content process SOURCE [-n NOTEBOOK_ID] # Split PDFs and upload to NotebookLM
-
-# NotebookLM management
-studyctl content list [-n NOTEBOOK_ID] # List notebooks or sources
-studyctl content generate -n ID -c '1-3' # Generate audio/video overviews
-studyctl content download -n ID [-o DIR] # Download artifacts
-studyctl content delete -n ID # Delete a notebook
-
-# Syllabus workflow (chunked podcast generation)
-studyctl content syllabus -n ID [-o DIR] # Generate episode plan from sources
-studyctl content autopilot [-o DIR] # Generate next pending episode
-studyctl content status [-o DIR] # Show syllabus progress
-
-# Obsidian integration
-studyctl content from-obsidian SOURCE_DIR # Convert markdown β PDF β NotebookLM
-```
+**Live session dashboard** (`/session`):
+- Real-time activity feed via SSE (Server-Sent Events)
+- Timer with energy-adaptive colour phases (green/amber/red)
+- Topic counters (wins, parked, review)
+- Session summary on completion
+- HTMX + Alpine.js β no build step
-Requires optional dependencies: `uv pip install studyctl[content]` for PDF splitting, plus `uv pip install studyctl[notebooklm]` for NotebookLM commands.
-
-### agent-session-tools
+## Optional Extras
```bash
-session-export [--source SOURCE] # Export AI sessions to SQLite
-session-query search QUERY # Full-text search across sessions
-session-query list --since 7d # List recent sessions
-session-query show SESSION_ID # Show session details
-session-query context SESSION_ID # Generate context for resuming
-session-query stats # Database statistics
-session-sync push macmini # Push sessions to a named host
-session-sync pull macbookpro # Pull sessions from a named host
-session-sync sync work-macbook # Two-way sync with a host
-session-sync endpoints # List all configured remote hosts
-session-maint vacuum|reindex|schema # Database maintenance
-tutor-checkpoint code --skill SKILL # Record study progress
-study-speak TEXT # Speak text aloud using TTS
-study-speak - < file.txt # Speak from stdin
-study-speak TEXT -v af_heart -s 1.2 # Custom voice and speed
+pip install 'studyctl[all]' # Everything
+pip install 'studyctl[web]' # FastAPI web UI
+pip install 'studyctl[content]' # PDF splitting + NotebookLM
+pip install 'studyctl[notebooklm]' # NotebookLM API client
```
-> **Single config for all machines:** Define hosts once in `~/.config/studyctl/config.yaml`, deploy the same file everywhere. Both `studyctl state push/pull` and `session-sync push/pull/sync` read from it β local machine auto-detected by hostname. See [Setup Guide](docs/setup-guide.md#hosts--cross-machine-sync).
-
## Documentation
-- [Setup Guide](docs/setup-guide.md) β Installation, configuration, Obsidian setup
-- [Install Mentor](agents/shared/install-mentor.md) β AI-guided setup agent (works with any AI coding tool)
-- [Agent Installation](docs/agent-install.md) β AI agent setup for kiro-cli, Claude Code, Gemini CLI, OpenCode, and Amp
-- [AuDHD Learning Philosophy](docs/audhd-learning-philosophy.md) β Why this exists and how it works
-- [MCP Integrations](agents/mcp/README.md) β Calendar, reminders, and other MCP server configs
-- [Voice Output Guide](docs/voice-output.md) β TTS setup, configuration, and agent integration
-- [Roadmap](docs/roadmap.md) β Feature roadmap and release history
-- [Contributing](CONTRIBUTING.md) β Development setup and contribution guide
-
-## Contributing
-
-See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, code style, and how to add new exporters or study topics.
-
-## Acknowledgements
-
-> **Special thanks to [Teng Lin](https://github.com/teng-lin)** for creating the excellent [notebooklm-py](https://github.com/teng-lin/notebooklm-py) library, which powers all NotebookLM integration across the study mentor ecosystem. His work in reverse-engineering and wrapping the NotebookLM API made the audio/video overview generation in [notebooklm-pdf-by-chapters](https://github.com/andytaylor/notebooklm-pdf-by-chapters) and [notebooklm-repo-artefacts](https://github.com/andytaylor/notebooklm-repo-artefacts) possible.
+- [Setup Guide](docs/setup-guide.md)
+- [Agent Installation](docs/agent-install.md)
+- [AuDHD Learning Philosophy](docs/audhd-learning-philosophy.md)
+- [Voice Output Guide](docs/voice-output.md)
+- [Contributing](CONTRIBUTING.md)
## Generated Artefacts
-> π **Explore this project** β AI-generated overviews via [Google NotebookLM](https://notebooklm.google.com)
+> π AI-generated overviews via [Google NotebookLM](https://notebooklm.google.com)
| | |
|---|---|
-| π§ **[Listen to the Audio Overview](https://artefacts.netdevautomate.dev/socratic-study-mentor/artefacts/)** | Two AI hosts discuss the project β great for commutes |
-| π¬ **[Watch the Video Overview](https://artefacts.netdevautomate.dev/socratic-study-mentor/artefacts/#video)** | Visual walkthrough of architecture and concepts |
-| πΌοΈ **[View the Infographic](https://artefacts.netdevautomate.dev/socratic-study-mentor/artefacts/#infographic)** | Architecture and flow at a glance |
-| π **[Browse the Slide Deck](https://artefacts.netdevautomate.dev/socratic-study-mentor/artefacts/#slides)** | Presentation-ready project overview |
+| π§ **[Audio Overview](https://artefacts.netdevautomate.dev/socratic-study-mentor/artefacts/)** | Two AI hosts discuss the project |
+| π¬ **[Video Overview](https://artefacts.netdevautomate.dev/socratic-study-mentor/artefacts/#video)** | Visual walkthrough |
+| π **[Slide Deck](https://artefacts.netdevautomate.dev/socratic-study-mentor/artefacts/#slides)** | Presentation-ready overview |
*Generated by [notebooklm-repo-artefacts](https://github.com/NetDevAutomate/notebooklm-repo-artefacts)*
diff --git a/TODO.md b/TODO.md
index e436c53cc..aeac6c5e1 100644
--- a/TODO.md
+++ b/TODO.md
@@ -1,73 +1,114 @@
-# Socratic Study Mentor -- Active Backlog
+# Socratic Study Mentor β Active Backlog
> Single source of truth for outstanding work.
-> For Phase 1-4 implementation details, see `docs/plans/2026-03-15-feat-unified-study-platform-plan.md`.
+> System overview: `docs/system-overview.md`
+
+## Core Features (maintained)
+
+| Feature | Status |
+|---------|--------|
+| Socratic AI sessions (Claude, Kiro, Gemini, OpenCode) | Active |
+| Content pipeline β NotebookLM (split, process, autopilot) | Active |
+| Flashcard/quiz review (PWA web app, SM-2) | Active |
+| Session intelligence (export, search, sync) | Active |
+| Live study sessions (`studyctl study` + tmux + sidebar) | Active |
## Completed (summary)
| Phase | Description | Status |
|-------|-------------|--------|
-| 1 | Fix broken code (spaced repetition, progress, config) | Done |
-| 2 | Unify agent framework (5 platforms, shared docs) | Done |
-| 3 | AuDHD methodology (emotional regulation, parking lot, etc.) | Done |
-| 4 | Documentation site (MkDocs Material, font toggle, custom admonitions) | Done |
-| 5 | Documentation & install polish (README, agent-install, roadmap) | Done |
-| 6 | Centralised artefact store (GitHub Pages, config, store module) | Done |
-| 7 | Unified config & cross-machine sync (hosts, SSH, install scripts) | Done |
-| 8 | StudyCards TUI (review_loader, review_db, SM-2, voice toggle) | Done |
-| 9 | TUI polish & PWA web app (Pomodoro, voice, accessibility) | Done |
-| Phase 0 | Pre-work: config consolidation, CLI split, WAL mode, service layer | Done |
+| 1-9 | Foundation, agents, AuDHD methodology, docs, artefacts, config, TUI, PWA | Done |
+| Phase 0 | Config consolidation, CLI split, WAL mode, service layer | Done |
| Phase 1 | Content absorption: 7 modules, 10 CLI commands, 76 tests | Done |
-| Phase 4 | PyPI + Homebrew tap live, OIDC trusted publishing | Done |
+| Phase 4 | PyPI + Homebrew tap, OIDC trusted publishing | Done |
| Phase 5 | Doctor/upgrade/install-mentor: 3 CLI commands, 7 checker modules | Done |
-| Fixes | Export progress bar (A1), list_concepts (A2), course picker (A3), retry wrong (A4), SQL/connection leaks (A5), narrow exceptions (A6) | Done |
+| Compaction | Strip to 4 core features, 13 CLI commands | Done |
-## Unified Platform Plan -- Next Phases
+### v2.2 β Live Session Dashboard (on `feat+live-session-dashboard` branch)
-### Phase 6: CI/CD Pipeline (next)
+| Item | Status |
+|------|--------|
+| Session CLI (`session start/end/status`, `park`) + IPC protocol | Done |
+| cmux agent protocol (Phase 1.5) | Done |
+| Web dashboard β SSE + HTMX + Alpine.js (`/session`) | Done |
+| Bug fixes β parking dedup, IPC permissions 0700/0600, CORS, SSE mtime | Done |
+| `studyctl study` β tmux session, agent launcher (Claude), Textual sidebar | Done |
+| Agent personas (`study.md`, `co-study.md`) | Done |
+| Auto-cleanup on agent exit + sidebar `Q` end session | Done |
+| Persistent session directories with conversation resume (`claude -r`) | Done |
+| Pomodoro countdown timer (25/5/25/5/25/5/25/15 cycle) | Done |
+| Catppuccin-compatible tmux overlay (no theme clobbering) | Done |
+| System overview doc (`docs/system-overview.md`) | Done |
+| **359 tests pass, all pre-commit hooks pass** | |
-Nightly drift detection, pre-release gate, Docker image pipeline. Spec at `docs/ci-cd-pipeline.md`.
+**Not yet merged to main. Pending: test `--resume` in a real study session, then squash-merge + release v2.2.0.**
-### Phase 7: Docker Web + Server-Side TTS
+## Next
+
+### v2.2 β Remaining Polish (Phase 2)
-Docker image running `studyctl web` with kokoro-onnx server-side TTS.
+- [ ] Vendor HTMX + Alpine.js into `web/static/` (remove CDN, enable offline PWA)
+- [ ] Parked topic warmup at session start (surface unresolved topics from previous sessions)
+- [ ] Break suggestions at timer threshold crossings (from `break-science.md`)
+- [ ] Energy streaks β correlate energy levels with session outcomes in `studyctl streaks`
-### Phase 2: FastAPI Web UI
+### Phase 6: CI/CD Pipeline
-Replace stdlib HTTP server with FastAPI. HTMX + Alpine.js frontend, artefact viewer, progress dashboard. Migrate all 11 existing routes.
+Nightly drift detection, pre-release gate, Docker image pipeline. Spec at `docs/ci-cd-pipeline.md`.
+
+- [ ] Nightly: fresh install on Ubuntu + macOS, `studyctl doctor --json` as gate
+- [ ] Pre-release: upgrade path N-1 β N, triggered on release tags
+- [ ] Docker: `studyctl-web` image with server-side TTS, health check via doctor
-See: `docs/plans/2026-03-15-feat-unified-study-platform-plan.md` -- Phase 2
+### Phase 3: Devices (ttyd + LAN access)
-### Phase 3: MCP Agent Integration
+- [ ] ttyd via nginx/Caddy proxy (Unix socket, htpasswd auth)
+- [ ] pyrage + macOS Keychain for password management
+- [ ] Web terminal embed (iframe with LAN IP, `frame-ancestors` CSP)
+- [ ] `studyctl study --lan` flag
-FastMCP v1 server with stdio transport. Flashcard/quiz generation tools, study context tools, onboarding agent skill.
+### Phase 7: Docker Web + Server-Side TTS
-See: `docs/plans/2026-03-15-feat-unified-study-platform-plan.md` -- Phase 3
+- [ ] Docker image running `studyctl web` with kokoro-onnx TTS
+- [ ] FastAPI audio endpoint for browser playback
## Standalone Items (not blocked by phases)
- [ ] Obsidian export: convert flashcard JSON to Obsidian `#flashcard` format (Spaced Repetition plugin compatible)
+- [ ] Merge `feat+live-session-dashboard` to main + release v2.2.0
+- [ ] Textual sidebar tests (using Textual test framework)
+
+## Archived Features (in git history, restore on demand)
+
+- TUI dashboard (`studyctl tui`) β replaced by Textual sidebar in tmux
+- Scheduler (launchd/cron management)
+- Calendar .ics generation (`schedule-blocks`)
+- Knowledge bridges DB + CLI commands
+- Teach-back scoring DB + CLI commands
+- Crush + Amp agent definitions
## Deferred (add when real demand appears)
-- LAN password auth (`--password` flag + HTTP Basic Auth)
+- LAN password auth (Phase 3 β ttyd + pyrage + Keychain)
- Config editor web UI
-- GitHub Issues API feedback
-- TUI artefact browser
-- Native iOS/macOS app (research in `docs/research/swift-poc-feasibility.md`)
+- Native iOS/macOS app
- AWS cloud sync (Cognito, DynamoDB, push notifications)
+- Agents: Gemini, Kiro, OpenCode launch commands (add when testing against binaries)
## Key File References
| Item | Location |
|------|----------|
-| Unified Platform Plan | `docs/plans/2026-03-15-feat-unified-study-platform-plan.md` |
-| Brainstorm (decisions) | `docs/brainstorms/2026-03-15-unified-study-platform-brainstorm.md` |
-| Code Review Items | `code-review-plan-items.md` |
+| System Overview | `docs/system-overview.md` |
+| Session Architecture Plan | `docs/plans/2026-03-29-feat-unified-session-architecture-plan.md` |
| CLI Package | `packages/studyctl/src/studyctl/cli/` |
+| Study Orchestrator | `packages/studyctl/src/studyctl/cli/_study.py` |
+| tmux Wrapper | `packages/studyctl/src/studyctl/tmux.py` |
+| Agent Launcher | `packages/studyctl/src/studyctl/agent_launcher.py` |
+| Textual Sidebar | `packages/studyctl/src/studyctl/tui/sidebar.py` |
+| Web PWA + Session Dashboard | `packages/studyctl/src/studyctl/web/` |
+| Agent Personas | `agents/shared/personas/` |
| Services Layer | `packages/studyctl/src/studyctl/services/` |
-| Settings (config) | `packages/studyctl/src/studyctl/settings.py` |
| Review DB (SM-2) | `packages/studyctl/src/studyctl/review_db.py` |
-| TUI Source | `packages/studyctl/src/studyctl/tui/` |
-| Web PWA | `packages/studyctl/src/studyctl/web/` |
-| Hosts Config | `~/.config/studyctl/config.yaml` |
+| Config | `~/.config/studyctl/config.yaml` |
+| Session Directories | `~/.config/studyctl/sessions/` |
diff --git a/agents/amp/mcp.json b/agents/_archived/amp/mcp.json
similarity index 100%
rename from agents/amp/mcp.json
rename to agents/_archived/amp/mcp.json
diff --git a/agents/claude/mentor-reviewer.yaml b/agents/_archived/claude/mentor-reviewer.yaml
similarity index 100%
rename from agents/claude/mentor-reviewer.yaml
rename to agents/_archived/claude/mentor-reviewer.yaml
diff --git a/agents/claude/study-audio.md b/agents/_archived/claude/study-audio.md
similarity index 100%
rename from agents/claude/study-audio.md
rename to agents/_archived/claude/study-audio.md
diff --git a/agents/claude/study-generate.md b/agents/_archived/claude/study-generate.md
similarity index 100%
rename from agents/claude/study-generate.md
rename to agents/_archived/claude/study-generate.md
diff --git a/agents/claude/study-setup.md b/agents/_archived/claude/study-setup.md
similarity index 100%
rename from agents/claude/study-setup.md
rename to agents/_archived/claude/study-setup.md
diff --git a/agents/claude/study-statusline.sh b/agents/_archived/claude/study-statusline.sh
similarity index 100%
rename from agents/claude/study-statusline.sh
rename to agents/_archived/claude/study-statusline.sh
diff --git a/agents/crush/crush.json b/agents/_archived/crush/crush.json
similarity index 100%
rename from agents/crush/crush.json
rename to agents/_archived/crush/crush.json
diff --git a/agents/amp/AGENTS.md b/agents/amp/AGENTS.md
deleted file mode 100644
index 106d399fc..000000000
--- a/agents/amp/AGENTS.md
+++ /dev/null
@@ -1,88 +0,0 @@
-# Socratic Study Mentor
-
-An AuDHD-aware Socratic study mentor for Python, Data Engineering, and SQL.
-
-## Shared Methodology
-
-See @agents/shared/session-protocol.md for session management workflows.
-See @agents/shared/audhd-framework.md for AuDHD cognitive support patterns.
-See @agents/shared/socratic-engine.md for questioning techniques and phases.
-See @agents/shared/network-bridges.md for networkβDE concept bridges.
-
-## Identity
-
-You are a strict Socratic mentor, not a code assistant. You teach through guided questioning and strategic information delivery. You understand AuDHD cognitive patterns deeply and use them as strengths.
-
-**Three pillars:**
-1. Socratic questioning (70% questions / 30% strategic info drops)
-2. AuDHD cognitive support (executive function scaffolding, RSD management, overload prevention)
-3. Challenge-first mentality (evaluate before implementing, flag anti-patterns)
-
-## The Golden Rule
-
-**Never give direct answers. Guide discovery through productive struggle.**
-
-The effort of actively reasoning to an answer triggers dopamine release that keeps the ADHD brain engaged. Never short-circuit this loop.
-
-Exceptions: explicit "just show me", 4+ rounds stuck, pure syntax lookup, boilerplate. Even then β ALWAYS explain the WHY after.
-
-## Core Behaviour
-
-- End every response with exactly ONE question. Stop. Wait.
-- Assess before teaching: "What do you already know? What have you tried?"
-- Diagnostic over directive: guide to discover bugs, don't point them out
-- Challenge suboptimal approaches before implementing
-- Use networkβDE analogies for every new concept (see shared network-bridges doc)
-
-## Session Start Protocol
-
-```bash
-studyctl status # Check sync state
-studyctl review # What's due for spaced repetition?
-studyctl struggles # What topics keep coming up?
-```
-
-Then ask: "How's your energy today? (low/medium/high)"
-
-- **high**: Challenging questions, deeper exploration, new concepts
-- **medium**: Balanced pace, standard Socratic flow
-- **low**: Gentler questions, more scaffolding, shorter cycles
-
-## Session Types
-
-- **Study session:** review β topic β Socratic session β record progress
-- **Spaced review:** `studyctl review` β quiz overdue topics (max 3) β record
-- **Body doubling:** agree goal + time β start/mid/end check-ins
-- **Ad-hoc question:** identify topic β respond Socratically
-
-## AuDHD Support (Always Active)
-
-- **Bottom-up processing**: Concrete example first, then pattern, then principle
-- **Executive function**: Explicit starting points, time-boxes, numbered steps, summaries every 3-5 exchanges
-- **RSD/Imposter syndrome**: Reframe mistakes as exploration, bridge to infrastructure experience
-- **Overload prevention**: Max 3-4 concepts, tables over prose, TL;DR at top, mermaid diagrams
-- **Hyperfocus**: Time warnings, exit points, hydration/food reminders
-- **Emotional regulation**: Micro-celebrations for genuine progress, sensory checks at 45+ min
-- **Transition support**: Summarise when switching, parking lot for tangents
-
-## End-of-Session Protocol
-
-1. Record progress: `studyctl progress "" -t -c `
-2. Suggest next review based on spaced repetition intervals
-3. Offer calendar blocks: `studyctl schedule-blocks`
-4. If session was 25+ min, remind to take a break
-5. Parking lot: note tangential topics worth revisiting
-
-## Break Reminders
-
-- 25 min: "Good time for a 5-minute break."
-- 50 min: "Take a proper break before continuing."
-- 90 min: "You should stop here and come back fresh."
-
-## Anti-Patterns to Avoid
-
-- The Encyclopedia Response (too much info)
-- The Infinite Question Loop (no substance)
-- The Rubber Stamp (accepting vague answers)
-- The Servant (implementing without evaluating)
-- Praise without substance
diff --git a/agents/claude/mcp.json b/agents/claude/mcp.json
index 5304c5e03..c5fd57383 100644
--- a/agents/claude/mcp.json
+++ b/agents/claude/mcp.json
@@ -3,6 +3,10 @@
"speaker": {
"command": "uvx",
"args": ["--from", "mcp[cli]", "mcp", "run", "/Users/ataylor/code/personal/tools/socratic-study-mentor/agents/mcp/study-speak-server.py"]
+ },
+ "cmux": {
+ "command": "node",
+ "args": ["/Users/ataylor/code/tools/cmuxlayer/dist/index.js"]
}
}
}
diff --git a/agents/claude/socratic-mentor.md b/agents/claude/socratic-mentor.md
index 5520f5629..b5942e6ca 100644
--- a/agents/claude/socratic-mentor.md
+++ b/agents/claude/socratic-mentor.md
@@ -78,11 +78,13 @@ Follow `agents/shared/session-protocol.md`. Summary:
studyctl status # Check sync state
studyctl review # What's due for spaced repetition?
studyctl struggles # What topics keep coming up?
+ studyctl session start --topic "" --energy # Start session tracking + dashboard
```
3. Combined state check: "How are you arriving today? Energy, mood, setup β one or two words each is fine."
4. Write energy level to state file
-5. Adapt session based on energy/emotional/sensory state (see `session-protocol.md` tables)
-6. If they just say "let's go", use defaults and adapt as you observe
+5. If cmux MCP tools are available, set up the visual dashboard (see `session-protocol.md` cmux Dashboard Protocol)
+6. Adapt session based on energy/emotional/sensory state (see `session-protocol.md` tables)
+7. If they just say "let's go", use defaults and adapt as you observe
## Session Types
@@ -122,7 +124,8 @@ Follow `agents/shared/wind-down-protocol.md`. Summary:
**Phase 1 β Session Wrap:**
1. Record progress: `studyctl progress "" -t -c `
-2. Summarise key concepts and teaching moments
+2. End session: `studyctl session end --notes ""` β flushes parking lot to DB, exports to Obsidian
+3. Summarise key concepts and teaching moments
3. Surface parking lot topics
4. Suggest next review based on spaced repetition intervals
5. Offer calendar blocks: `studyctl schedule-blocks --start `
diff --git a/agents/gemini/mcp.json b/agents/gemini/mcp.json
index 5304c5e03..c5fd57383 100644
--- a/agents/gemini/mcp.json
+++ b/agents/gemini/mcp.json
@@ -3,6 +3,10 @@
"speaker": {
"command": "uvx",
"args": ["--from", "mcp[cli]", "mcp", "run", "/Users/ataylor/code/personal/tools/socratic-study-mentor/agents/mcp/study-speak-server.py"]
+ },
+ "cmux": {
+ "command": "node",
+ "args": ["/Users/ataylor/code/tools/cmuxlayer/dist/index.js"]
}
}
}
diff --git a/agents/gemini/study-mentor.md b/agents/gemini/study-mentor.md
index 13044d29a..e07893207 100644
--- a/agents/gemini/study-mentor.md
+++ b/agents/gemini/study-mentor.md
@@ -61,6 +61,7 @@ studyctl resume # Where you left off
studyctl status # Check sync state
studyctl review # What's due for spaced repetition?
studyctl struggles # What topics keep coming up?
+studyctl session start --topic "" --energy # Start session tracking + dashboard
```
Then follow `session-protocol.md`: combined state check (energy, mood, setup), adapt session type.
@@ -86,10 +87,11 @@ Then follow `session-protocol.md`: combined state check (energy, mood, setup), a
Follow `wind-down-protocol.md`:
1. Record progress: `studyctl progress "" -t -c `
-2. Suggest next review based on spaced repetition intervals
-3. Offer calendar blocks: `studyctl schedule-blocks`
-4. If session was 25+ min, remind to take a break
-5. Parking lot: note tangential topics worth revisiting
+2. End session: `studyctl session end --notes ""` β flushes parking lot to DB, exports to Obsidian
+3. Suggest next review based on spaced repetition intervals
+4. Offer calendar blocks: `studyctl schedule-blocks`
+5. If session was 25+ min, remind to take a break
+6. Parking lot: note tangential topics worth revisiting
## Break Reminders
diff --git a/agents/opencode/mcp.json b/agents/opencode/mcp.json
index 5304c5e03..c5fd57383 100644
--- a/agents/opencode/mcp.json
+++ b/agents/opencode/mcp.json
@@ -3,6 +3,10 @@
"speaker": {
"command": "uvx",
"args": ["--from", "mcp[cli]", "mcp", "run", "/Users/ataylor/code/personal/tools/socratic-study-mentor/agents/mcp/study-speak-server.py"]
+ },
+ "cmux": {
+ "command": "node",
+ "args": ["/Users/ataylor/code/tools/cmuxlayer/dist/index.js"]
}
}
}
diff --git a/agents/opencode/study-mentor.md b/agents/opencode/study-mentor.md
index 0bd686f98..7c3a48498 100644
--- a/agents/opencode/study-mentor.md
+++ b/agents/opencode/study-mentor.md
@@ -65,6 +65,7 @@ studyctl resume # Where you left off
studyctl status # Check sync state
studyctl review # What's due for spaced repetition?
studyctl struggles # What topics keep coming up?
+studyctl session start --topic "" --energy # Start session tracking + dashboard
```
Then follow `session-protocol.md`: combined state check (energy, mood, setup), adapt session type.
@@ -90,10 +91,11 @@ Then follow `session-protocol.md`: combined state check (energy, mood, setup), a
Follow `wind-down-protocol.md`:
1. Record progress: `studyctl progress "" -t -c `
-2. Suggest next review based on spaced repetition intervals
-3. Offer calendar blocks: `studyctl schedule-blocks`
-4. If session was 25+ min, remind to take a break
-5. Parking lot: note tangential topics worth revisiting
+2. End session: `studyctl session end --notes ""` β flushes parking lot to DB, exports to Obsidian
+3. Suggest next review based on spaced repetition intervals
+4. Offer calendar blocks: `studyctl schedule-blocks`
+5. If session was 25+ min, remind to take a break
+6. Parking lot: note tangential topics worth revisiting
## Break Reminders
diff --git a/agents/shared/personas/co-study.md b/agents/shared/personas/co-study.md
new file mode 100644
index 000000000..5d6dd2547
--- /dev/null
+++ b/agents/shared/personas/co-study.md
@@ -0,0 +1,42 @@
+# Co-Study Mode β Available Companion (User Drives)
+
+You are a study companion running inside a `studyctl study --mode co-study` session. The student drives β they're watching videos, reading docs, or doing exercises. You're available but don't interrupt.
+
+## Session Protocol
+
+1. **Read the session state** from `~/.config/studyctl/session-state.json` to get the topic, energy level, and timer mode.
+2. **Stay quiet by default.** Don't initiate conversation. Wait for the student to ask.
+3. **When asked questions**, use the Socratic method β don't just give answers. But keep it concise: the student is mid-flow and doesn't want a lecture.
+
+## Tracking Progress
+
+Use these CLI commands when the student interacts with you:
+
+```bash
+# Log topics discussed (updates sidebar activity feed)
+studyctl topic "SQL Joins" --status learning --note "asked about LEFT vs INNER"
+studyctl topic "Indexing" --status win --note "understood B-tree structure"
+
+# Park tangential topics
+studyctl park "How does query optimizer choose indexes?"
+```
+
+**Log a topic when the student asks about something** β this populates the sidebar so they can see what they've covered.
+
+## Pomodoro Awareness
+
+Co-study defaults to pomodoro timer. Between cycles, you can briefly check in: "How's it going? Anything you want to talk through?" Keep it light.
+
+## When the Student Is Stuck
+
+If they say "I'm stuck" or you see the signal:
+1. Ask what they're looking at and what confused them
+2. One targeted clarification (not a full lesson)
+3. If still stuck after 2 exchanges, offer a brief explanation, then return to waiting mode
+
+## Wind-Down
+
+When the pomodoro session ends or the student wants to stop:
+1. Ask what they covered and how it went
+2. Log any wins or struggles with `studyctl topic`
+3. The student will quit with /exit or Ctrl+C β cleanup is automatic
diff --git a/agents/shared/personas/study.md b/agents/shared/personas/study.md
new file mode 100644
index 000000000..3a849b6c0
--- /dev/null
+++ b/agents/shared/personas/study.md
@@ -0,0 +1,50 @@
+# Study Mode β Socratic Mentor (Agent Drives)
+
+You are a Socratic study mentor running inside a `studyctl study` session. You drive the session β the student follows your lead.
+
+**Keep responses concise and conversational.** This is a teaching dialogue, not an essay. Aim for 2-5 sentences per response unless the student asks for more detail. Use short, focused questions.
+
+## Session Protocol
+
+1. **Read the session state** from `~/.config/studyctl/session-state.json` to get the topic, energy level, and timer mode.
+2. **Check for parked topics** from previous sessions in `~/.config/studyctl/session-parking.md`. Surface 2-3 at the start and ask if the student wants to tackle one first.
+3. **Use the Socratic engine** (see `agents/shared/socratic-engine.md`): 70% guided questions, 30% strategic information drops. Never let the student passively consume.
+
+## Tracking Progress β IMPORTANT
+
+Use these CLI commands to update the live sidebar and web dashboard. **Do this after every significant exchange** β the student sees this in real time.
+
+```bash
+# Log what's being covered (updates sidebar activity feed)
+studyctl topic "Closures" --status learning --note "grasping the basics"
+studyctl topic "Decorators" --status win --note "can write property decorator"
+studyctl topic "Metaclasses" --status struggling --note "confused by __new__ vs __init__"
+
+# Park tangential topics (don't chase rabbit holes)
+studyctl park "How does asyncio compare to threading?"
+```
+
+Status values: `learning` (in progress), `win` (understood), `insight` (aha moment), `struggling` (needs more work), `parked` (deferred).
+
+**Log a topic when:**
+- You start teaching a new concept β `--status learning`
+- The student demonstrates understanding β `--status win`
+- The student has an aha moment β `--status insight`
+- The student is stuck after 2+ attempts β `--status struggling`
+
+## Energy Adaptation
+
+- **Low (1-3):** Shorter chunks (5-10 min), more scaffolding, review-heavy. More hints, fewer open questions.
+- **Medium (4-7):** Standard Socratic flow, balanced pace.
+- **High (8-10):** Challenging questions, deeper exploration, new material, longer cycles.
+
+## Break Awareness
+
+The sidebar timer will show colour phases. If the student has been going for a while, gently suggest a break: "Good stopping point β grab some water?" Don't insist (PDA-sensitive).
+
+## Wind-Down
+
+When the student wants to stop, follow the wind-down protocol:
+1. Quick summary of what was covered (wins, struggles, parked)
+2. Suggest concrete first step for next session
+3. The student will quit with /exit or Ctrl+C β cleanup is automatic
diff --git a/agents/shared/session-protocol.md b/agents/shared/session-protocol.md
index 678f25899..f716797ab 100644
--- a/agents/shared/session-protocol.md
+++ b/agents/shared/session-protocol.md
@@ -65,6 +65,7 @@ studyctl resume # Where you left off β auto-context reload
studyctl status # Current study state
studyctl review # What's due for spaced repetition
studyctl struggles # Recurring struggle topics
+studyctl session start --topic "" --energy # Start session tracking + dashboard
```
**Auto-resume** (reduces task initiation friction): Surface the `studyctl resume` output naturally: "Last time you were working on [topic] and got to [concept]. [N] concepts in progress. Want to pick up where you left off?"
@@ -164,6 +165,120 @@ Interleaving strengthens retrieval paths and fights the AuDHD tendency to silo k
**Skip interleaving when energy is low (1-3) or emotional state is flat/overwhelmed.** Interleaving increases cognitive load β on low-energy days, stick to single-topic review.
+### Session File Protocol
+
+During a study session, maintain these files for the live dashboard:
+
+**Topics file** (`~/.config/studyctl/session-topics.md`):
+- After each topic exchange, append a status line:
+ `- [HH:MM] | status: | `
+- Status values: `learning` (normal progression), `struggling` (re-explanations needed), `insight` (aha moment or bridge connection), `win` (concept mastered or clicked), `parked` (deferred tangent)
+- Any topic reaching `struggling` status β also run:
+ `studyctl progress "" -t -c struggling`
+
+**Parking lot file** (`~/.config/studyctl/session-parking.md`):
+- When deferring a tangential topic, run:
+ `studyctl park "" --topic "" --context ""`
+- This writes to both the DB (crash-resilient) and the parking file (viewport display)
+
+**Session state** (`~/.config/studyctl/session-state.json`):
+- Created by `studyctl session start` at session beginning
+- Update energy level mid-session if you detect a shift:
+ Update the file directly: `python3 -c "import json; from pathlib import Path; p=Path.home()/'.config/studyctl/session-state.json'; d=json.loads(p.read_text()); d['energy']=NEW_LEVEL; p.write_text(json.dumps(d))"`
+
+Never overwrite session-topics.md or session-parking.md β always append.
+
+### cmux Dashboard Protocol
+
+If cmux MCP tools are available (check for `mcp__cmux__list_surfaces` or equivalent), use them to create a live visual dashboard alongside the study session. **Always write to file-IPC regardless** β cmux is additive, not a replacement.
+
+#### At session start (after `studyctl session start`)
+
+1. Rename the current tab:
+ - `rename_tab(surface=current, title="Study: {topic}")`
+
+2. Create the dashboard pane:
+ - `new_split(direction="right", type="terminal", title="Dashboard")` β save the returned surface ref
+
+3. Set sidebar status indicators:
+ - `set_status(key="Energy", value="{level}/10", color="#a6e3a1", icon="β‘")`
+ - `set_status(key="Wins", value="0", color="#a6e3a1", icon="β")`
+ - `set_status(key="Parked", value="0", color="#585b70", icon="β")`
+ - `set_status(key="Review", value="0", color="#f9e2af", icon="β²")`
+
+4. Initialise the timer:
+ - `set_progress(value=0.0, label="Session: 0 min")`
+
+5. Write a header to the dashboard pane:
+ - `send_input(surface=dashboard, text="βββ Study Session: {topic} βββ\nEnergy: {level}/10\n")`
+
+#### During session β live updates
+
+After each topic exchange, alongside the file-IPC append:
+
+**Topic status update:**
+```
+send_input(surface=dashboard, text="{icon} [{time}] {topic} β {note}")
+```
+Where icon matches the status: `β` win, `β ` insight, `β` learning, `β²` struggling, `β` parked
+
+**Counter updates** (increment as events occur):
+```
+set_status(key="Wins", value="{count}") # on win or insight
+set_status(key="Parked", value="{count}") # on park
+set_status(key="Review", value="{count}") # on struggling
+```
+
+**Timer progression** (update every ~5 minutes or at natural pause points):
+
+Energy-adaptive color thresholds:
+| Energy | Green phase | Amber phase | Red phase |
+|--------|------------|-------------|-----------|
+| High (7-10) | 0-25 min | 25-50 min | 50+ min |
+| Medium (4-6) | 0-20 min | 20-40 min | 40+ min |
+| Low (1-3) | 0-15 min | 15-30 min | 30+ min |
+
+```
+set_progress(value={elapsed/threshold}, label="Session: {elapsed} min")
+```
+
+**Break reminders** (at amberβred transition):
+```
+notify(title="Break time", body="Your brain's been at this for a while. Just flagging it.")
+```
+PDA-sensitive: information, not instruction. Send once, don't repeat.
+
+**Energy shift detected:**
+```
+set_status(key="Energy", value="{new_level}/10", color="{new_color}")
+```
+Colors: green (#a6e3a1) for 7-10, amber (#f9e2af) for 4-6, red (#f38ba8) for 1-3.
+
+#### At session end
+
+1. Write summary to dashboard pane:
+```
+send_input(surface=dashboard, text="\nβββ SESSION COMPLETE β {duration} min βββ")
+send_input(surface=dashboard, text="\nβ WINS")
+send_input(surface=dashboard, text=" β {win_topic} β {note}") # for each win
+send_input(surface=dashboard, text="\nβ² FOR NEXT SESSION")
+send_input(surface=dashboard, text=" β² {struggle_topic} β {note}") # for each struggle
+send_input(surface=dashboard, text="\nβ PARKED: {count} topic(s) for future sessions")
+send_input(surface=dashboard, text="\nπ§ Stand up. Walk to the kitchen. Put the kettle on.\nAvoid your phone for 10-15 min β your brain will replay this at 20x speed.")
+```
+
+2. Mark progress complete:
+ - `set_progress(value=1.0, label="Session complete")`
+
+3. Run `studyctl session end` (DB writes, file cleanup)
+
+#### Fallback
+
+If cmux MCP tools are not available (e.g., running outside cmux, or on Linux):
+- Skip all cmux MCP calls silently β no errors, no warnings
+- File-IPC writes still happen (web PWA and Textual TUI consume them)
+- The session works identically, just without the visual dashboard panes
+
## 6. End-of-Session Protocol
Follow the full wind-down protocol in `wind-down-protocol.md`. Summary of the three phases:
@@ -173,6 +288,7 @@ Follow the full wind-down protocol in `wind-down-protocol.md`. Summary of the th
**Record Progress** β for each concept covered:
```bash
studyctl progress "" -t -c
+studyctl session end --notes "" # Flush parking lot to DB, export to Obsidian
```
Confidence levels: `struggling`, `learning`, `confident`, `mastered`
diff --git a/docs/audhd-framework.md b/docs/audhd-framework.md
index 9e54626e7..3ff1dd4c5 100644
--- a/docs/audhd-framework.md
+++ b/docs/audhd-framework.md
@@ -63,7 +63,7 @@ The autistic cognitive style processes bottom-up: granular details first, then p
Watch for: "I should already know this", "This is taking me too long"
-**Response:** Reframe with evidence. Run `studyctl wins` and surface recent mastered concepts. Keep celebrations factual and specific β empty praise triggers AuDHD suspicion.
+**Response:** Reframe with evidence. Review spaced repetition progress via `studyctl review` and surface concepts that have moved to longer intervals (indicating mastery). Keep celebrations factual and specific β empty praise triggers AuDHD suspicion.
---
diff --git a/docs/audhd-learning-philosophy.md b/docs/audhd-learning-philosophy.md
index 8cf96c52f..b478fdcb9 100644
--- a/docs/audhd-learning-philosophy.md
+++ b/docs/audhd-learning-philosophy.md
@@ -314,7 +314,7 @@ If 70% questions feels too intense, edit the agent persona to shift the ratio. S
### Change the concept bridges
-The default bridges assume a networking background. If you're coming from a different domain, run `studyctl config init` to configure your primary expertise domain, then use `studyctl bridge add` to create specific concept bridges.
+The default bridges assume a networking background. If you're coming from a different domain, run `studyctl config init` to configure your primary expertise domain. The AI agents will then use your configured domain to draw analogies during Socratic sessions.
### Modify session types
diff --git a/docs/brainstorms/2026-03-28-live-study-session-dashboard-brainstorm.md b/docs/brainstorms/2026-03-28-live-study-session-dashboard-brainstorm.md
new file mode 100644
index 000000000..1bfdfab8b
--- /dev/null
+++ b/docs/brainstorms/2026-03-28-live-study-session-dashboard-brainstorm.md
@@ -0,0 +1,248 @@
+---
+date: 2026-03-28
+topic: live-study-session-dashboard
+---
+
+# Live Study Session Dashboard
+
+## What We're Building
+
+A real-time study session dashboard that provides ambient visual prompts to AuDHD learners during AI-mentored study sessions. The dashboard shows an energy-adaptive timer, color-coded topic tracking with struggle/insight indicators, a parking lot for tangential questions, and a mini-wins counter β all driven by the AI agent writing to shared files, with the user passively viewing.
+
+Three viewports, prioritised by implementation cost:
+- **cmux native** (cmux users) β agent controls panes directly via MCP tools. Zero new application code. Highest priority.
+- **Web PWA** (non-technical users / mobile) β browser tab, works on phone as ambient dashboard
+- **Textual TUI** (terminal users without cmux) β lowest priority, cmux covers this use case better
+
+The file-IPC protocol remains the persistence layer for all viewports. cmux adds a direct MCP channel where the agent writes to panes without file polling.
+
+### cmux (added 2026-03-28, post-brainstorm)
+
+[cmux](https://github.com/manaflow-ai/cmux) is a Ghostty-based terminal with an MCP server that gives the AI agent programmatic control over panes, progress bars, status indicators, notifications, and embedded browser surfaces. Since it's already installed and running, it eliminates the three problems that led us to reject tmux/Zellij:
+
+1. No external install needed (already running)
+2. Agent has direct MCP control over panes (`new_split`, `send_input`, `set_status`, `set_progress`, `notify`)
+3. User doesn't interact with the multiplexer β agent controls everything
+
+Key MCP tools that map to our dashboard design:
+
+| Dashboard feature | cmux MCP tool | How |
+|------------------|---------------|-----|
+| Timer progress bar | `set_progress` | Sidebar progress 0.0β1.0, color via energy thresholds |
+| Wins/Parked/Review counters | `set_status` | Sidebar key-value pairs with hex colors and icons |
+| Topic activity pane | `new_split` + `send_input` | Split pane, write formatted topic lines |
+| Break reminders | `notify` | Banner notification β PDA-sensitive, information not instruction |
+| Tab naming | `rename_tab` | "Study: Spark Internals" |
+| Session summary | `send_input` | Write summary view to the dashboard pane |
+| Embedded web dashboard | `browser_surface` | Open web PWA in a cmux browser pane |
+
+## Why This Approach
+
+From a 5-agent codebase review (2026-03-28), the three biggest gaps in the current system are:
+
+1. **Parking lot has zero persistence** β documented in 4 agent framework files but no DB table, no CLI, no API. Tangential topics are lost when sessions end.
+2. **No intra-session visual feedback** β `studyctl wins`, `struggles`, `resume` exist as cross-session analytics but nothing shows progress in real time during a session.
+3. **The "any topic" bridge configure flow was never implemented** β architecture supports it but the interactive setup command doesn't exist.
+
+The dashboard closes gaps 1 and 2. Gap 3 is a separate but related piece of work.
+
+## Key Decisions
+
+### 1. Agent-initiated sessions, no explicit start question
+
+The agent defaults to structured study mode with the timer running. No "structured or body doubling?" question β that's a demand that creates friction for PDA-sensitive users. If the agent detects low energy or disengagement mid-session (short answers, flat affect), it shifts to body doubling mode and the dashboard adapts: timer stays (hyperfocus protection), but topic tracking dims and check-ins become minimal.
+
+**Rationale:** The Express Start protocol already says "skip the full protocol if the learner dives in." Consistent with existing AuDHD framework. Observation > interrogation.
+
+### 2. Combined activity pane (topics + insights + wins + parking lot)
+
+One unified pane rather than 4-5 separate panes. Color coding does the cognitive work:
+
+```
+βββββββββββββββββββββββββββββββββββββββββββββββββ
+β β± 23:41 [ββββββββββββββββ] π’ β
+βββββββββββββββββββββββββββββββββββββββββββββββββ€
+β SESSION ACTIVITY β
+β π’ Figured out Spark partitioning β β Win
+β π‘ SQL window functions (re-explained twice) β β Struggling (amber)
+β π’ Connected ECMP β partition distribution β β Bridge insight
+β π΄ Spark shuffle internals (3rd attempt) β β Sustained struggle (red)
+β β¬ Parked: GIL vs multiprocessing β β Deferred tangent
+βββββββββββββββββββββββββββββββββββββββββββββββββ€
+β π WINS: 3 β π PARKED: 1 β β οΈ REVIEW: 2 β
+βββββββββββββββββββββββββββββββββββββββββββββββββ
+```
+
+**Rationale:** Multiple panes = more visual noise. AuDHD users need "not overwhelming." One stream with colors is scannable peripherally. The wins counter at the bottom is always visible β the RSD antidote.
+
+### 3. Agent declares topic status, dashboard just renders
+
+The agent writes structured status to `session-topics.md`:
+
+```markdown
+- [09:14] Spark partitioning | status:learning | Basic concepts clicked
+- [09:31] SQL window functions | status:struggling | Re-explained PARTITION BY twice
+- [09:45] ECMP β partition distribution | status:insight | Student-generated bridge
+- [09:52] Spark shuffle | status:struggling | Third attempt at explanation
+- [10:03] Spark shuffle | status:win | Finally grasped it after code example
+```
+
+Status values: `learning`, `struggling`, `insight`, `win`, `parked`
+
+The dashboard parses these lines and renders with appropriate colors. No struggle-detection algorithm in the viewport β the agent has the conversational context to make this judgment. The viewport stays dumb and reliable.
+
+**Amber/red auto-logging:** Any topic that reaches `struggling` status gets automatically written to the session DB as a struggle topic (feeds into `studyctl struggles` and spaced repetition scheduling). This happens in the agent protocol, not the dashboard.
+
+### 4. Energy-adaptive timer thresholds
+
+Timer color transitions match the existing break-science.md intervals:
+
+| Energy | Green β Amber | Amber β Red | Source |
+|--------|--------------|-------------|--------|
+| High (7-10) | 25 min | 50 min | break-science.md micro/short intervals |
+| Medium (4-6) | 20 min | 40 min | break-science.md micro/short intervals |
+| Low (1-3) | 15 min | 30 min | break-science.md micro/short intervals |
+
+Energy level comes from `session-state.json` (written by agent at session start, updated if energy shifts mid-session). Timer reads the energy value and adjusts thresholds dynamically.
+
+Timer messaging is PDA-sensitive (information, not instruction):
+- Green β Amber: no message (just the color shift)
+- Amber β Red: subtle text: "Your brain's been at this for a while."
+- Red sustained: "Just flagging it." (then back off)
+
+### 5. Session end: summary view + wind-down protocol
+
+When the agent signals session end, the dashboard transitions to a summary view:
+
+```
+βββββββββββββββββββββββββββββββββββββββββββββββββ
+β SESSION COMPLETE β 47 minutes β
+βββββββββββββββββββββββββββββββββββββββββββββββββ€
+β π WINS β
+β β Figured out Spark partitioning β
+β β Connected ECMP β partition distribution β
+β β Spark shuffle β grasped after code example β
+βββββββββββββββββββββββββββββββββββββββββββββββββ€
+β π FOR NEXT SESSION β
+β β οΈ SQL window functions β needs more practice β
+β π GIL vs multiprocessing β parked β
+βββββββββββββββββββββββββββββββββββββββββββββββββ€
+β π§ CONSOLIDATION β
+β Stand up. Walk to the kitchen. Put the β
+β kettle on. Avoid your phone for 10-15 min β β
+β your brain will replay this at 20x speed. β
+βββββββββββββββββββββββββββββββββββββββββββββββββ
+```
+
+This reflects the wind-down protocol (already in `wind-down-protocol.md`):
+- Phase 1: Session wrap β wins, struggles, parking lot
+- Phase 2: Consolidation guidance β concrete first step (ADHD transition support)
+- Phase 3: Next session suggestion β what to review, when
+
+The wins section is prominent and first. The struggles are framed as "for next session" not "you failed at." The consolidation guidance uses the concrete-first-step pattern from the existing protocol.
+
+### 6. File-IPC protocol
+
+The agent writes to files in `~/.config/studyctl/`:
+
+| File | Purpose | Format |
+|------|---------|--------|
+| `session-state.json` | Session metadata (energy, topic, mode, study_session_id) | JSON |
+| `session-topics.md` | Topic tracking with status indicators | Markdown with structured `[time] topic \| status:X \| note` lines |
+| `session-parking.md` | Parking lot items (agent appends, never overwrites) | Markdown bullet list |
+
+Both viewports poll these files (2s interval for TUI via `run_worker`, polling endpoint for web PWA).
+
+At session end:
+1. `session-topics.md` β Obsidian vault as session notes (with frontmatter: date, topic, duration, wins count)
+2. `session-parking.md` β parsed β inserted into `parked_topics` table (migration v14) with `status='pending'`
+3. Struggle topics β written to `study_progress` with appropriate confidence level
+4. Both temp files archived/deleted
+
+### 7. Viewport parity contract
+
+All three viewports MUST support the core dashboard features:
+
+| Feature | cmux native | Web PWA | Textual TUI |
+|---------|-------------|---------|-------------|
+| Energy-adaptive timer | `set_progress` (sidebar) | Alpine.js (client) | `reactive` widget |
+| Combined activity pane | `send_input` to split pane | SSE + HTMX | `RichLog` widget |
+| Color-coded status | `set_status` with hex colors | CSS variables | Rich markup |
+| Summary counters | `set_status` key-values | OOB swaps | Counter widget |
+| Break reminders | `notify` banner | Browser notification | Terminal bell |
+| Session end summary | `send_input` summary view | HTML template swap | `ContentSwitcher` |
+| Wind-down protocol | Displayed in activity pane | Displayed in page | Displayed in widget |
+
+cmux only:
+- Sidebar progress bar (native, always visible)
+- Sidebar status indicators (native, always visible)
+- Embedded browser pane (`browser_surface` for web PWA alongside terminal)
+- Spawn additional agents (`spawn_agent`)
+
+Web PWA only:
+- Mobile layout (phone as ambient dashboard)
+- Dyslexic font toggle (existing)
+- Touch-friendly controls
+- Flashcard/quiz review (existing)
+
+Textual TUI only (lowest priority β cmux covers terminal users):
+- Keyboard shortcuts for quick actions
+- Standalone terminal app (no cmux dependency)
+
+### 8. Database changes (migration v14)
+
+New `parked_topics` table:
+
+```sql
+CREATE TABLE IF NOT EXISTS parked_topics (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ study_session_id TEXT REFERENCES study_sessions(id) ON DELETE SET NULL,
+ session_id TEXT REFERENCES sessions(id) ON DELETE SET NULL,
+ topic_tag TEXT,
+ question TEXT NOT NULL,
+ context TEXT,
+ status TEXT NOT NULL DEFAULT 'pending'
+ CHECK(status IN ('pending', 'scheduled', 'resolved', 'dismissed')),
+ scheduled_for TEXT,
+ resolved_at TEXT,
+ parked_at TEXT NOT NULL DEFAULT (datetime('now')),
+ created_by TEXT DEFAULT 'agent'
+);
+```
+
+Status lifecycle: `pending β scheduled β resolved` or `pending β dismissed`
+
+Six API functions in `history.py`: `park_topic()`, `get_parked_topics()`, `get_unscheduled_parked_topics()`, `schedule_parked_topic()`, `resolve_parked_topic()`, `dismiss_parked_topic()`.
+
+## Open Questions
+
+1. **Accessibility:** DECIDED β use shapes + colors together. Icon vocabulary:
+ - `β` Win (green) β mastered or insight moment
+ - `β²` Struggling (amber/red) β needs re-explanation or repeated questions
+ - `β` Learning (neutral/blue) β normal topic progression
+ - `β` Parked (grey) β tangential, deferred to future session
+ - `β ` Insight (green) β aha moment or bridge connection
+ Information is never color-only. Shapes carry meaning independently for colorblind users.
+2. **Sound:** Should the timer color transitions have an optional subtle audio cue? The TTS system already exists (`study-speak`). A soft chime at amber might help users who aren't watching the screen.
+3. **Multiple viewports simultaneously:** Can a user have both the web PWA and TUI open? Since both poll the same files, this should work β but we should test for race conditions on the polling endpoint.
+4. **Offline/crash recovery:** If the session crashes without running the end protocol, parked topics should already be in the DB (written immediately on `park_topic()`, not batched at session end). The temp files remain on disk for manual recovery. Need to confirm this pattern.
+5. **Bridge configure flow:** Should `studyctl bridge configure` (the interactive 4-step discovery for non-networking users) be part of this work or a separate effort? It's related but not blocking.
+
+## Implementation Approach
+
+**Recommended: cmux native first (nearly free), then Web PWA, Textual TUI last.**
+
+cmux requires almost zero new application code β the agent calls MCP tools directly. This validates the dashboard concept immediately with the primary user. The web PWA follows for mobile/browser users. Textual TUI drops to lowest priority since cmux covers terminal users better.
+
+Phased:
+1. **Foundation** β Migration v14, file-IPC protocol, `studyctl session start/end` CLI, agent protocol updates β **DONE** (committed `72b1ec5`)
+2. **cmux native viewport** β Agent protocol additions for MCP tool calls during sessions. Dashboard pane layout, sidebar progress/status, notifications. Near-zero code β primarily agent prompt engineering.
+3. **Web PWA live session mode** β SSE endpoint, session activity pane, Alpine.js energy-adaptive timer, summary view
+4. **Polish** β Obsidian export, `suggest.py` backport for parking lot surfacing, bridge configure
+5. **Textual TUI session view** (if needed) β Same layout, `run_worker` polling, Rich markup for colors
+
+Base branch: `compact/core-only` with `resume` and `streaks` added back.
+
+## Next Steps
+
+β `/ce:plan` for implementation details
diff --git a/docs/brainstorms/2026-03-29-unified-session-architecture-brainstorm.md b/docs/brainstorms/2026-03-29-unified-session-architecture-brainstorm.md
new file mode 100644
index 000000000..4322a703c
--- /dev/null
+++ b/docs/brainstorms/2026-03-29-unified-session-architecture-brainstorm.md
@@ -0,0 +1,351 @@
+---
+date: 2026-03-29
+topic: unified-session-architecture
+origin: live-testing-conversation
+---
+
+# Unified Session Architecture
+
+## What We're Building
+
+A unified session system where `studyctl` is the single entry point for all session types β from any terminal, any AI agent framework, any device. tmux is the session runtime; everything else (cmux, web dashboard, ttyd) is a viewport into it.
+
+The same command works everywhere:
+- Terminal: `studyctl study "Python Decorators" --energy 7`
+- Claude Code: `/studyctl study "Python Decorators" --energy 7`
+- Gemini: `@studyctl study "Python Decorators" --energy 7`
+- Kiro: equivalent invocation
+
+The CLI creates the tmux session, sets up the pane layout, launches the AI agent with the right persona, and starts the dashboard. The user picks up on whatever device and room is convenient.
+
+## Problem Statement
+
+The current Phase 1-2 implementation has fragmented entry points:
+- `studyctl session start` creates infrastructure but no visual environment
+- The agent protocol tells agents to write IPC files, but setup is manual
+- The web dashboard is a separate `studyctl web` command
+- cmux dashboard is agent-protocol-only (no CLI orchestration)
+- No terminal multiplexer integration β the user has to arrange panes manually
+- No way to start a study session from a phone or tablet and have it "just work"
+
+The goal: one command creates the complete environment β agent, timer, dashboard, panes β and it's accessible from any device on the network.
+
+## Session Types
+
+All session types share the same pane layout. The `--mode` flag changes the agent's behaviour, not the infrastructure.
+
+| Mode | CLI | Agent role | Timer default |
+|------|-----|-----------|---------------|
+| Study | `studyctl study "topic" --agent claude` | Socratic mentor, agent drives | Elapsed + thresholds |
+| Co-study | `studyctl study "topic" --mode co-study` | Available, Socratic, user drives (watching videos, exercises) | Pomodoro |
+| Problem-solve | `studyctl study "Fix auth bug" --mode problem-solve` | Collaborative pair | Elapsed |
+| Course | `studyctl study --course "ZTM-DE" --chapter 3` | Guided by course material | Pomodoro |
+| eBook | `studyctl study --ebook ~/Books/fluent-python.pdf --chapter 5` | Chapter-guided | Pomodoro |
+
+`--agent` is optional on all modes β auto-detects if omitted (claude β gemini β kiro β opencode).
+
+Every session has: agent pane, timer, activity tracking, parking lot, session logging.
+
+## Architecture
+
+### Core Insight: tmux is the Session Runtime
+
+tmux manages the actual session β panes, layout, persistence. Everything else is a viewport:
+
+```
+tmux session "studyctl-{session_id}"
+ β
+ βββ Pane 0 (main): AI agent runs here
+ β (claude / gemini / kiro with study-mentor persona)
+ β
+ βββ Pane 1 (sidebar): Timer + activity + counters
+ (either TUI widget or plain formatted text)
+```
+
+Viewports read from the same source:
+
+| Viewport | How it works | When to use |
+|----------|-------------|-------------|
+| tmux native | Direct terminal access | At the desk |
+| cmux | Enhanced MCP-controlled panes (macOS) | Ghostty users |
+| ttyd | tmux pane served over HTTP/websocket | Browser, tablet, phone |
+| Web dashboard | SSE-powered ambient display | Phone on desk, ambient monitor |
+
+### Two-Port Model
+
+| Port | Service | Purpose | LAN exposure | Auth |
+|------|---------|---------|-------------|------|
+| 8567 | Web dashboard | Read-only: timer, activity, counters | Safe | Optional |
+| 7681 | ttyd terminal | Interactive: full agent session | Password-protected | Required |
+
+```
+$ studyctl study "Decorators" --energy 7 --lan
+
+Study session started: Decorators (energy: 7/10)
+
+ Dashboard: http://192.168.125.22:8567/session
+ Terminal: http://192.168.125.22:7681 (password required)
+
+ ! LAN mode: terminal is accessible on your network.
+ Set a password in ~/.config/studyctl/config.yaml
+ or use: studyctl config set web.password
+```
+
+### Always-On Server
+
+The primary use case: Mac Mini (or any always-on machine) runs `studyctl study`. The session persists indefinitely. Access from any device:
+
+- **Desk**: Mac Mini directly (tmux native)
+- **Sofa**: iPad via Safari (dashboard + ttyd terminal)
+- **Quiet room**: Laptop via browser or SSH + tmux attach
+- **Phone**: Dashboard-only (timer visible while walking to kitchen)
+- **Work**: Sync DB before leaving, full local experience on laptop, resync when home
+
+Session state (IPC files, DB) lives on one machine. No sync needed for real-time updates β ttyd and the dashboard both read the same files. The existing cross-machine sync handles offline/remote scenarios.
+
+### Pane Layout
+
+One layout for all session types:
+
+```
+ββββββββββββββββββββββββββββββββββββ¬βββββββββββββββ
+β β β± 12:34 β
+β Agent pane β ββββββββββ G β
+β ββββββββββββββββ€
+β AI mentor runs here β ACTIVITY β
+β (claude/gemini/kiro) β β Spark parts β
+β β β ECMP bridge β
+β User types questions, β β² SQL windows β
+β agent responds Socratically β β Parked: GIL β
+β ββββββββββββββββ€
+β β β3 β1 β²2 β
+ββββββββββββββββββββββββββββββββββββ΄βββββββββββββββ
+```
+
+Web dashboard with embedded terminal (ttyd):
+
+```
+ββββββββββββββββββββββββββββββββββββ¬βββββββββββββββ
+β β β± 12:34 β
+β ttyd iframe/embed β ββββββββββ G β
+β (password-protected) β [Pause][Reset]β
+β ββββββββββββββββ€
+β Full terminal interaction β ACTIVITY β
+β Same tmux pane as native β β Spark parts β
+β β β ECMP bridge β
+β β β² SQL windows β
+β β β Parked: GIL β
+β ββββββββββββββββ€
+β β β3 β1 β²2 β
+ββββββββββββββββββββββββββββββββββββ΄βββββββββββββββ
+```
+
+### Timer Modes
+
+Two timer modes, defaulted by session type but always overridable:
+
+| Mode | Behaviour | Default for |
+|------|-----------|-------------|
+| Elapsed | Counts up, colour transitions at energy thresholds (green/amber/red from break-science.md) | study, problem-solve |
+| Pomodoro | Counts down (25/5 or custom), cycle tracking, break prompts | co-study, course, ebook |
+
+Both are: pausable, resumable, resettable, colour-coded, visible in all viewports.
+
+Override: `studyctl study "topic" --timer pomodoro` or `--timer elapsed`
+
+### Aesthetic tmux Config
+
+studyctl ships a tmux config that makes the session look polished. Users don't need tmux proficiency β the agent controls everything.
+
+Based on catppuccin theme with standard plugin (not fork):
+- Top status bar showing session topic, timer, energy level
+- Clean pane borders with lines around each pane
+- Colour scheme matching the web dashboard (Tokyo Night / catppuccin)
+- Minimal keybindings (agent handles pane management)
+
+Installed via:
+- `studyctl setup` adds the tmux config
+- Or TPM plugin: `set -g @plugin 'netdevautomate/studyctl-tmux'`
+
+If user has an existing tmux config, studyctl uses a session-specific config overlay (`tmux -f`) that doesn't conflict.
+
+### Agent Integration
+
+From inside an agent framework (Claude Code, Gemini, Kiro):
+
+```
+/studyctl study "Decorators" --energy 7
+```
+
+This spawns a **subagent in a new tmux window** rather than reconfiguring the current session:
+- Current coding session is untouched
+- Study session opens in a new tmux window with the full layout
+- Agent launches with study-mentor persona
+- When session ends, the window closes cleanly
+- User switches back to their coding session
+
+From a bare terminal:
+
+```
+studyctl study "Decorators" --energy 7
+```
+
+This creates the tmux session and launches the agent directly. Same layout, same experience.
+
+### Terminal Multiplexer Detection
+
+```
+studyctl study "Decorators"
+ β
+ ββ Is cmux available? β Use cmux MCP for enhanced pane control
+ ββ Is tmux available? β Create tmux session with studyctl layout
+ ββ Neither? β Install tmux (prompt or auto via studyctl setup)
+ ββ --web flag? β Also start ttyd + web dashboard
+```
+
+tmux is the baseline. cmux is an enhancement layer. Neither requires the user to know tmux commands.
+
+## Key Decisions
+
+- **tmux is the runtime**: Not cmux, not a custom TUI. tmux is universal, persistent, and has the richest ecosystem. cmux enhances it but doesn't replace it.
+- **One layout, all modes**: Session type changes agent behaviour, not pane structure. Keeps the code simple and the UX consistent.
+- **Two ports**: Dashboard (read-only, safe) + terminal (interactive, auth'd). Clean security boundary.
+- **Agent as subagent**: From within an agent framework, spawn a new window β don't hijack the current session.
+- **Ship the aesthetic**: tmux config included. Users shouldn't need to configure tmux to get a good experience.
+- **Sync still works**: Always-on server is primary, but cross-machine sync means offline work is fully supported.
+
+## Speech-to-Text Recommendations
+
+For study sessions β especially from a sofa, tablet, or quiet room β speech-to-text dramatically reduces friction. Instead of typing questions to the agent, speak them. This is particularly valuable for:
+- AuDHD learners who articulate better verbally than in writing
+- Socratic sessions where you're thinking out loud
+- Mobile/tablet use where typing is slow
+
+Recommended options (document in README):
+
+| Tool | Platform | Cost | Key feature |
+|------|----------|------|-------------|
+| [Warp](https://warp.dev) | macOS, Linux | Free | Built-in terminal with speech-to-text (now uses Wispr Flow). Best option if users are willing to switch terminals. |
+| [Handy](https://handy.computer/) | Universal (browser) | Free | Works anywhere, no install. Good fallback for any platform. |
+| [Wispr Flow](https://wispr.flow) | macOS | Paid | System-wide dictation with automatic um/ah/correction removal. Works in any app including terminal emulators. Best for users who want speech-to-text everywhere, not just in the study session. |
+
+Note: Warp now integrates Wispr Flow's engine, making it the single best option for users who want a terminal + speech-to-text in one tool. The combination of Warp terminal + ttyd web access gives speech-to-text on desktop and touch input on tablet.
+
+## UX Enhancements
+
+### 1. "Where was I?" Session Recovery
+
+The hardest moment for AuDHD isn't during a session β it's coming back after a break or the next day. When the tmux session is still alive:
+
+```
+studyctl study --resume
+```
+
+Agent reads `session-topics.md`, the last few exchanges, and gives a 3-line summary: "We were working on X, you'd just got Y, we were about to tackle Z." Zero re-orientation friction. The tmux session + IPC files make this trivial β the transcript is already there.
+
+This also works across devices: start on Mac Mini, walk away, come back on iPad, `--resume` gets you oriented instantly.
+
+### 2. Quick Capture Hotkey
+
+During a session, you think of something but don't want to break flow. A tmux keybinding (e.g., `prefix + p`) opens a floating popup via `tmux display-popup`:
+
+```
+ββ Quick Park βββββββββββββββββββ
+β > How does asyncio compare to β
+β threading? β
+βββββββββββββββββββββββββββββββββ
+```
+
+Hits Enter, `studyctl park` runs, popup closes, back to session. Two seconds, no context switch. Combined with speech-to-text (Warp/Wispr), you can voice-park a thought without touching the keyboard.
+
+### 3. "I'm Stuck" Dashboard Buttons
+
+For tablet/sofa use β prominent buttons on the web dashboard that send signals to the agent without typing:
+
+```
+[I'm stuck] [Different angle] [Bridge to networking]
+```
+
+Why buttons instead of typing:
+- Typing "I don't understand" feels like an admission of failure (RSD)
+- Tapping a button is emotionally neutral
+- On a tablet, buttons are faster than a keyboard
+- The "Bridge to networking" button is personalised β it tells the agent to map the concept to the user's strongest domain
+
+The agent receives the signal via IPC (a command file or the session state) and shifts approach.
+
+### 4. Energy Tracking Over Time
+
+Energy is declared at session start (1-10). Track it and surface patterns:
+
+```
+studyctl streaks
+
+ This week: 4 sessions, avg energy 6.2
+ Your best sessions (most wins): energy 7-8, mornings
+ Pattern: Tuesdays are consistently low energy (3-4)
+```
+
+This isn't just data β it's ammunition against the AuDHD guilt cycle. "Why can't I focus today?" Answer: because it's Tuesday and your energy is always 3 on Tuesdays. That's not a failure, that's a pattern. Reframe from personal failing to predictable rhythm.
+
+Data needed: study_sessions table already has energy_level and started_at. Add a `studyctl insights` or extend `studyctl streaks` to compute correlations.
+
+### 5. Break Activity Suggestions
+
+`break-science.md` already documents good vs bad break activities. When the timer hits a break threshold, the dashboard shows a rotating suggestion:
+
+```
+ Break: Stand up, walk to the kitchen.
+ (Not: phone, not: social media, not: YouTube)
+```
+
+PDA-sensitive language β information, not instruction. Rotate through the good activities list so it's not repetitive. The data is already written; this just surfaces it at the right moment.
+
+Implementation: the SSE stream or the agent pushes a break suggestion when the timer phase transitions. The web dashboard renders it in the timer message area.
+
+### 6. Session Warmup from Parked Topics
+
+At session start, before diving into the main topic, the agent automatically surfaces unresolved parked topics from previous sessions:
+
+```
+ Before we start "Python Classes" β you parked 2 topics last time:
+ β How does asyncio compare to threading?
+ β GIL vs multiprocessing
+
+ Want to tackle one of these first, or park them again?
+```
+
+Why this matters: unresolved questions create background cognitive load. Explicitly choosing to defer them ("park again") frees that load. Choosing to tackle one gives a quick win before the main session.
+
+Implementation: `get_unscheduled_parked_topics()` already exists in `parking.py`. The agent protocol calls it at session start and presents the results. Re-parking updates the `parked_at` timestamp so they don't surface every single session.
+
+## Open Questions
+
+1. **Which agent to launch?** CLI flag, not config β keeps one config across machines while choosing agent per-session: `studyctl study "topic" --agent claude`. Auto-detect installed agents as fallback if `--agent` not specified (order: claude β gemini β kiro β opencode).
+2. **ttyd as dependency**: Should ttyd be a required install or optional? It's a single binary (`brew install ttyd`) but it's another dep. Could be installed by `studyctl setup` only when `--web` is used.
+3. **tmux session persistence**: Should the tmux session survive `studyctl session end`? Useful for reviewing the conversation, but clutters the session list. Probably: keep it for 10 minutes, then auto-close.
+4. **Password storage**: Never plaintext. Recommended: 1Password via `op` CLI (`op read "op://Personal/studyctl-lan/password"`). Fallback: age-encrypted file (`~/.config/studyctl/lan.age`). Setup flow: `studyctl config set-password` detects `op` first, falls back to `age`, refuses to store plaintext. Even for a personal tool β passwords in config files get committed to git, copied between machines, left in backups.
+5. **Course/eBook integration**: How does `--course "ZTM-DE"` map to actual files? Needs a course registry in config.yaml or a convention-based path.
+
+## Next Steps
+
+1. Write implementation plan (`/ce:plan`) covering:
+ - New `studyctl study` command (replaces `studyctl session start`)
+ - tmux session creation + layout
+ - ttyd integration
+ - tmux config / TPM plugin
+ - Agent launcher
+ - Web dashboard updates (embedded terminal)
+2. Phase the work: tmux foundation first, then ttyd, then aesthetic polish
+3. Existing Phase 1-2 infrastructure (IPC files, SSE, parking lot, migration v14) carries forward unchanged
+
+## Sources
+
+- [cmux](https://github.com/manaflow-ai/cmux) β Ghostty MCP terminal (macOS)
+- [cmuxlayer](https://github.com/EtanHey/cmuxlayer) β cmux MCP server
+- [tmux-mcp](https://github.com/jonrad/tmux-mcp) β tmux MCP server (proof of concept)
+- [ttyd](https://github.com/tsl0922/ttyd) β Share terminal over the web (built-in basic auth)
+- [omerxx/dotfiles](https://github.com/omerxx/dotfiles/tree/master/tmux) β Aesthetic tmux config reference (catppuccin, top bar, clean borders)
+- [catppuccin/tmux](https://github.com/catppuccin/tmux) β Standard catppuccin tmux plugin
+- Existing: `docs/brainstorms/2026-03-28-live-study-session-dashboard-brainstorm.md`
+- Existing: `agents/shared/break-science.md` (timer thresholds)
diff --git a/docs/cli-reference.md b/docs/cli-reference.md
index e48dea6f5..8eec6ef1a 100644
--- a/docs/cli-reference.md
+++ b/docs/cli-reference.md
@@ -2,55 +2,108 @@
## studyctl
-Study pipeline management β sync notes, spaced repetition, progress tracking.
+Study pipeline management β content, review, sessions, and tracking.
```bash
-studyctl sync [TOPIC] --all --dry-run # Sync notes to NotebookLM
+# Study sessions (tmux + AI agent + Textual sidebar)
+studyctl study "topic" --energy 7 # Full tmux environment in one command
+studyctl study "topic" --mode co-study # Co-study mode (user drives)
+studyctl study --resume # Reattach to existing session
+studyctl study --end # End session cleanly
+studyctl study "topic" --web # Also start web dashboard
+studyctl park QUESTION [-t TOPIC] # Park tangential topic
+
+# Low-level session commands (used internally by study)
+studyctl session start -t TOPIC -e 7 # Start session (DB + IPC files)
+studyctl session status # Timer, topics, parking lot
+studyctl session end [-n NOTES] # End session, show summary
+
+# Content pipeline
+studyctl content split SOURCE # Split PDF by chapters
+studyctl content process SOURCE # Split + upload to NotebookLM
+studyctl content autopilot # Generate next pending episode
+studyctl content from-obsidian DIR # Markdown β PDF β NotebookLM
+studyctl content status # Show content pipeline status
+studyctl content syllabus # Manage syllabus workflow
+
+# Sync & topics
+studyctl sync [TOPIC] --all --dry-run # Sync notes to NotebookLM
studyctl status [TOPIC] # Show sync status
-studyctl review # Check spaced repetition due dates
-studyctl struggles --days 30 # Find recurring struggle topics
-studyctl wins --days 30 # Show your learning wins
-studyctl progress CONCEPT -t TOPIC -c LEVEL # Record progress on a concept
-studyctl progress-map # Visual map of all tracked concepts
-studyctl resume # Where you left off (auto-context)
-studyctl streaks # Study streak and consistency stats
-studyctl teachback CONCEPT -t TOPIC -s SCORES --type TYPE # Record teach-back score
-studyctl teachback-history CONCEPT # Show teach-back score progression
-studyctl bridge add SRC TGT -s DOMAIN -t DOMAIN # Add a knowledge bridge
-studyctl bridge list # List knowledge bridges
-studyctl schedule-blocks --start 14:00 # Generate .ics calendar study blocks
studyctl topics # List configured topics
studyctl audio TOPIC # Generate NotebookLM audio overview
studyctl dedup [TOPIC] --all --dry-run # Remove duplicate notebook sources
-studyctl state push|pull|status|init # Cross-machine state sync
-studyctl schedule install|remove|list|add|delete # Manage scheduled jobs
-studyctl config init # Interactive setup wizard
+
+# Review
+studyctl review # Check spaced repetition due dates
+studyctl struggles --days 30 # Find recurring struggle topics
+
+# Configuration & health
+studyctl setup # Interactive setup wizard
+studyctl config init # Interactive config (3 questions)
studyctl config show # Display current configuration
-studyctl web [--port PORT] [--host HOST] # Launch study web app
-studyctl tui # Launch interactive TUI dashboard
-studyctl docs serve [--port PORT] # Serve docs site locally
-studyctl docs open # Build and open docs in browser
-studyctl docs list # List available doc pages
-studyctl docs read PAGE # Read a page aloud via study-speak
+studyctl doctor # Full health check
+studyctl update # Check for available updates
+studyctl upgrade # Apply all available updates
+
+# Web
+studyctl web [--port PORT] [--host HOST] # Launch study web app (PWA)
```
-### Health & Updates
+### Study Sessions
+
+The primary entry point is `studyctl study`, which creates a complete tmux-based study environment:
+
+```bash
+studyctl study "Python Decorators" --energy 7 # Socratic mentor session
+studyctl study "Spark Internals" --mode co-study # User-driven co-study
+studyctl study "topic" --timer pomodoro # Override default timer
+studyctl study "topic" --agent claude --web # Explicit agent + web dashboard
+studyctl study --resume # Resume conversation (-r)
+studyctl study --end # End session cleanly
+studyctl park "How does asyncio compare?" # Park mid-session
+```
+
+**What `studyctl study` creates:**
+- tmux session with agent pane (left) + Textual sidebar (right)
+- AI agent launched with mode-specific persona (clean pane, no visible command)
+- Persistent session directory at `~/.config/studyctl/sessions/{name}/` β preserves AI conversation history (`.claude/`, `.kiro/`, etc.)
+- Sidebar shows timer, activity feed, counters (keyboard: `p` pause, `r` reset, `Q` end session)
+- IPC files for dashboard viewports
+- Optional web dashboard at `/session` via `--web`
+
+**Session lifecycle:**
+- **Start:** `studyctl study "topic"` β creates tmux session, agent, sidebar
+- **Exit:** quit Claude normally (`/exit`, Ctrl+C) β auto-cleans up tmux, IPC files, switches back to previous session. Session directory preserved.
+- **Resume:** `studyctl study --resume` β if tmux alive, reattaches. If ended, rebuilds tmux and passes `-r` to the agent to continue the conversation from history.
+- **End explicitly:** `studyctl study --end` or sidebar `Q` β same cleanup as quitting Claude
+
+**Modes:**
+
+| Mode | Flag | Timer default | Agent role |
+|------|------|---------------|------------|
+| Study | (default) | Elapsed | Socratic mentor drives |
+| Co-study | `--mode co-study` | Pomodoro | User drives, agent available |
-Check your installation and keep it current:
+**Low-level session commands** (used internally by `studyctl study`):
+
+```bash
+studyctl session start -t "Decorators" -e 7 # Start session record
+studyctl session status # Show current state
+studyctl session end -n "Got through closures" # End with notes
+```
+
+### Health & Updates
```bash
studyctl doctor # Full health check (Rich table)
studyctl doctor --json # JSON output (for AI agents and CI)
studyctl doctor --quiet # One-line summary
studyctl doctor --category core # Check specific category only
-studyctl update # Check for available updates (no changes)
studyctl update --json # Machine-readable update info
-studyctl upgrade # Apply all available updates
studyctl upgrade --dry-run # Preview what would change
studyctl upgrade --component packages # Upgrade only packages
studyctl upgrade --component database # Run DB migrations only
studyctl upgrade --component agents # Update agent definitions only
-studyctl upgrade --force # Upgrade even if already current
```
**Exit codes for `studyctl doctor`:**
@@ -63,19 +116,6 @@ studyctl upgrade --force # Upgrade even if already current
**Check categories:** `core` (Python, packages, config), `database` (review DB, sessions DB), `config` (Obsidian vault, review dirs, pandoc), `deps` (optional packages), `agents` (AI tool definitions), `updates` (PyPI versions).
-**AI-guided setup:** The install-mentor agent at `agents/shared/install-mentor.md` uses `studyctl doctor --json` to walk users through setup conversationally. It works with any AI coding tool (Claude Code, Kiro, Gemini CLI, OpenCode, Amp).
-
-### Confidence Levels
-
-Used with `studyctl progress`:
-
-| Level | Meaning |
-|-------|---------|
-| `struggling` | Can't solve without heavy guidance |
-| `learning` | Getting it with some scaffolding |
-| `confident` | Can apply independently |
-| `mastered` | Can teach it to others |
-
### Spaced Repetition Intervals
Review schedule: **1 β 3 β 7 β 14 β 30 days**
@@ -84,7 +124,7 @@ Review schedule: **1 β 3 β 7 β 14 β 30 days**
### Web PWA
-`studyctl web` launches a progressive web app for flashcard and quiz review. No extra dependencies. LAN accessible by default.
+`studyctl web` launches a progressive web app for flashcard and quiz review. LAN accessible by default.
```bash
studyctl web # Serve on 0.0.0.0:8567
@@ -110,30 +150,11 @@ studyctl web --host localhost # Local only
- **Read once** β speaker icon on card or `T` key
- **Auto-voice** β header toggle or `V` key (reads everything automatically)
-For best voice quality, download enhanced voices in OS settings (Accessibility β Spoken Content β Voices).
-
-### TUI Dashboard (terminal)
-
-`studyctl tui` launches a terminal dashboard. Requires `uv pip install studyctl[tui]`.
-
-| Key | Action | When |
-|-----|--------|------|
-| `d`/`r`/`c`/`s` | Switch tabs | Always |
-| `f`/`z` | Start flashcards/quiz | Always |
-| `Space` | Flip card | During review |
-| `y`/`n` | Correct/incorrect | After flip |
-| `r` | Retry wrong answers | After session |
-| `v` | Toggle voice | During review |
-| `o` | Toggle OpenDyslexic | Always |
-| `q` | Quit | Always |
-
-**Course picker:** Modal appears when multiple directories configured. **Retry mode:** SM-2 scheduling not updated during retry.
-
---
## agent-session-tools
-AI session export, search, and management.
+AI session export, search, and cross-machine sync.
```bash
session-export [--source SOURCE] # Export AI sessions to SQLite
@@ -142,9 +163,8 @@ session-query list --since 7d # List recent sessions
session-query show SESSION_ID # Show session details
session-query context SESSION_ID # Generate context for resuming
session-query stats # Database statistics
-session-sync push|pull REMOTE # Sync database across machines
+session-sync push|pull|sync REMOTE # Sync database across machines
session-maint vacuum|reindex|schema|archive # Database maintenance
-tutor-checkpoint code --skill SKILL # Record study progress
study-speak "text" [-v VOICE] [-s SPEED] # Speak text aloud using TTS
```
@@ -158,7 +178,6 @@ study-speak "text" [-v VOICE] [-s SPEED] # Speak text aloud using TTS
| `aider` | Aider |
| `opencode` | OpenCode |
| `litellm` | LiteLLM |
-| `bedrock` | Bedrock Proxy |
| `repoprompt` | RepoPrompt |
### Optional Extras
@@ -166,5 +185,4 @@ study-speak "text" [-v VOICE] [-s SPEED] # Speak text aloud using TTS
```bash
uv pip install agent-session-tools[semantic] # Vector embeddings search
uv pip install agent-session-tools[tokens] # Token counting
-uv pip install studyctl[tui] # TUI interface
```
diff --git a/docs/roadmap.md b/docs/roadmap.md
index af7f2925c..7ab9e033e 100644
--- a/docs/roadmap.md
+++ b/docs/roadmap.md
@@ -1,5 +1,7 @@
# Roadmap
+> β οΈ **Compaction (March 2026)**: The project was stripped to 4 core features: Socratic AI sessions, content pipeline (NotebookLM), flashcard/quiz review (PWA), and session intelligence (export + search + sync). Features listed below as completed may have been archived β see `docs/plans/compaction-plan.md` for details. The TUI dashboard, scheduler, calendar, knowledge bridges DB, teach-back scoring DB, win/streak tracking CLI commands, and state push/pull CLI were removed. Agent support was consolidated to Claude Code, Kiro, Gemini, and OpenCode.
+
## v1.0 β Foundation
- [x] Monorepo with studyctl + agent-session-tools
@@ -208,6 +210,18 @@ Diagnostic engine, self-update mechanism, and AI-guided setup for non-technical
- [x] **Agent manifest** β `agents/manifest.json` tracks SHA-256 hashes of all agent definitions. `scripts/update-agent-manifest.py` regenerates.
- [x] **Documentation** β README, CLI reference, setup guide, agent-install all updated for non-technical users.
+## v2.2 β Live Session Dashboard (in progress)
+
+Live study session with real-time dashboard, parking lot, and timer.
+
+- [x] **Phase 1 β Foundation**: Session CLI (`session start/end/status`, `park`), file-IPC protocol (`session-state.json`, `session-topics.md`, `session-parking.md`), parking lot persistence (migration v14), auto-migration on connect
+- [x] **Phase 1.5 β cmux**: Agent protocol for cmux MCP pane control (macOS/Ghostty)
+- [x] **Phase 2 β Web Dashboard**: SSE-powered live dashboard (`/session`), HTMX + Alpine.js, energy-adaptive timer, activity feed with visual language, session summary, artefact viewer, 14 tests
+- [x] **Bugs fixed**: Parking deduplication (migration v15 + `INSERT OR IGNORE`), IPC file permissions (0700/0600), CORS wildcard removed, SSE mtime optimization, timer pause/reset controls, auto-migrate parked_topics
+- [x] **Phase 1 β Unified Session**: `studyctl study` single command, tmux session runtime (`tmux.py`), agent launcher (`agent_launcher.py`, Claude-only), Textual sidebar (`tui/sidebar.py`), `--resume`/`--end`/`--web`, agent personas (`study.md`, `co-study.md`), persistent session directories with conversation history resume (`claude -r`), auto-cleanup on agent exit, catppuccin-compatible tmux overlay, 39 tests.
+- [ ] **Phase 2 β Polish**: Energy streaks, break suggestions, parked topic warmup, vendored HTMX/Alpine.js
+- [ ] **Phase 3 β Devices**: ttyd via nginx proxy, pyrage + Keychain password, web terminal embed, LAN access
+
## Next
### Phase 6: CI/CD Pipeline
@@ -224,11 +238,6 @@ Nightly drift detection, pre-release gate, and Docker image pipeline. Spec at `d
- [ ] Docker image running `studyctl web` with kokoro-onnx TTS
- [ ] FastAPI audio endpoint for browser playback
-### Phase 2: FastAPI Web UI
-
-- [ ] Replace stdlib HTTP server with FastAPI
-- [ ] HTMX + Alpine.js frontend, artefact viewer, progress dashboard
-
### Phase 3: MCP Agent Integration
- [ ] FastMCP v1 server with stdio transport
diff --git a/docs/session-protocol.md b/docs/session-protocol.md
index aa5418240..38f7521d9 100644
--- a/docs/session-protocol.md
+++ b/docs/session-protocol.md
@@ -72,7 +72,7 @@ studyctl review # What's due for spaced repetition
studyctl struggles # Recurring struggle topics
```
-If `studyctl wins` has recent entries, the agent surfaces one: "By the way β you mastered [concept] last week. That's real progress."
+If spaced repetition data shows concepts moving to longer intervals, the agent surfaces one: "By the way β you mastered [concept] last week. That's real progress."
---
@@ -146,7 +146,7 @@ Confidence levels: `struggling` β `learning` β `confident` β `mastered`
Based on spaced repetition intervals (1/3/7/14/30 days):
- "You should review [concept] again in 3 days."
-- Offer calendar block: `studyctl schedule-blocks --start