Commit Graph
87 Commits
Author SHA1 Message Date
arkonandClaude Opus 4.5 d412096649 fix(respawn): wait for idle timeout before triggering cycle
- Fixed respawn controller immediately sending commands when Claude
  becomes idle, which prevented users from typing. Now waits for
  idleTimeoutMs (default 10s) before triggering the respawn cycle.
- Removed Directory field from Session Options modal for cleaner UI
- Compacted CLAUDE.md documentation for better readability

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 15:00:49 +01:00
arkonandClaude Opus 4.5 035ffb42b9 feat(ui): improve respawn duration with preset buttons
Replace the simple number input for respawn duration with a preset
button group (30m, 1h, 2h, 4h, 8h, ∞, Custom). Move duration to be
the first option in the Respawn Controller settings.

- Add duration preset buttons with visual highlighting for selection
- ∞ (unlimited) is selected by default
- Custom option reveals a number input for arbitrary values
- Reset to default when modal opens

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 14:37:20 +01:00
arkonandClaude Opus 4.5 c82686f08e docs: add API routes reference and TypeScript check command
Add quick reference table for commonly used API endpoints and clarify
that no linter is configured (use tsc --noEmit for type checking).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 13:41:27 +01:00
arkonandClaude Opus 4.5 7768fd610b docs: add inner loop tracking documentation
Update CLAUDE.md:
- Add inner-loop-tracker.ts to architecture diagram
- Add InnerLoopTracker component description
- Add Inner Loop Tracking section with patterns and API
- Update SSE events list with inner loop events
- Update state persistence notes

Update README.md:
- Add Inner Loop Tracking to features list
- Add Inner Loop Tracking section with detection patterns, UI, and API
- Update State Files section with state-inner.json

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 13:24:45 +01:00
arkonandClaude Opus 4.5 ee8f6bd0cb feat: track Ralph Wiggum loops and todo lists in Claude sessions
Add InnerLoopTracker to detect and expose internal Claude Code state
running inside claudeman sessions by parsing terminal output patterns.

Detection patterns:
- Completion phrases: <promise>PHRASE</promise>
- Todo items: checkbox format, indicator icons, status parentheses
- Loop status: cycle counts, elapsed time, start/completion

New features:
- Inner state panel UI (collapsible, below session tabs)
- SSE events: innerLoopUpdate, innerTodoUpdate, innerCompletionDetected
- API endpoint: GET /api/sessions/:id/inner-state
- State persistence to ~/.claudeman/state-inner.json

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 13:21:01 +01:00
arkonandClaude Opus 4.5 d711ec8b3a feat: add kickstart prompt and auto-compact context options
Kickstart Prompt:
- Remove Idle Timeout setting from respawn UI (uses 10s default)
- Add Kickstart Prompt field sent when /init doesn't trigger work
- New states: monitoring_init, sending_kickstart, waiting_kickstart
- Monitors 3s after /init to detect if Claude started working

Auto-Compact Context:
- Add auto-compact at 110k tokens (sends /compact with optional prompt)
- Preserves summarized context unlike /clear which wipes everything
- Optional focus prompt to guide what compact should preserve
- Blocks auto-clear while compacting to prevent conflicts

