The interStepDelayMs config is rarely needed and clutters the UI.
Backend still supports it with default value (1000ms).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add task-tracker.ts to architecture tree
- Document pre-compiled regex pattern convention for performance
- Update idle detection docs with hybrid indicator+timeout approach
- Add buffer limits table with all size constants
- Clarify test configuration (ports 3101-3108)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Primary: Use '↵ send' indicator for immediate response when ready
- Fallback: Use timeout-based detection for prompt patterns
- Add working indicators: Synthesizing, Brewing, ✻, ✽
- Cleaner step completion handlers (checkUpdateComplete, etc.)
The hybrid approach responds immediately when Claude shows the
suggestion indicator, while still having timeout fallback for
reliability.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add '↵ send' as primary idle indicator (suggestion ready)
- Add 'Synthesizing', 'Brewing' to working patterns
- Add '✻', '✽' activity indicators to working patterns
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change default idleTimeoutMs from 5s to 10s
- Use configured idle timeout for all step completion checks
- Ensures each step (update, /clear, /init) waits properly until idle
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Move launch and completion detection patterns to module-level constants
- Use iterator directly instead of Array.from for deduplication check
- Reduces regex compilation overhead on every terminal output
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Debounce save() calls by 500ms to batch multiple updates
- Add saveNow() for immediate persistence when needed
- Add flush() method for shutdown cleanup
- Reduces disk I/O from O(n) to O(1) for rapid state changes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Pre-compile ANSI escape and whitespace regex patterns in respawn controller
- Pre-compile screen pattern regex for screen list parsing
- Batch ps and pgrep calls in getScreensWithStats() for multiple screens
- Reduces subprocess spawns from O(2n) to O(2) for n screens
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Pre-compile regex patterns (ANSI escape, token parsing) in session.ts
- Optimize SSE broadcast to serialize JSON once for all clients
- Add DOM element caching ($() helper) to avoid repeated getElementById
- Throttle resize observer with dimension change detection
- Use array.join() for session tab HTML building
- Replace DOM-based escapeHtml with regex replacement
- Cache toast container reference
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove "Connected/Disconnected" indicator to save header space
- Move token count to the far right of the header (after settings icon)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Session tabs: 150px → 220px (show more of filename)
- Case select dropdown: 120px → 180px (show full case names)
- Working dir display: 300px → 450px (show full paths)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- killScreen now uses 4 strategies for reliable cleanup:
1. Kill all child processes recursively (SIGTERM then SIGKILL)
2. Kill entire process group (-PID) to catch orphans
3. Kill screen by name (screen -X quit)
4. Direct SIGKILL as final fallback
- Refresh screen PID from screen -ls before killing (handles stale PIDs)
- reconcileScreens now discovers unknown claudeman screens from screen -ls
This prevents "ghost" screens that persist after screens.json is lost
- restoreScreenSessions handles newly discovered screens
The rapid session creation test now fails because discovery is working -
it finds screens that weren't killed fast enough (test timing issue)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- killScreen now finds and kills all child processes before quitting screen
to prevent claude processes from becoming orphaned (the main bug)
- Add cleanupSession() method for comprehensive resource cleanup:
respawn controllers, timers, batches, event listeners, and sessions
- Fix /api/run endpoint to cleanup sessions after completion
- Fix /api/quick-start error path to cleanup on failure
- Add MAX_CONCURRENT_SESSIONS (50) limit to prevent unbounded growth
- Update CLAUDE.md with improved documentation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Redesign Run Claude button with purple gradient
- Redesign Run Shell button with dark green gradient
- Add + button to create new cases from toolbar
- Add Create Case modal for quick case creation
- Add Kill All modal with two options (tabs only vs full kill)
- Add CPU/Memory progress bars with color gradients
- Make monitor panel detachable as floating draggable window
- Monitor panel resizable when detached (min 350x250)
- Default CLAUDE.md template now uses /home/arkon/default/CLAUDE.md
- Streamline CLAUDE.md documentation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Kill All button with confirmation dialog to monitor panel header
- Button shows red X icon, confirms before killing all sessions
- Center-align close session modal options for better UX
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When switching between Claude session tabs, the terminal buffer was
rendered at a different size than the current terminal. This caused
Claude's banner to appear squished/corrupted.
Changes:
- Remove ANSI regex stripping that was breaking terminal output
- Send Ctrl+L after resize to trigger Claude CLI to redraw at correct size
- Only send Ctrl+L for Claude sessions, not shell sessions
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When switching between Claude session tabs, the terminal buffer was
rendered at a different size than the current terminal. This caused
Claude's banner to appear squished/corrupted. Sending Ctrl+L after
resize triggers Claude CLI to redraw at the correct dimensions.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
GNU screen creates blank space at the top when initializing sessions.
This is now handled after attaching to the screen:
- Claude sessions: emit clearTerminal event after 100ms, client clears xterm
- Shell sessions: send 'clear' command after 100ms
Also updates CLAUDE.md with documentation of the fix.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document three endpoints that were in the code but missing from docs:
- GET /api/sessions/:id/output
- POST /api/sessions/:id/run
- POST /api/run
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add complete API endpoint listing organized by category
- Include request body formats for all endpoints
- Add key frontend files reference for easier navigation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixed bug where firstSessionId was set when i===1 instead of i===0,
causing it to never be set when creating a single session.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Monitor panel now 500px wide and 80vh max height
- Removed Copy, Clear, Monitor, Kill buttons from toolbar
- Redesigned close session modal with cleaner options:
- "Remove Tab" keeps screen running
- "Kill Claude" terminates completely
- Auto-switch to new session when created
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When clicking (x) on a session tab, users now choose:
- Hide Tab (Keep Screen): removes tab but screen session stays alive
- Close & Kill Screen: terminates both tab and screen session
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Document different token tracking approaches for one-shot vs interactive modes
- Update PTY spawn mode examples to show --output-format stream-json flag
- Explain that interactive mode parses tokens from status line with 60/40 split estimate
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add --output-format stream-json to runPrompt() for JSON output with
token usage data
- Add parseTokensFromStatusLine() to parse tokens from Claude's status
line display in interactive mode (e.g., "123.4k tokens")
- Token parsing supports numeric, k (thousands), and M (millions) suffixes
- Estimates input/output split (60/40) for interactive mode since only
total is displayed
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Claude sessions: w1-casename, w2-casename, etc.
- Shell sessions: s1-casename, s2-casename, etc.
- Never reuses numbers - always increments from highest existing
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Monitor panel now opens by default on webapp start
- Replace "Reconcile" button with refresh icon (↻)
- Change close button to toggle (▼/▲) for collapse/expand
- Preserve session display names when saving screen info
- Use stored name when restoring sessions (no more "Restored:" prefix)
- Show session name in Monitor panel instead of screen name
- Kill screen session when closing a tab
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Instead of showing "No background tasks" message, the section is now
completely hidden when there are no tasks, making the UI cleaner.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Make it explicit that `npm run dev` shows CLI help, not starts server.
Document the correct command: `npx tsx src/index.ts web`
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Move font controls (A+/A-) to left of connection status
- Redesign tab count with stepper buttons (−/number/+)
- Remove respawn panel, integrate settings into session options modal
- Fix Monitor panel SSE handler (wrong element ID)
- Add screen wrapping support to Session class
- Add E2E testing skill using agent-browser
- Document testing approach in README.md and CLAUDE.md
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
README.md:
- Add multi-tab sessions, monitor panel, session restoration to features
- Update keyboard shortcuts (remove Ctrl+N, update descriptions)
- Document new UI features in Additional Features section
CLAUDE.md:
- Add screen-manager.ts to architecture diagram
- Add ScreenManager to key components section
- Update WebServer description with session restoration
- Add completed tasks for recent features
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add number input (1-10) next to "Run Claude" button in toolbar
- When tabCount > 1, create sessions named "1-projectname", "2-projectname", etc.
- All sessions share the same working directory (case folder)
- First session is auto-selected after creation
- Add CSS for small number input in toolbar
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add restoreScreenSessions() method to WebServer
- On startup, reconcile screens to find alive sessions from previous run
- Create Session objects for each alive screen with preserved ID
- Start stats collection automatically when restored sessions exist
- Log restoration activity for debugging
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Combine two separate panels into unified Monitor panel with sections
- Move font size controls from toolbar to header
- Add CSS styles for new monitor panel with section headers
- Update JS to handle combined panel with toggleMonitorPanel()
- Keep legacy toggleTaskPanel() as alias for backward compatibility
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove New Session slide-up panel from HTML
- Remove createNewSession, hideNewSessionPanel, createSessionFromPanel functions
- Remove Ctrl+N keyboard shortcut
- Remove "New Session" from help modal
- Clean up loadQuickStartCases and closeAllPanels references
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The renderSessionTabs() function was re-adding the + button. Now it only
renders session tabs without the new session button. Users can still
create sessions via Ctrl+N keyboard shortcut.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The gear icon for app settings was already added, but the old New Session
tab was not removed. Users can still create sessions via Ctrl+N or other UI elements.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
All 6 tasks from the pending list have been implemented:
1. Settings gear icon with app settings modal
2. Confirmation dialog for session close
3. Default CLAUDE.md template path setting
4. GNU screen wrapping with Process Monitor panel
5. UI cleanup (respawn controls, directory width)
6. Terminal focus escape sequence filtering
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add screen session management infrastructure:
- ScreenManager class to create, track, and kill GNU screen sessions
- Persistence of screen sessions to ~/.claudeman/screens.json
- Process stats collection (memory, CPU, child count)
- Reconciliation to detect dead/orphan screens
New API endpoints:
- GET /api/screens - list screens with stats
- DELETE /api/screens/:sessionId - kill screen
- POST /api/screens/reconcile - find dead screens
- POST /api/screens/stats/start|stop - control stats polling
New Process Monitor panel:
- Slide-up panel with real-time stats (2s updates)
- Shows memory, CPU, child processes per screen
- Kill button for each screen session
- Reconcile button to clean up dead screens
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When creating new cases via /api/cases or /api/quick-start, the
server now checks ~/.claudeman/settings.json for a defaultClaudeMdPath.
If found and the file exists, it uses that template with placeholder
substitution ([PROJECT_NAME], [PROJECT_DESCRIPTION], [DATE]).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Shows a confirmation modal when clicking "x" on session tabs to warn
the user that the Claude session and running processes will be
terminated. Users can cancel or confirm the close action.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document the centralized TypeScript interfaces in src/types.ts
including core state types, configuration types, and API error handling.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>