Document the npm run web script as a shorthand for running the web
server after build. Also add output batch and task update batch
interval constants to the timing table.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Screen attach outputs blank lines that appeared above Claude's banner.
Added flag to strip leading newlines from PTY data after buffer clear.
Only affects Claude sessions (not shell), matching the reported behavior.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The toggle icon was confusing because CSS rotation (90deg when expanded)
combined with JS icon swapping caused left arrow → right arrow transitions.
Changes:
- Remove CSS rotation transform from .ralph-toggle
- Use consistent down/up arrows matching Monitor panel convention
- Collapsed: ▼ (down) - click to expand
- Expanded: ▲ (up) - click to collapse
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Reduced font size from 0.55rem to 0.45rem to fit in mini ring
- Added gradient text effect matching the progress ring colors
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Tabs now size to fit content (removed max-width)
- Close/gear icons hidden by default, appear on hover (with width transition)
- Tabs wrap to new row when container is full
- Ralph progress ring enlarged to 75px for better percentage display
- Tighter spacing in Ralph meta section
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Horizontal layout: ring | meta | tasks in one row
- Smaller progress ring (60px)
- Tasks displayed inline with wrap
- Removed Iterations counter from summary and detail
- Reduced overall panel height
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add close button (×) to Ralph Wiggum tracker panel
- Add close button (×) to Monitor panel
- Add "Show Monitor Panel" toggle in app settings (default: on)
- closeRalphTracker() disables tracker and hides panel
- closeMonitor() hides panel and saves setting
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use same detach icon (⧉) for Ralph panel as Monitor panel
- Auto-focus on single session tab when only one session exists
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Save xterm viewport scroll position before toggle
- Restore scroll position after panel expand/collapse
- Refit terminal to new container size after layout change
- Add overflow-anchor: none to prevent browser scroll anchoring
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add ALL_COMPLETE_PATTERN to detect "All 8 files created" messages
- Add ALL_COUNT_PATTERN to extract count from completion messages
- Update detectAllTasksComplete to mark all todos as complete
- Update handleBareCompletionPhrase to mark todos complete
- Update handleCompletionPhrase to mark todos complete on 2nd occurrence
- Track bare phrase occurrences to avoid double-firing
This fixes an issue where the tracker would detect todos but not
mark them as complete when Claude outputs "All X files/tasks completed"
instead of individually checking off each todo.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previously the Ralph tracker showed "Complete" whenever a completion phrase
was detected, even if tasks were still pending. Now it only shows "Complete"
when all todos are actually marked completed (100%).
Shows "Tracking" when:
- Tracker is enabled with pending tasks
- Completion phrase detected but tasks remain
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove the large "done" animation that appeared when Ralph loops completed.
The completion state is now simply reflected in the tracker panel without
the intrusive overlay.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Performance improvements:
- Throttle cleanupExpiredTodos() to run every 30s instead of every chunk
- Add early exit in detectTodoItems() for lines without todo markers
- Remove redundant PROMISE_PATTERN check from LOOP_START_PATTERN
Code quality:
- Extract activateLoopIfNeeded() helper to eliminate duplicate loop start logic
- Improve hash function using djb2 algorithm for better distribution
- Add guards for empty/whitespace-only content in upsertTodo()
- Simplify startLoop() to use existing enable() method
Tests:
- Add 5 new tests for edge cases and optimizations
- Test empty content handling, early exit, ID uniqueness
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add TODO_NATIVE_PATTERN to match ☐/☒/◐ icons from Claude Code's TodoWrite
- Add TODO_EXCLUDE_PATTERNS to filter out tool invocations (Bash, Search, etc.)
- Update iconToStatus() to recognize ☒ as completed
- Add tests for native checkbox detection
The tracker now correctly parses Claude Code's actual terminal output format
instead of only matching markdown checkboxes.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create docs/ralph-wiggum-guide.md with official plugin reference,
best practices, prompt templates, and troubleshooting
- Create docs/claude-code-hooks-reference.md with all hook events,
configuration options, and examples from official docs
- Update CLAUDE.md with documentation section and quick reference
- Add missing key files (task-tracker.ts, state-store.ts) to architecture table
- Add unit test note to test port allocation section
Sources: Official Anthropic plugin, code.claude.com, community resources
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add detailed documentation for session.write() vs session.writeViaScreen()
- Explain how writeViaScreen auto-splits text and Enter for Ink compatibility
- Add API usage examples showing text and Enter sent separately
- Add CLI commands quick reference section
- Clarify vitest globals: true config and PTY mocking in tests
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The tracker was incorrectly marking Ralph loops as complete when the
completion phrase appeared in the prompt text itself (e.g., when user
types the /ralph-loop command with the completion phrase in quotes).
Now it only marks completion when the loop is already active, and
records the expected phrase without triggering completion otherwise.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When the global "Enable Ralph Wiggum Tracker" setting was enabled,
new sessions had the tracker enabled on the server but the panel
wasn't rendered. The inner-config API call happened before
activeSessionId was set, so updateInnerState() didn't trigger
renderInnerStatePanel(). Added explicit call after setting activeSessionId.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Restore inner loop tracker state (enabled flag, todos, loop state) when
sessions are restored from screen sessions after server restart.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix test port range from 3101-3108 to 3099-3121
- Add port numbers to individual test file descriptions
- Clarify unit tests vs integration tests
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Pass existing screenSession to Session constructor for restored sessions
- Skip terminal buffer clearing when attaching to restored (existing) screens
- Frontend auto-calls /interactive endpoint when selecting a restored session
- Fixes issue where restored sessions appeared broken after server restart
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change toggle icon to show ▲ when closed, ▼ when open
- Update detach/attach icons: ⧉ (detach) and ⊞ (attach)
- Adjust panel width to 380px
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove auto-open of monitor panel on startup
- Reduce monitor panel width from 500px to 320px
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add visibility toggles in App Settings modal for A-/A+, CPU/MEM, and token count
- Make settings gear icon larger (32px) for better accessibility
- Apply settings on startup and immediately when saved
- All options enabled by default, persisted to localStorage
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add ability to enable/disable the Ralph tracker:
- Per-session toggle in Session Options > Ralph Wiggum tab
- Global default toggle in App Settings
Changes:
- Add "Enable Tracker" toggle to ralph-tab in session options modal
- Add "Enable Ralph Wiggum Tracker" toggle to app settings modal
- Update /api/sessions/:id/inner-config endpoint to handle `enabled` param
- Add CSS for toggle switch component
- New sessions inherit global setting from app settings
- Setting is saved in innerConfig and synced with backend
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add ability to detach the Ralph Wiggum tracker panel as a floating
window that can be dragged around the screen.
Changes:
- Add detach button to the Ralph panel header
- Restructure HTML to separate clickable content from controls
- Add CSS styles for detached state (floating, draggable, resizable)
- Add toggleRalphDetach() and setupRalphDrag() JavaScript methods
- Panel auto-expands when detached for better visibility
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The InnerLoopTracker is now disabled by default and auto-enables when
Ralph-related patterns are detected:
- /ralph-loop command
- <promise>PHRASE</promise> completion phrases
- TodoWrite tool usage
- Iteration patterns (Iteration 5/50, [5/50])
- Todo checkboxes (- [ ]/- [x]) or indicator icons
This reduces noise for sessions that don't use Ralph loops while
maintaining full functionality when loops are detected.
Changes:
- Add `enabled` property to InnerLoopState type
- Add enable()/disable() methods to InnerLoopTracker
- Implement shouldAutoEnable() for pattern detection
- Update frontend to show "Tracking" status when enabled
- Add CSS for tracking state indicator
- Update CLAUDE.md documentation
- Add comprehensive tests for auto-enable behavior
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add cache-busting to /api/cases fetch to prevent stale data
- Use created case path from API response (was using old empty caseData)
- Add selectCaseName parameter to loadQuickStartCases for post-create selection
- Add toast() alias for showToast() to fix "toast is not a function" error
- Prevent duplicate event listeners on case dropdown
- Show "(will be created)" hint when no cases exist
- Add Ralph Wiggum config tab to session options modal
- Add inner-config API endpoint for Ralph loop settings
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add vitest port range note (3101-3108), shell mode PTY example, and
5 missing API endpoints (respawn/enable, inner-config, inner-state,
auto-compact, auto-clear).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add deduplication guard to prevent spamming the same completion toast.
Uses a Set to track shown completions per session, with 30s expiry to
allow re-notification if loop restarts.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Expand ANSI regex to match all escape sequences (cursor movement,
color codes, etc.) not just color codes. This fixes todo content
having residual escape sequences like cursor movements.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add polished, animated Ralph Wiggum Loop panel with:
- Circular progress ring showing task completion percentage
- Task cards with status indicators (pending/in-progress/completed)
- Animated status badge with pulsing indicator when active
- Completion celebration animation with animated checkmark
- Smart time formatting ("1h 23m" instead of "1.38 hours")
Enhanced detection patterns based on official Ralph plugin:
- /ralph-loop command detection
- Iteration patterns: "Iteration 5/50", "[5/50]"
- Max iterations from YAML: "max-iterations: 50"
- TodoWrite tool output detection
Adds maxIterations field to InnerLoopState for tracking loop limits.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Move npm run dev gotcha outside code block for visibility
- Add test/ directory with descriptions for each test file
- Document SessionMode type ('claude' vs 'shell')
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Auto-compact now uses writeViaScreen with \r
- Auto-clear now uses writeViaScreen with \r
- Standardized respawn controller to use \r consistently
- Removed session name input from options modal (use right-click to rename)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document the critical finding that text and Enter key must be sent
as separate screen -X stuff commands for Ink to process correctly.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Claude CLI (Ink) doesn't process carriage return correctly when sent
together with text via screen -X stuff. Splitting into two separate
commands works reliably:
1. screen -X stuff "text"
2. screen -X stuff "$(printf '\015')"
Also adds writeViaScreen() method to Session for programmatic input
that bypasses PTY and uses screen -X stuff directly.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The bash $'...' escaping wasn't reliably sending carriage return to
Ink/Claude CLI. Using printf with octal '\015' works correctly.
Tested: screen -X stuff "$(printf 'text\015')" successfully triggers
Enter key submission in Claude CLI.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Regular user input should go through PTY, only respawn controller
should use screen -X stuff. Added writeViaScreen() method for
programmatic input that needs reliable Enter key delivery.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When writing to an attached PTY connected to screen, the input doesn't
reliably reach Claude CLI. This fix uses `screen -X stuff` command to
send input directly to the screen session, bypassing the PTY attachment.
Research findings:
- Claude CLI uses Ink (React for CLI) for terminal UI
- Ink's parseKeypress detects \r as key.return (Enter)
- screen -X stuff with $'...' syntax reliably sends literal characters
Changes:
- Add ScreenManager.sendInput() using screen -X stuff
- Modify Session.write() to prefer screen -X stuff when available
- Keep \r as Enter key (what Ink expects for key.return)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Screen sessions require \n (line feed) for Enter key input, not \r
(carriage return). This fixes the issue where respawn prompts would
appear in the terminal but not be submitted.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changed all command writes from \n (newline) to \r (carriage return).
PTY terminals expect \r for Enter key, \n only creates a new line
without executing the command.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The respawn controller was calling removeAllListeners('terminal')
which also removed the server's listener that streams output to
the browser. This made the console appear "blocked" when respawn
was enabled.
Now properly tracks and removes only its own listener.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Shortens the session options modal by putting the name input
and action buttons on the same row at the top.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
process.env.HOME and process.cwd() don't exist in browsers.
Replaced with proper error handling when case path is missing.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>