Also updates auto-clear default threshold from 100k to 140k tokens.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 13:08:53 +01:00
arkonandClaude Opus 4.5 0949b52830 docs: add E2E testing section and state store debouncing pattern
- Make dev mode GOTCHA more prominent with warning emoji
- Add State Store Debouncing pattern documenting 100ms debounce
- Add dedicated E2E Testing section with quick test sequence
- Move E2E info from Notes to its own section

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 12:55:08 +01:00
arkonandClaude Opus 4.5 66c8f323a8 refactor: remove Step Delay option from respawn UI
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>
2026-01-19 12:52:37 +01:00
arkonandClaude Opus 4.5 8f126b559e docs: improve CLAUDE.md with architecture and pattern details
- 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>
2026-01-19 12:52:29 +01:00
arkonandClaude Opus 4.5 a5b8628e53 refactor: hybrid indicator+timeout detection in respawn controller
- 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>
2026-01-19 12:32:36 +01:00
arkonandClaude Opus 4.5 a1fb65010d fix: improve respawn idle/working detection patterns
- 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>
2026-01-19 12:26:37 +01:00
arkonandClaude Opus 4.5 30142d046f fix: increase respawn idle timeout to 10s and use consistently
- 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>
2026-01-19 12:24:50 +01:00
arkonandClaude Opus 4.5 cebc7cfe25 perf: pre-compile regex patterns in task-tracker
- 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>
2026-01-19 11:53:11 +01:00
arkonandClaude Opus 4.5 f4cab35e26 perf: add debounced writes to state-store
- 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>
2026-01-19 11:51:32 +01:00
arkonandClaude Opus 4.5 d0e5d3aed6 perf: optimize screen manager and respawn controller
- 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>
2026-01-19 11:49:59 +01:00
arkonandClaude Opus 4.5 ce61a3b2f2 perf: optimize hot paths across server, session, and frontend
- 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>
2026-01-19 11:48:02 +01:00
arkonandClaude Opus 4.5 0af813b3c4 style: label Kill All button in monitor panel
Change icon-only button to labeled "Kill All" button for clarity

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 11:37:16 +01:00
arkonandClaude Opus 4.5 7acce33d7d style: remove connection status, move tokens to far right
- 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>
2026-01-19 11:36:13 +01:00
arkonandClaude Opus 4.5 08ee3cd9b7 style: increase width of tabs, case select, and working dir display
- 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>
2026-01-19 11:34:42 +01:00
arkonandClaude Opus 4.5 f5138e86a6 docs: document session cleanup and kill process
- Add Session Lifecycle & Cleanup section to CLAUDE.md
- Document MAX_CONCURRENT_SESSIONS limit (50)
- Document 4-strategy kill process for screens
- Document ghost screen discovery on startup
- Document cleanupSession() function
- Update ScreenManager description

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 11:31:32 +01:00
arkonandClaude Opus 4.5 d0194d6420 fix: improve screen cleanup and add ghost screen discovery
- 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>
2026-01-19 11:24:14 +01:00
arkonandClaude Opus 4.5 a77abb574b fix: prevent orphaned claude processes and session memory leaks
- 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>
2026-01-19 11:19:13 +01:00
arkonandClaude Opus 4.5 23cafd2556 feat: UI improvements - buttons, monitor panel, system stats
- 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>
2026-01-19 10:36:30 +01:00
arkonandClaude Opus 4.5 6a5beb3afa feat: add Kill All button to monitor panel + center close modal
- 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>
2026-01-19 07:57:13 +01:00
arkonandClaude Opus 4.5 45a1d09665 docs: document tab switching Ctrl+L fix
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 07:54:56 +01:00
arkonandClaude Opus 4.5 c9094e6cf0 fix: send Ctrl+L after tab switch to fix squished Claude display
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>
2026-01-19 07:54:30 +01:00
arkonandClaude Opus 4.5 5d1c60fd1a fix: send Ctrl+L after tab switch to fix squished Claude display
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>
2026-01-19 07:35:55 +01:00
arkonandClaude Opus 4.5 2cf3d66d0f fix: clear screen initialization blank space after attaching
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>
2026-01-19 07:33:33 +01:00
arkonandClaude Opus 4.5 7979e77924 perf: optimize for long-running Claude sessions
Critical fixes (unbounded growth):
- Add 64KB line buffer limit with 100ms periodic flush in session.ts
- Add task tracker cleanup (max 100 completed tasks)
- Add scheduled runs auto-cleanup after 1 hour
- Fix session leaks in scheduled run iterations

High priority (performance):
- Add SSE event batching (50ms output, 100ms task updates)
- Parallelize screen stats with Promise.all()
- Add 1MB buffer limit to respawn controller

Medium priority (frontend):
- Make xterm scrollback configurable (default 5000)
- Debounce renderSessionTabs() at 100ms

