Commit Graph
57 Commits
Author SHA1 Message Date
arkonandClaude Opus 4.5 0d1ca37b6e refactor: rename inner-loop-tracker to ralph-tracker with API improvements
- Rename inner-loop-tracker.ts → ralph-tracker.ts throughout codebase
- Add ralph-config.ts for parsing .claude/ralph-loop.local.md config
- Standardize API error responses using createErrorResponse()
- Add input validation for auto-compact/auto-clear thresholds
- Update UI labels to "Ralph / Todo Tracker" consistently
- Add 46 integration tests for Ralph tracking functionality
- Update test badge to 438 total tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 22:36:45 +01:00
arkonandClaude Opus 4.5 403c7e77fb feat: auto-detect completion phrase from CLAUDE.md
- Extract <promise>PHRASE</promise> from CLAUDE.md on session start
- Configure inner loop tracker before first broadcast so UI shows phrase immediately
- More lenient bare phrase detection (triggers when loop is active)
- Auto-detect on session restoration from screens
- Add logging for auto-detection debugging

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 19:49:44 +01:00
arkonandClaude Opus 4.5 72ec288226 docs: remove internal references from CLAUDE.md for publishing
Remove E2E Testing and Optimization Status sections that reference
internal .claude/ files not intended for public distribution.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 15:17:37 +01:00
arkonandClaude Opus 4.5 e8c30b9880 fix(tui): resolve screen attach ambiguity with multiple sessions
- Add getFullScreenId() to get PID.screenName format for unambiguous attach
- Update DirectAttach.ts and index.tsx to use full screen IDs
- Remove TUI documentation from README (still in development)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 12:52:38 +01:00
arkonandClaude Opus 4.5 d5ae376e07 feat(tui): add web server auto-start, shell mode, and feature parity
TUI now checks if web server is running on startup and offers to start
it in the background. Added new CLI options: --with-web (auto-start),
--no-web (skip check), -p (port).

TUI feature parity with web interface:
- Shell mode: press 'h' in cases view to start bash instead of Claude
- Multi-start: press 'm' to start 1-20 sessions at once
- Respawn toggle: Ctrl+R to enable/disable respawn on Claude sessions
- Session rename: API support via useSessionManager hook

Security fixes from previous analysis:
- Command injection prevention in screen-manager.ts
- Path traversal protection in server.ts
- Input validation for shell-interpolated values

Also fixes memory leak in session.ts (timer tracking) and flaky test
timeout in session-cleanup.test.ts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 09:54:42 +01:00
arkonandClaude Opus 4.5 d4d36c9d57 docs: update test count to 355, minor CLAUDE.md improvements
- Update README badge from 339 to 355 passing tests
- Add templates to unit test list in test port allocation
- Update typecheck command to use npm script
- Add TUI components to key files table

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 08:35:49 +01:00
arkonandClaude Opus 4.5 1cddc3345f docs: update test count to 339
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 07:38:31 +01:00
arkonandClaude Opus 4.5 3e2695edb5 docs: update test count to 329
- Update README test badge
- Add state-store to CLAUDE.md unit test list

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 07:34:01 +01:00
arkonandClaude Opus 4.5 b662ad17b1 docs: update test documentation
- Update README test badge to 302 passing
- Add session-manager to CLAUDE.md unit test list

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 07:31:14 +01:00
arkonandClaude Opus 4.5 ce40f8a712 docs: update test documentation and badge
- Update README test badge to 273 passing (from 195)
- Add new unit test files to CLAUDE.md test list
  - task-queue.ts, task.ts, ralph-loop.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 07:25:41 +01:00
arkonandClaude Opus 4.5 f6819729aa feat(tui): add real-time terminal output polling
- Poll screen hardcopy every 500ms for live output
- Clean up temp files after reading
- Update CLAUDE.md with TUI documentation
- Add TUI command examples to Commands section

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 06:21:25 +01:00
arkonandClaude Opus 4.5 b3dd0bcacb docs: update CLAUDE.md with optimization status
- Add new timing constants for debouncing (state updates, render panels, input)
- Update Optimization Roadmap to Optimization Status section
- Document all completed optimizations with implementation details
- List remaining low-priority optimizations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 06:16:31 +01:00
arkonandClaude Opus 4.5 294ca4fdf8 docs: add critical screen session safety warning to CLAUDE.md
Prevent Claude instances from accidentally killing their own screen
session by adding prominent warning at top of file. Also documents
CLAUDEMAN_SCREEN environment variable and safe debugging practices.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 04:44:19 +01:00
arkonandClaude Opus 4.5 3a44cfda32 feat: add interactive screen session manager CLI tool
- New scripts/screen-manager.sh for managing claudeman screen sessions
- Interactive TUI with arrow key navigation (flicker-free)
- Commands: list, attach, kill, kill-all, info
- Reads from ~/.claudeman/screens.json (claudeman's authoritative source)
- Shows session name, running time, alive/dead status, mode
- Requires jq and screen packages
- Updated CLAUDE.md and README.md with documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 04:27:09 +01:00
arkonandClaude Opus 4.5 6fddd7d895 docs: add npm run web shorthand and additional timing constants
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>
2026-01-20 19:43:29 +01:00
arkonandClaude Opus 4.5 482394e280 docs: update completion detection documentation
- Update "All complete" detection behavior in CLAUDE.md and ralph-wiggum-guide.md
- Add UI Behaviors section documenting auto-focus, scroll preservation, consistent icons

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 17:43:36 +01:00
arkonandClaude Opus 4.5 47877f00d0 docs: add comprehensive Ralph Wiggum and hooks documentation
- 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>
2026-01-20 08:56:15 +01:00
arkonandClaude Opus 4.5 be414f2126 docs: document session input methods and CLI commands
- 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>
2026-01-20 08:40:14 +01:00
arkonandClaude Opus 4.5 b230785909 docs: add missing respawn config PUT endpoint to API table
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 07:48:04 +01:00
arkonandClaude Opus 4.5 3082332bc9 docs: update CLAUDE.md with accurate test port ranges
- 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>
2026-01-19 19:56:37 +01:00
arkonandClaude Opus 4.5 2c38f7924a feat(tracker): disable Ralph Wiggum tracker by default, auto-enable on detection
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>
2026-01-19 18:34:43 +01:00
arkonandClaude Opus 4.5 13ff22f813 docs: update CLAUDE.md with test ports and missing API routes
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>
2026-01-19 18:04:50 +01:00
arkonandClaude Opus 4.5 1ffefa41aa docs: add test files, session modes, and prominent dev gotcha
- 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>
2026-01-19 16:45:32 +01:00
arkonandClaude Opus 4.5 448e975dc1 docs: add Screen Input for Ink/Claude CLI pattern
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>
2026-01-19 16:35:20 +01:00
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 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 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 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 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 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 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 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 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 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 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 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 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 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 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