mode
Flagged{"isSafe":false,"isSuspicious":true,"riskLevel":"high","findings":[{"category":"system_harm","severity":"high","description":"Unattended mode intercepts and denies Stop events unconditionally, potentially bypassing admin safety/shutdown controls and enabling persistence beyond intended supervision.","evidence":"Blocks Stop events unconditionally to keep Claude working; interceptor runs before the handler chain on every event; Stop events are DENY'ed."},{"category":"prompt_injection","severity":"medium","description":"Custom messages appended to the block reason could influence the agent's behavior when it encounters a stop denial, enabling prompt-injection-like guidance.","evidence":"Custom Messages: 'When switching to unattended mode, you can include a custom message that gets appended to the block reason' and 'The message appears in the Stop event denial reason, so Claude sees it when it tries to stop.'"},{"category":"shell_command","severity":"low","description":"Use of conventional shell commands for mode management (e.g., /mode, test -f checks) is standard, but the functionality itself poses risk if misused (unattended mode).","evidence":"Usage examples show '/mode get', '/mode unattended', '/mode default'; shell conditionals detect Python path."}],"summary":"The skill introduces an unattended mode that denies Stop events, reducing administrative control and potentially enabling misuse or persistence. While based on conventional shell/IPC patterns, this capability can undermine safety boundaries and could be exploited via crafted custom messages. Recommend safeguards: strict access control, audit logging, time-limited or reversible unattended mode, explicit admin confirmation, and ensuring denial messages cannot be exploited as prompts."}
npx machina-cli add skill Edmonds-Commerce-Limited/claude-code-hooks-daemon/mode --openclaw/mode - Daemon Mode Management
Description
View or change the daemon's operating mode. Supports default (normal operation) and unattended (blocks Stop events to keep Claude working autonomously).
Usage
# Show current mode
/mode
/mode get
# Switch to unattended mode (blocks Stop events)
/mode unattended
# Switch to unattended with custom task message
/mode unattended finish the release and run all tests
# Switch back to default mode
/mode default
Modes
| Mode | Behavior |
|---|---|
default | Normal operation - all handlers process events as configured |
unattended | Blocks Stop events unconditionally to keep Claude working without interruption |
What Unattended Mode Does
When enabled, a mode interceptor runs before the handler chain on every event:
- Stop events: Blocked with a DENY response instructing Claude to continue working
- SubagentStop events: NOT blocked (subagents should stop normally)
- All other events: Pass through to normal handler chain unchanged
The interceptor includes re-entry protection (checks stop_hook_active flag) to prevent infinite loops.
Custom Messages
When switching to unattended mode, you can include a custom message that gets appended to the block reason. This lets you give Claude specific instructions about what to work on:
/mode unattended complete all remaining tasks in the plan
The message appears in the Stop event denial reason, so Claude sees it when it tries to stop.
Python Path Detection
The skill detects the correct Python path automatically:
if [ -f "/workspace/untracked/venv/bin/python" ]; then
PYTHON="/workspace/untracked/venv/bin/python"
elif [ -f ".claude/hooks-daemon/untracked/venv/bin/python" ]; then
PYTHON=".claude/hooks-daemon/untracked/venv/bin/python"
fi
IPC Protocol
The skill communicates with the daemon via Unix socket system requests:
Get mode:
{"event": "_system", "hook_input": {"action": "get_mode"}}
Set mode:
{"event": "_system", "hook_input": {"action": "set_mode", "mode": "unattended", "custom_message": "optional"}}
Output
On get mode:
Mode: default
On set unattended:
Mode: unattended (changed)
Message: finish the release
On set default:
Mode: default (changed)
Requirements
- Daemon must be running
- Python venv must be available (self-install or normal install)
Version
Introduced in: v2.17.0
Source
git clone https://github.com/Edmonds-Commerce-Limited/claude-code-hooks-daemon/blob/main/.claude/skills/mode/SKILL.mdView on GitHub Overview
View or change the daemon's operating mode, switching between default (normal operation) and unattended (blocks Stop events to keep Claude working autonomously). This gives you control over how Claude responds during maintenance or automated tasks.
How This Skill Works
The skill communicates via a daemon IPC interface to get or set the mode. In unattended mode, a mode interceptor runs before the handler chain to block Stop events with a DENY response, while SubagentStop events are allowed. It includes re-entry protection using a stop_hook_active flag to prevent loops; a custom_message can be appended to the denial when switching modes.
When to Use It
- During long-running maintenance tasks to prevent Claude from stopping
- When you need uninterrupted Claude operation during automated releases
- While debugging or testing event handling and denial flows
- When working with subagents that should stop normally but main agent should stay active
- Before a planned mode change, to ensure current mode is known via /mode get
Quick Start
- Step 1: Show current mode with /mode or /mode get
- Step 2: Switch to unattended with /mode unattended
- Step 3: Return to default with /mode default
Best Practices
- Test in a staging environment before enabling unattended
- Always verify current mode with /mode get before making changes
- Include a clear custom_message to guide Claude on tasks
- Maintain a running daemon with a valid Python venv
- Use re-entry protection to avoid infinite loops in mode switching
Example Use Cases
- Show current mode using /mode or /mode get
- Switch to unattended with /mode unattended
- Set unattended with a custom message, e.g. /mode unattended finish the release and run all tests
- Switch back to default with /mode default
- Custom message appears in the Stop denial when unattended is active