New feature:
- Add CPU and memory usage display in frontend header
- New /api/system/stats endpoint

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 06:51:25 +01:00
arkonandClaude Opus 4.5 40fd13480d docs: add missing API endpoints to CLAUDE.md
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>
2026-01-19 06:40:18 +01:00
arkonandClaude Opus 4.5 94b4ee5e6e docs: expand API endpoints and add frontend file references
- 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>
2026-01-19 05:28:45 +01:00
arkonandClaude Opus 4.5 a471920c58 fix: auto-switch to new session now works correctly
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>
2026-01-19 05:00:21 +01:00
arkonandClaude Opus 4.5 c058395c3e feat: improve UI - larger monitor, cleaner close modal, remove toolbar buttons
- 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>
2026-01-19 04:55:51 +01:00
arkonandClaude Opus 4.5 0245f61c37 feat: add option to keep screen alive when closing tab
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>
2026-01-19 04:47:48 +01:00
arkonandClaude Opus 4.5 79c5e4ba09 docs: update token tracking documentation
- 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>
2026-01-19 04:45:51 +01:00
arkonandClaude Opus 4.5 40c2ef1491 fix: enable token tracking for both interactive and one-shot modes
- 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>
2026-01-19 04:42:13 +01:00
arkonandClaude Opus 4.5 e4dfee0ea7 style: remove terminal padding completely for zero wasted space
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:39:21 +01:00
arkonandClaude Opus 4.5 96a4f5d79a style: reduce terminal padding to minimize wasted space
Changed xterm padding from 0.5rem to 2px 4px for tighter layout.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:32:50 +01:00
arkonandClaude Opus 4.5 ca98b33d6a feat: use w1/w2/s1/s2 naming convention for sessions
- 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>
2026-01-19 04:27:57 +01:00
arkonandClaude Opus 4.5 f676df2a8c style: change busy tab indicator from yellow to green
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:23:50 +01:00
arkonandClaude Opus 4.5 ea9618e281 feat: improve Monitor panel UX and preserve session names
- 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>
2026-01-19 04:22:41 +01:00
arkonandClaude Opus 4.5 34c86488dd fix: hide Background Tasks section in Monitor panel when empty
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>
2026-01-19 04:02:46 +01:00
arkonandClaude Opus 4.5 e286866c60 docs: clarify web server startup commands in CLAUDE.md
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>
2026-01-19 03:43:59 +01:00
arkonandClaude Opus 4.5 bf41dab827 feat: UI improvements and E2E testing with agent-browser
- 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>
2026-01-19 03:40:57 +01:00
arkonandClaude Opus 4.5 7d01d3f274 docs: update README.md and CLAUDE.md with new features
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>
2026-01-19 03:02:04 +01:00
arkonandClaude Opus 4.5 5b2091bd86 feat: add multi-tab feature to open 1-10 Claude sessions at once
- 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>
2026-01-19 02:55:10 +01:00
arkonandClaude Opus 4.5 27323217a1 feat: restore screen sessions on server restart
- 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>
2026-01-19 02:51:54 +01:00
arkonandClaude Opus 4.5 89c9b0fe85 feat: merge Process Monitor and Background Tasks into single Monitor panel
- 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>
2026-01-19 02:48:28 +01:00
arkonandClaude Opus 4.5 c2177b659e fix: remove New Session panel entirely
- 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>
2026-01-19 02:40:03 +01:00
arkonandClaude Opus 4.5 3f614745d6 fix: also remove New Session tab from JS render function
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>
2026-01-19 02:28:10 +01:00
arkonandClaude Opus 4.5 0e0b5263bc fix: remove New Session tab from header
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>
2026-01-19 02:27:25 +01:00
arkonandClaude Opus 4.5 fa036aecf6 docs: mark all pending tasks as completed
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>
2026-01-19 02:20:13 +01:00
arkonandClaude Opus 4.5 56c9f670e6 feat: add GNU screen wrapping with process monitor
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>
2026-01-19 02:18:51 +01:00
arkonandClaude Opus 4.5 b30657a36f feat: use custom CLAUDE.md template path when creating cases
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>
2026-01-19 02:12:32 +01:00
arkonandClaude Opus 4.5 885e9dc729 feat: add confirmation dialog for session close
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>
2026-01-19 02:10:44 +01:00
arkonandClaude Opus 4.5 5f29455bbb feat: add settings gear icon with app settings modal
- Add gear icon button in header-right for app settings
- Create App Settings modal with fields for:
  - Default CLAUDE.md template path
  - Default working directory
