Problem
SessionService.swift (936 LOC) handles: state hydration from JSON store, backward-compatibility migrations, session CRUD, terminal lifecycle (add/close/launch Claude), worktree management, orphaned worktree detection, VS Code integration, and global terminals. The class has 20+ public methods with no clear grouping.
Proposed Improvement
Split into:
SessionService — CRUD operations + state hydration (~300 LOC)
TerminalService — terminal lifecycle, readiness tracking, Claude launching (~300 LOC)
WorktreeService — worktree detection, orphan recovery (~200 LOC)
Effort
Medium-High (3–4 hours). Methods have dependencies on appState and store that need careful threading.
Files Affected
Sources/Crow/App/SessionService.swift (shrinks from 936 to ~300 LOC)
- New:
Sources/Crow/App/TerminalService.swift
- New:
Sources/Crow/App/WorktreeService.swift
Priority: 4/10
Problem
SessionService.swift(936 LOC) handles: state hydration from JSON store, backward-compatibility migrations, session CRUD, terminal lifecycle (add/close/launch Claude), worktree management, orphaned worktree detection, VS Code integration, and global terminals. The class has 20+ public methods with no clear grouping.Proposed Improvement
Split into:
SessionService— CRUD operations + state hydration (~300 LOC)TerminalService— terminal lifecycle, readiness tracking, Claude launching (~300 LOC)WorktreeService— worktree detection, orphan recovery (~200 LOC)Effort
Medium-High (3–4 hours). Methods have dependencies on
appStateandstorethat need careful threading.Files Affected
Sources/Crow/App/SessionService.swift(shrinks from 936 to ~300 LOC)Sources/Crow/App/TerminalService.swiftSources/Crow/App/WorktreeService.swiftPriority: 4/10