Overview
Jean’s session management system allows you to run multiple independent AI chat sessions within each worktree. Sessions maintain their own context, history, and state throughout their lifecycle.Key Capabilities
Session Types
Chat Sessions - Individual AI conversations:- Created automatically with base worktree
- Represents work on the default branch
- Cannot be deleted (only archived)
- Persists across app restarts
Canvas Views
Two different canvas layouts for viewing sessions: Worktree Canvas - Sessions within a single worktree:- Grid or list layout (configurable)
- Shows all sessions for active worktree
- Quick keyboard navigation (arrow keys)
- Visual status indicators
- Grouped by worktree with section headers
- Overview of entire project
- Jump between worktrees quickly
- Same grid/list layouts
src/components/chat/hooks/useCanvasKeyboardNav.ts):
- Arrow keys: Navigate between sessions
- Enter: Open selected session
- Cmd/Ctrl + shortcuts: Open plan, recap, approve plan
Session Lifecycle
Creation:- User creates new session
- Session initialized with default model/settings
- Inherits project-specific configuration
- Empty message history
- Automatically named on first message (if enabled)
- Messages appended to history
- State persisted to disk continuously
- UI state tracked (answered questions, fixed findings)
- MCP servers loaded on demand
- Terminals attached to session
- Soft delete - can be restored
- Moves to archive view
- Freed from memory but data preserved
- Subject to retention policy
- After retention period expires
- Manual deletion from archive
- All messages and state lost
- Cannot be recovered
Session Modes
Jean supports three execution modes: Plan Mode - Propose before executing:- Similar to plan mode
- Different model/settings can be configured
- Approval required before changes
- No approval needed
- Fastest iteration
- Use for trusted operations
- Append
[plan],[build], or[yolo]to message - Or use toolbar buttons
- Per-message choice
Auto-Naming
Sessions are automatically named based on first message: Configuration:- “Implement user authentication” → “User authentication system”
- “Fix bug in payment processing” → “Payment processing bug”
- “Refactor database queries” → “Database query optimization”
Session Recap (Digest)
Optional feature that summarizes sessions when you return to them: Configuration:- Returning to unfocused session
- After significant time gap
- Helps regain context quickly
State Persistence
Session data storage:- Messages:
<worktree_path>/.jean/sessions/<session_id>/messages.json - State:
<worktree_path>/.jean/sessions/<session_id>/state.json - Attachments:
<worktree_path>/.jean/sessions/<session_id>/attachments/
src/hooks/useUIStatePersistence.ts):
- Zustand store holds UI state
- Hook subscribes to changes
- Debounced save to Tauri backend
- Restored on session load
How to Use
Creating Sessions
Within a worktree:- Click ”+” in chat tabs bar
- New session created with default settings
- Start chatting immediately
- Press Cmd/Ctrl + K to open canvas
- Click “New Session” button
- Session created in current worktree
Switching Between Sessions
Tab navigation:- Click session tabs at top of chat
- Cmd/Ctrl + 1-9 for quick switching
- Cmd/Ctrl + [ and ] for prev/next
- Cmd/Ctrl + K to open canvas
- Arrow keys to move selection
- Enter to open session
- Escape to close canvas
Session Settings
Model Selection:- Toolbar dropdown
- Choose from available models
- Settings persist for session
- Off: No extended thinking
- Think: 4K thinking tokens
- Megathink: 10K thinking tokens
- Ultrathink: 32K thinking tokens
- Low: Minimal reasoning
- Medium: Moderate depth
- High: Deep analysis
- Max: Unlimited reasoning
- Change CLI backend (Claude/Codex/OpenCode)
- Select provider profile for API routing
- Per-session configuration
Managing Session History
View messages:- Scroll through chat history
- Syntax-highlighted code blocks
- Expandable thinking sections
- File previews and diffs
- Toolbar → More → Clear Context
- Creates new session
- Optionally closes original
- Useful for starting fresh
- Toolbar → Save Context
- AI summarizes conversation
- Saved as markdown file
- Can load in future sessions
Archiving Sessions
Manual archive:- Right-click session tab → Archive
- Or use canvas context menu
- Confirmation dialog (if enabled)
- Moves to archive
- Open Archive modal (Cmd/Ctrl + Shift + A)
- Sessions grouped by worktree
- Filter and search
- Restore or permanently delete
- Find in archive modal
- Click “Restore”
- Returns to active sessions
- All state preserved
Canvas Workflow
Switching layouts:- Settings → Interface → Canvas Layout
- Grid: Visual cards with previews
- List: Compact rows for many sessions
- Session name and timestamp
- Last message preview
- Status badges (waiting, thinking, error)
- Model and mode indicators
- Denser information display
- More sessions visible at once
- Quick scanning
- Same functionality as grid
Configuration Options
Settings → Sessions
Auto-Naming:Settings → Interface
Canvas Layout:Best Practices
Session Organization
One session per task:- Keep sessions focused
- Create new session for different work
- Avoid mixing unrelated topics
Context Management
When to clear context:- Hit token limits
- Change direction significantly
- Start new feature in same worktree
- Performance degrades
- Before major refactoring
- End of work session
- Before asking team for help
- Documenting decisions
Canvas Usage
Grid view for:- Visual thinkers
- Fewer sessions (< 20)
- Quick status overview
- Session preview helpful
- Many sessions (20+)
- Fast scanning
- Keyboard-heavy workflow
- Information density priority
Archive Management
Archive vs. Delete:- Archive: Temporary pause, might return
- Delete: Definitely done, save space
- 7 days: Active projects, fast iteration
- 30 days: Reference needed for similar work
- Never: Audit trail required
Model Selection
By task type:- Opus: Complex problems, architecture decisions
- Sonnet: General development, code review
- Haiku: Quick questions, simple refactors
- Off: Fast, deterministic tasks
- Think: Standard reasoning
- Megathink: Complex logic, edge cases
- Ultrathink: Novel problems, research
Performance Optimization
Keep sessions lean:- Archive finished work
- Don’t load unnecessary context
- Clear old thinking traces
- Use file mentions instead of pasting code
- Active sessions per worktree: 10-15
- Messages per session: < 100
- Token count: < 100K
Recovery
If session crashes:- Jean auto-saves continuously
- Restart app to recover
- Check logs in debug panel
- Report crash with logs
- Check
.jean/sessions/directory messages.jsonfiles are readable- Can manually reconstruct
- Future: built-in export