Sleepless Agent
A continuous Claude Code task daemon for using idle Pro capacity on development work.
What does this agent do, and when should you use it?
Sleepless Agent is a 24/7 development-task daemon powered by the Claude Code CLI and Python Agent SDK. It accepts work through Slack commands or the local `sle` CLI and persists tasks in a SQLite queue. The daemon executes work in isolated workspaces, stores results and metadata, and can make Git commits and pull requests according to task type. Its scheduler checks Claude Code Pro usage with `claude /usage` and pauses or resumes new task generation using separate day and night thresholds. Slack is optional, and the repository documents deployment through Linux systemd and macOS launchd.
A user submits a thought or project task with /think or sle think; the Slack bot or CLI places it in the SQLite Task Queue. The event loop in daemon.py schedules work, while claude_code_executor.py uses the Python Agent SDK to run the Claude Code CLI in an isolated task workspace; complex work can use configurable Planner, Worker, and Evaluator agents with independent turn limits. results.py stores outputs and metadata, monitor.py exposes health checks and metrics, and claude /usage informs whether generation and scheduling continue. Random thoughts can be committed to thought-ideas; project tasks submitted with -p can create feature/<project>-<task_id> branches and, when gh is installed and configured, pull requests.
- A solo developer with Claude Code Pro wants overnight handling of captured engineering ideas while retaining task outputs.
- A Slack-based engineering team wants to submit a backend task with `/think -p backend ...` and review its work through a feature branch and PR.
- A command-line-first developer does not want Slack administration and wants to manage tasks locally with `sle think`, `sle check`, and `sle report`.
- A user has independent development jobs to run concurrently and needs each job to receive its own workspace.
- A developer wants to conserve daytime Claude Code Pro capacity while allowing more aggressive overnight task execution through configured thresholds.
What are this agent's strengths and limitations?
- Slack commands mirror the `sle` CLI, and the CLI works without a Slack configuration.
- The SQLite queue, result storage, reports, logs, and metrics are kept in a local workspace for persistent operation and traceability.
- Per-task isolated workspaces are paired with feature branches, automatic commits, and optional PR creation for project tasks.
- Configurable day and night thresholds make Claude Code Pro usage management part of task scheduling.
- Core execution depends on the Claude Code CLI, its authenticated session, and Claude Code Pro usage; no other model or API adapter is documented.
- Slack use requires workspace-admin setup of Socket Mode, OAuth scopes, event subscriptions, and two tokens.
- Automatic PR creation depends on the optional `gh` CLI, and remote Git repository settings must be supplied by the user.
- Tasks write to local workspaces and perform Git operations, so teams should assess isolation and review practices before enabling auto-commits or task auto-generation.
How do you install or deploy this agent?
Requires Python 3.11+, Node.js, Git, and an authenticated Claude Code CLI. Install the package with pip install sleepless-agent; install the CLI with npm install -g @anthropic-ai/claude-code; then run claude login and verify with claude --version. For a first run, start sle daemon and submit sle think "Research async Python patterns"; Slack is not required. To enable Slack, create a Socket Mode app, put SLACK_BOT_TOKEN and SLACK_APP_TOKEN in .env, then run sle daemon.
How do you use this agent?
Start sle daemon, then create a project task with sle think "Build onboarding flow" -p backend, or submit a random thought with sle think "Explore async patterns". Use sle check for daemon, queue, and usage status; sle usage for Claude Code Pro usage; and sle report 7 for task details. sle cancel 9 moves a task or project to trash, and sle trash restore <project> restores it. To override storage paths, run sle --db-path ./tmp/tasks.db --results-path ./tmp/results check. With Slack configured, use the matching /think, /check, /usage, /report, /cancel, and /trash commands; /chat <project> starts an interactive session in a dedicated thread.