By yihan2099
Turn a persistent Claude Code session into a 24/7 daemon with task queue. Iterates on tasks ralph-loop style, processes a queue, and idles when empty. Perfect for tmux sessions.
A Claude Code plugin that turns a persistent session into a 24/7 daemon. It iterates on tasks (ralph-loop style), processes a task queue, and idles when there's nothing to do.
Run Claude in tmux, SSH in to give commands, or remotely append tasks to a queue file.
/daemon-start "task" --project PATH
|
v
[Claude works on task iteratively]
|
v (outputs <promise>TASK_COMPLETE</promise>)
|
v
[Check queue.jsonl]
|
+---> Next task found → start it
|
+---> Queue empty → idle at prompt (no tokens burned)
The core mechanism is a stop hook: when Claude finishes a turn and tries to exit, the hook intercepts and either re-feeds the prompt (iterate), picks up the next queued task, or allows exit (idle).
# Clone into Claude Code's local plugin marketplace
mkdir -p ~/.claude/plugins/marketplaces/local/plugins
git clone https://github.com/yihan2099/claude-daemon.git \
~/.claude/plugins/marketplaces/local/plugins/daemon
# Enable the plugin in settings
# Add to ~/.claude/settings.json under "enabledPlugins":
# "daemon@local": true
git clone https://github.com/yihan2099/claude-daemon.git ~/dev/claude-daemon
ln -s ~/dev/claude-daemon \
~/.claude/plugins/marketplaces/local/plugins/daemon
# Enable in settings as above
Then restart Claude Code to pick up the plugin.
/daemon-start "improve test coverage to 80%" --project ~/dev/myapp --max-iterations 30
Claude works iteratively. When done, it outputs <promise>TASK_COMPLETE</promise>, the daemon logs the completed task and picks up the next one from the queue.
From within Claude:
/daemon-queue "fix all eslint errors" --project ~/dev/myapp
Or remotely via SSH (append JSON to the queue file):
echo '{"task":"add rate limiting","project":"/Users/you/dev/myapp"}' \
>> ~/.claude/daemon/queue.jsonl
/daemon-status
Shows: active task, iteration count, queue contents, completed task history.
/daemon-stop
Removes state and returns to the interactive prompt.
# Start a persistent session
tmux new -s claude-daemon
cd ~/dev
claude
# Give it work
/daemon-start "refactor auth module" --project ~/dev/myapp
# Detach: Ctrl-B, D
# Claude keeps working
# Later, SSH in and add more tasks
ssh mybox
echo '{"task":"fix CI","project":"/Users/me/dev/myapp"}' >> ~/.claude/daemon/queue.jsonl
# Or attach and interact directly
tmux attach -t claude-daemon
| Command | Description |
|---|---|
/daemon-start "task" --project PATH | Start working on a task |
/daemon-stop | Stop the active daemon |
/daemon-status | Show status, queue, and history |
/daemon-queue "task" --project PATH | Add a task to the queue |
--project PATH (required) — project directory to cd into--max-iterations N (default: 30) — max iterations per taskRuntime state lives at ~/.claude/daemon/:
~/.claude/daemon/
state.json # Current active task
queue.jsonl # Pending tasks (one JSON object per line)
history.jsonl # Completed tasks log
queue.jsonl is append-only, making it safe to write to remotely.
.claude-plugin/
plugin.json # Plugin metadata
commands/
daemon-start.md # /daemon-start command
daemon-stop.md # /daemon-stop command
daemon-status.md # /daemon-status command
daemon-queue.md # /daemon-queue command
hooks/
hooks.json # Stop hook registration
daemon-stop-hook.sh # The loop/queue engine
scripts/
setup-daemon.sh # Initialize daemon state
add-to-queue.sh # Append task to queue
show-status.sh # Display status
MIT
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub yihan2099/claude-daemonPersonal AI agent skills — batch project maintenance, learning strategy, and workflow optimization.
Closed-loop workflow optimization — measure, categorize failures, fix, and re-measure until target success rate
Agent procurement skill — five-tier decision protocol (Cache → Use → Gen → Pay → Delegate) for fulfilling capabilities at minimum cost
Autonomous task execution daemon that monitors Claude usage windows and executes predefined tasks automatically. Keep Claude working 24/7 on your projects.
Launch, control, and monitor other Claude Code sessions as workers via tmux
tq task queue worker commands
Manage large coding tasks using git worktrees and background Claude Code sessions. Supports launching, monitoring, resuming, and cleanup of autonomous tasks with alert notifications.
Use when user wants to execute long-running tasks that require multiple sessions to complete. This skill manages task decomposition, progress tracking, and autonomous execution using Claude Code headless mode with auto-continuation. Trigger phrases: autonomous, long-running task, multi-session, 自主执行, 长时任务, autonomous skill.
Installer for TÂCHES' Get-Shit-Done workflow system - meta-prompting, context engineering and spec-driven development