- task.ts: Cache completion phrase regex in constructor instead of
re-creating on every checkCompletion() call. Add escapeRegex helper
for safe RegExp construction from user-provided phrases.
- ralph-tracker.ts: Remove commented-out COMPLETION_SIGNAL_PATTERN
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The hook commands now read stdin JSON from Claude Code (contains tool_name,
tool_input, etc.) and forward it as the data field to the API. This enables
richer notifications showing actual context (e.g., "Bash: docker push prod").
Previously the curl commands only sent event type and session ID, losing
all hook context data.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Three improvements to prevent the respawn controller from sending update
prompts while Claude is still working:
1. Tighten COMPLETION_TIME_PATTERN to require "Worked for" prefix, avoiding
false positives from bare time durations in regular text (e.g., "wait for 5s")
2. Increase completionConfirmMs default from 5s to 10s - Claude regularly
pauses 5-8s between tool calls and during thinking
3. Cancel confirming_idle state when substantial output arrives (stripped of
ANSI codes), instead of passively relying on the timer to self-restart
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The server was dropping the `data` field from hook-event POST requests,
so notifications always showed generic messages. Now forwards tool name,
command, question text, and reason to the frontend.
Notifications now show:
- permission_prompt: "Bash: docker push prod:latest"
- elicitation_dialog: "Merge PR #42 to main?"
- idle_prompt: custom message if provided
- stop: reason if provided
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add scripts/claudeman-web.service: respawning systemd user service
for `claudeman web --https` (Restart=always, RestartSec=5)
- Slow tab blink animations: red 1s→2.5s, yellow 1.5s→3.5s
with ease-in-out and reduced opacity for less aggressive feel
Install: symlink to ~/.config/systemd/user/, enable, start
Linger: loginctl enable-linger keeps it running after logout
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Red blink for action-required events (permission_prompt, elicitation_dialog)
- Yellow blink for idle sessions (idle_prompt)
- Alert clears when user clicks the tab or session starts working again
- Only blinks non-active tabs (active tab is already visible)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Three issues fixed:
- Default browserNotifications to true (was false, never fired)
- Remove tab-visibility gate for critical/warning notifications
(monitoring dashboard should alert regardless of tab focus)
- Auto-request Notification permission on first attempt instead of
silently failing (re-sends the notification after permission granted)
- Migrate existing localStorage prefs from v1 default (false → true)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
switchToSession didn't exist - was calling a nonexistent method.
Changed to selectSession which actually switches the active tab and
loads the terminal buffer. Also enhanced browser push notifications
to navigate to the session when clicked (previously only focused window).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add hook:elicitation_dialog SSE handler in frontend (critical urgency)
- Add Desktop Notifications section to README with hook event table
- Add hooks API endpoint to README API reference
- Update CLAUDE.md SSE events and API routes for elicitation_dialog
- Add session log entry for hooks feature
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The auto-accept feature was too aggressive - it would press Enter for any
silence without a completion message, including AskUserQuestion prompts.
Now uses the elicitation_dialog notification hook to detect when Claude is
asking a question, and blocks auto-accept in that case. Only plan mode
approvals (silence with no completion message AND no elicitation signal)
trigger auto-accept.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Wire Claude Code's official hooks system (Notification, Stop) to POST
back to Claudeman's new /api/hook-event endpoint, which broadcasts SSE
events consumed by the existing NotificationManager for desktop alerts.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Notification prefs are now included in the PUT /api/settings payload
and stored in ~/.claudeman/settings.json. On page load, server-stored
prefs are loaded as fallback when localStorage is empty (e.g. new
browser or cleared cache).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Also closes the notification drawer if it was open when the user
disables notifications in settings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Enables the Web Notifications API when accessing via SSH tunnel or
non-localhost URLs. Self-signed cert is auto-generated with openssl
and stored in ~/.claudeman/certs/ for reuse across restarts.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Integration tests create screen sessions via the web server, but
server.stop() intentionally preserves them (for reattachment in
production). This left 30+ detached screens after each test run.
Fix by recording pre-existing screens in beforeAll, then killing any
new detached claudeman-* screens in afterAll that weren't there at
test start. Never kills attached sessions (user's active work).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
After loading the terminal buffer on tab switch, xterm.js wasn't
guaranteed to be scrolled to the bottom, requiring users to manually
scroll down. Fix by:
1. Adding scrollToBottom() after chunkedTerminalWrite completes
2. Adding scrollToBottom() after terminal.focus()
3. Delaying chunkedTerminalWrite resolution by one extra rAF to ensure
xterm.js has finished rendering the final chunk
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Instead of parsing terminal output for <spawn1337> tags, spawn capabilities
are now exposed as native MCP tools that Claude Code can call directly.
The MCP server (stdio transport) proxies requests to the existing REST API.
- Add src/mcp-server.ts with 6 tools: spawn_agent, list_agents,
get_agent_status, get_agent_result, send_agent_message, cancel_agent
- Remove src/spawn-detector.ts and all references in session.ts/server.ts
- Add CLAUDEMAN_API_URL env var propagation to sessions and screens
- Write .mcp.json to case directories during creation
- Remove spawn1337 tag documentation from case-template.md
- Add claudeman-mcp bin entry to package.json
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
New sessions had no awareness of the spawn1337 agent protocol because
the case-template.md (copied as CLAUDE.md into every new case) was
missing the documentation. Added full spawn protocol reference including
tag syntax, task spec format, monitoring commands, and resource limits.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The w1/w2/s1/s2 session counter was scanning all sessions regardless
of case name, causing cross-case number inflation. Now only counts
sessions belonging to the same case when determining the next number.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Ralph tracker no longer auto-enables on pattern detection. It must be
explicitly enabled per-session (via API) or globally via the new
`ralphEnabled` AppConfig setting. Adds GET/PUT /api/config endpoints
for runtime configuration. Spawn agent ralph enable is unchanged.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add chmod +x after tsc compilation to prevent "Permission denied" errors
when running claudeman via npm link symlink.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- README: add spawn1337 section, update architecture diagram with
orchestrator/detector, add spawn API endpoints, update test badge
(1426 total)
- ralph-wiggum-guide: add spawn-related files to references
- All docs: update Last Updated dates to 2026-01-23
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When Claude enters plan mode or asks a question (AskUserQuestion), output
stops without a completion message. The new autoAcceptPrompts feature
detects this state and sends Enter after a configurable delay (default 8s)
to accept the plan or select the default option, keeping Claude working
autonomously.
Enabled by default. Adds UI checkbox in the respawn config panel.
Safety: only fires once per silence period, requires prior output,
and won't fire during active respawn cycles.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Moves case directory cleanup from afterAll to afterEach in all test
files that create cases. Previously, if the test suite was interrupted
or afterAll timed out, all case directories were left behind. Now each
test cleans up immediately after itself.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replaces the ~400-line inline template string in claude-md.ts with a
file read from src/templates/case-template.md. Removes the hardcoded
/home/arkon/default/CLAUDE.md path from server.ts. The build script
now copies the template to dist/templates/ for production use.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add native checkbox (☐/◐/☒) and Claude Code checkmark-based
(✔ Task #N) formats to CLAUDE.md and ralph-wiggum-guide.md,
matching the recently added detection code.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The RalphTracker now recognizes Format 5 - the checkmark-based output
that Claude Code's TodoWrite tool produces:
- "✔ Task #N created: <content>" → creates todo
- "✔ #N <content>" → registers task summary
- "✔ Task #N updated: status → in progress/completed" → updates status
Previously only detected markdown checkboxes, icon indicators, and
native ☐/☒/◐ format, missing the primary output format used by
Claude Code CLI sessions.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- CLAUDE.md: Add step confirmation behavior, respawnEnabled field, recovery
strategy with dual redundancy, updated state lifecycle
- README.md: Multi-layer idle detection, step confirmation, state persistence
in performance table, updated architecture diagram with State Store
- docs/: Updated last-modified dates to 2026-01-22
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
state.json is now the primary source for session recovery, but
screens.json is used as a fallback for respawn config since it was
the proven working path before. This provides double-redundancy:
both files would need to be lost for respawn state to disappear.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
cleanupSession() always called store.removeSession() which deleted the
session from state.json. On server stop, cleanupSession(id, false) was
called for all sessions - preserving screens but deleting their saved
state. On next restart, state.json was empty so nothing was restored.
Now only removes from state.json when killScreen=true (user explicitly
deleting a session), preserving state for recovery on restart.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
All session settings (auto-compact, auto-clear, ralph, respawn) are now
restored from state.json on server restart. Previously settings were
split across state.json, screens.json, and state-inner.json which was
fragile. state-inner.json is kept as a fallback for ralph state only.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
persistSessionState was called before the respawn controller was restored,
so respawnEnabled was always saved as false during recovery. Moved the
persist call to after all restorations (auto-compact, auto-clear, ralph,
respawn) are applied.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Session recovery from screens created fresh Session objects with default
values, losing the auto-compact and auto-clear settings that were saved
to state.json. Now reads them back during recovery.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The modal was reading from non-existent nested paths (session.autoClear?.autoCompact?)
instead of the flat properties from toState() (session.autoCompactEnabled, etc.).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The respawn controller's enabled/disabled state was not being saved,
so CLI status couldn't show whether respawn was active.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add GET /api/sessions/:id/respawn/config endpoint for reading saved config
- PUT /api/sessions/:id/respawn/config now works without running controller
(saves pre-config to screens.json for when respawn starts)
- Respawn start/enable merges pre-saved config from screens.json
- Frontend auto-saves respawn config, auto-compact, auto-clear on field change
- Frontend loads saved config when opening session options modal
- Updated CLAUDE.md with state persistence docs, new API endpoint,
SessionState fields table, state lifecycle, and session setting guide
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The web server now persists all per-session settings (name, mode,
auto-compact, auto-clear, respawn config, ralph state, tokens, cost)
to state.json so the CLI status/session commands can display them.
Also removes unused pendingStepConfirm property from respawn controller.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add step confirmation timer for waiting_update, waiting_init, waiting_kickstart states
- After detecting completion in waiting states, wait for completionConfirmMs silence
- Prevents sending next command before Claude finishes processing current one
- Cancel step confirmation when working patterns detected
- Update CLAUDE.md with step confirmation documentation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update idle detection from legacy '↵ send' to completion message pattern
("for Xm Xs" time patterns like "Worked for 2m 46s")
- Add confirming_idle state for false positive prevention
- Add completionConfirmMs (5s) and noOutputTimeoutMs (30s) config options
- Add multi-layer detection with confidence scoring (0-100%)
- Fix null pointer error in extractTokenCount with guard clause
- Fix respawn controller not stopping on session cleanup (broadcast respawn:stopped)
- Update tests to use new completion message patterns
- Add detection status UI display (confidence level, waiting state)
- Update CLAUDE.md with new detection documentation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add test/setup.ts with max 10 concurrent screen sessions limiter
- Add orphaned Claude/screen process cleanup before/after tests
- Add semaphore-based screen slot acquisition for concurrency control
- Update vitest.config.ts with setupFiles and fileParallelism: false
- Add 16 new test files for comprehensive coverage
- Update README badge to show 1337 total tests
- Update CLAUDE.md with test setup documentation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>