- Settings persist to ~/.claudeman/settings.json
- Add GET/PUT /api/settings endpoints
- Keep "+" tab for creating new sessions (useful UX)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 02:08:58 +01:00
arkonandClaude Opus 4.5 0876c2d4e9 docs: add Type Definitions section to CLAUDE.md
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>
2026-01-19 02:07:46 +01:00
arkonandClaude Opus 4.5 363b6d1147 refactor: UI cleanup - move respawn controls, remove mode label, fix dir width
- Move respawn controls from toolbar to session options modal
- Remove unnecessary Mode label from session options (visible in tab)
- Increase directory input width from 200px to 350px
- Add RTL direction to directory display to show end of long paths
- Add respawn status indicator with stop/configure buttons in modal

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 02:06:37 +01:00
arkonandClaude Opus 4.5 3be3595907 fix: filter terminal focus escape sequences
Filter out ^[[I (focus in) and ^[[O (focus out) ANSI codes that appear
when clicking in/out of the Claude terminal. Also filters the enable/
disable sequences (\x1b[?1004h and \x1b[?1004l).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 02:04:30 +01:00
arkonandClaude Opus 4.5 e747e5a27f docs: update CLAUDE.md with new API endpoints
- Add session rename endpoint (PUT /api/sessions/:id/name)
- Add shell session endpoint (POST /api/sessions/:id/shell)
- Update session creation to include mode and name parameters

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 01:47:47 +01:00
arkonandClaude Opus 4.5 281651e553 fix: improve UI usability and keyboard shortcuts
- Fix terminal welcome message to say "Run Claude" instead of "Quick Start"
- Fix Ctrl+Enter keyboard shortcut by using capture phase
- Auto-select default case and show directory on load
- Make gear icon larger (1rem) with rotation animation on hover
- Add right-click on session tabs for inline rename
- Update directory display when case selection changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 01:42:47 +01:00
arkonandClaude Opus 4.5 dc5c874b11 feat: add session rename, shell mode, and UI improvements
- Add session name property with rename API endpoint
- Add shell session mode (plain bash/zsh without Claude)
- Add gear icon on session tabs for options (rename)
- Add mode indicator on tabs for shell sessions
- Rename "Quick Start" button to "Run Claude"
- Add "Shell" button to start plain shell sessions
- Replace cost counter with total token counter
- Add session options modal for renaming

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 01:26:38 +01:00
arkonandClaude Opus 4.5 4903c45ec9 docs: update README and CLAUDE.md with new features
- Add documentation for token tracking and auto-clear
- Add documentation for enable respawn on existing sessions
- Add documentation for timed respawn duration
- Add TaskTracker to architecture diagram
- Update keyboard shortcuts section
- Add new SSE events to event catalog
- Add new API endpoints documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 00:49:30 +01:00
arkonandClaude Opus 4.5 ad99fe5922 feat: add auto-clear, timed respawn, and enable on existing sessions
- Add token tracking to Session class (input/output tokens)
- Add auto-clear feature that sends /clear when token threshold reached
- Add API endpoint to enable respawn on existing running sessions
- Add timed duration setting for respawn (auto-stops after N minutes)
- Add TaskTracker class for background task detection and tree display
- Update UI with duration input, auto-clear settings, and "Enable on Current" button
- Add respawn timer display in banner when timed run is active
- Add token count display in respawn banner

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 00:38:11 +01:00
arkonandClaude Opus 4.5 fd9254d8e5 docs: add testing commands to CLAUDE.md
Include npm test scripts and vitest commands for running
single test files and pattern matching.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 23:18:43 +01:00
arkonandClaude Opus 4.5 c0efba8fa3 feat(ui): enhance session status visual indicators
- Add glow effect to status dots (green/yellow/red)
- Add stopped status style for terminated sessions
- Add subtle pulsing glow animation for active session card

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 22:44:52 +01:00
arkonandClaude Opus 4.5 8c3d150638 docs: update README with all new UI features
- Document keyboard shortcuts including Ctrl+?
- Add new "Additional Features" section covering:
  - Terminal font controls
  - Copy terminal output
  - Session duration display
  - Working directory display
  - Session count in header
  - Toast notifications
  - Mobile support
  - Help modal
  - Reconnect button
  - Confirmation dialogs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 22:40:26 +01:00
arkonandClaude Opus 4.5 e6e3bf094b feat(ui): add started time display in timer banner
- Show start time in timer banner (e.g., "Started: 14:30")
- Style with monospace font for consistent width

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 22:37:02 +01:00
arkonandClaude Opus 4.5 4678e78b95 feat(ui): add confirmation for long timed runs
- Add confirmation dialog for runs 30+ minutes
- Show duration in human-readable format (hours/minutes)
- Replace alert with toast for empty prompt warning

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 22:32:45 +01:00
arkonandClaude Opus 4.5 bc72bccc85 feat(ui): add reconnect button and session count in header
- Add retry button when SSE connection is lost
- Add reconnectSSE method for manual reconnection
- Add session count to header stats
- Include session costs in total cost calculation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 22:29:23 +01:00
arkonandClaude Opus 4.5 919e48a5cc feat(ui): add session directory display and improve error handling
- Show working directory in session cards with tooltip for full path
- Add toast notifications for API call failures
- Check HTTP response status before parsing JSON

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 22:23:46 +01:00
arkonandClaude Opus 4.5 c1ec28eace feat(ui): add help modal and copy terminal button
- Add floating help button (?) with keyboard shortcuts modal
- Add Ctrl+? shortcut to open help modal
- Add copy terminal button to copy output to clipboard
- Style kbd elements for keyboard shortcut display
- Update Escape key to close all modals

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 22:18:17 +01:00
arkonandClaude Opus 4.5 c60f416d4b feat(ui): add terminal font controls and session duration
- Add font size controls (A+/A-) with keyboard shortcuts (Ctrl++/-)
- Add session duration display in session cards
- Persist font size preference in localStorage
- Add periodic session re-render to update durations
- Update terminal welcome message with new shortcuts
- Update README keyboard shortcuts documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 22:11:43 +01:00
arkonandClaude Opus 4.5 f8b84a9465 feat(ui): add mobile responsiveness and favicon
- Add comprehensive responsive styles for tablets (1024px), phones (768px, 480px)
- Add touch optimization media query for larger tap targets
- Add SVG favicon with lightning bolt icon
- Add meta description and theme-color tags
- Add dynamic page title updates based on session/timer state
- Update README with keyboard shortcuts documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 22:04:02 +01:00
arkonandClaude Opus 4.5 070c3f92e7 feat(ui): add toast notifications and more polish
- Add toast notification system with slide-in animation
- Toast types: info, success, warning, error
- Show connection status toasts on connect/disconnect
- Add toast container styling with proper z-index

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 21:47:17 +01:00
arkonandClaude Opus 4.5 431732e326 feat(ui): add keyboard shortcuts and improve states
Keyboard Shortcuts:
- Ctrl+Enter: Quick Start
- Ctrl+K: Kill All Sessions
- Ctrl+L: Clear Terminal
- Ctrl+1/2/3: Switch Tabs
- Escape: Close modals

UI Improvements:
- Add keyboard shortcuts to terminal welcome message
- Improve scrollbar styling with gradients
- Add tooltip base styles
- Add loading states (loading, loading-lg, loading-container)
- Add empty state styles with icon/title/text
- Add error state styling with red background
- Add success state styling with green background

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 21:42:57 +01:00
arkonandClaude Opus 4.5 5b1941330b chore: add vitest for testing
- Add vitest as dev dependency
- Add test script to package.json

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 21:37:29 +01:00
arkonandClaude Opus 4.5 1bcb6be9ba docs: update documentation with new features
- Document long-running session support (12-24+ hours)
- Document buffer management and limits
- Document DELETE /api/sessions endpoint
- Document resource monitoring and display
- Document Kill All functionality
- Document performance optimizations
- Update feature list with new capabilities
- Add Long-Running Sessions section to README

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 21:37:03 +01:00
arkonandClaude Opus 4.5 09877c66b2 feat(ui): redesign with modern styling and resource display
UI Improvements:
- Add gradient backgrounds to all components
- Add smooth hover/active animations with transforms
- Add subtle shadows and glow effects
- Add animated progress bar shimmer effect
- Add gradient logo with text fill

Button Redesign:
- Add gradient backgrounds and hover effects
- Add shadow on hover with lift animation
- Add btn-xs size for compact buttons
- Improve Kill All button styling

Session Cards:
- Show resource usage (memory, messages)
- Color-coded usage indicators (green/yellow/red)
- Add kill button per session
- Click to switch active session and load terminal

Process Management:
- Add Kill All Sessions button in panel header
- Add killAllSessions() and deleteSession() methods
- Add formatBytes() helper for display
- Add selectSession() to switch between sessions

Performance:
- Add requestAnimationFrame batching for terminal writes
- Smooth 60fps rendering with write batching

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 21:36:37 +01:00
arkonandClaude Opus 4.5 4712af433c feat: add long-running session support and process management
- Add buffer management for 12-24+ hour sessions
- Terminal buffer: 5MB max with auto-trim to 4MB
- Text output: 2MB max with auto-trim to 1.5MB
- Messages: 1000 max, keeps recent 800

- Add DELETE /api/sessions endpoint to kill all sessions
- Enhanced session.stop() with SIGKILL fallback
- Kill process groups to terminate child processes
- Clean up respawn controller on session delete

- Add terminal batching at 60fps for performance
- Add bufferStats to session details for monitoring

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 21:36:03 +01:00
arkonandClaude Opus 4.5 c81d014ec1 test: add comprehensive test suite with 129 tests
- Add PTY interactive session tests
- Add SSE event streaming tests
- Add scheduled runs API tests
- Add edge case and error handling tests
- Add integration flow tests for user workflows
- Add respawn controller tests with edge cases
- Add session cleanup and resource management tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 21:35:34 +01:00
arkonandClaude Opus 4.5 3a0adfc5dc feat(web): add Quick Start button for one-click Claude sessions
Adds a Quick Start section at the top of the Run tab that creates a case
folder (if needed) and starts an interactive Claude session in one click,
reducing the workflow from 5 steps to 1-2.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 20:11:46 +01:00
arkonandClaude Opus 4.5 ea6e1090bb docs: expand documentation with full API reference and features
- Add all 20 API endpoints organized by category
- Document SSE event catalog with 21 event types
- Add session modes documentation (one-shot vs interactive)
- Add RalphLoop component description
- Expand README features section with respawn controller docs
- Add respawn controller configuration examples
- Update session log

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 07:38:19 +01:00
arkonandClaude Opus 4.5 675893111b feat: add RespawnController for automatic Claude Code session respawning
Implements an autonomous respawn loop that keeps Claude Code productive:
- Detects idle state by monitoring PTY for prompt character + timeout
- Sends configurable update prompt when idle (default: "update all the docs and CLAUDE.md")
- Executes /clear and /init to reset session
- Cycles automatically

New features:
- RespawnController class with state machine (watching → update → clear → init)
- REST API endpoints for respawn control (/api/sessions/:id/respawn/*)
- Web UI controls: toggle, prompt config, idle timeout settings
- SSE events for real-time respawn status updates
- Full CLAUDE.md template with Ralph Loop instructions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 07:31:19 +01:00
arkonandClaude Opus 4.5 46f97becc9 docs: update CLAUDE.md with project documentation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 05:17:06 +01:00
arkonandClaude Opus 4.5 c4aae98a01 feat: add web interface with real-time streaming and timed runs
- Add Fastify-based web server with SSE for real-time updates
- Create responsive dark-themed UI with:
  - Prompt input with directory and duration options
  - Live countdown timer for timed runs
  - Real-time output streaming
  - Collapsible sessions panel
  - Cost and task tracking
- Support timed runs that repeat prompts for specified duration
- Add /api endpoints for sessions, scheduled runs, and status
- Update Session class to parse Claude CLI JSON output
- Add 'claudeman web' command to start the interface

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 05:14:34 +01:00
arkonandClaude Opus 4.5 e1bb800473 feat: implement Claudeman - Claude session manager with Ralph Loop
Claudeman manages multiple Claude CLI sessions as subprocesses with:
- Session management (start/stop/list/logs)
- Priority-based task queue with dependency support
- Ralph Loop for autonomous task assignment and completion detection
- Time-aware loops for extended work sessions
- JSON file persistence to ~/.claudeman/state.json

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 04:50:46 +01:00