context-machine-lab/sleepless-agent
A self-hosted daemon that queues Claude Code tasks and hands off changes in Git.
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Sleepless Agent is a self-hosted Python daemon with two front ends: the sle CLI and an optional Slack app using Socket Mode. Task submissions go into a persistent SQLite queue. The daemon event loop schedules work, the Python Agent SDK drives the Claude Code CLI in per-task workspaces, and the result manager saves outputs and metadata. Git automation handles commits and, when configured, pull requests. Threaded Slack chat is a separate interactive path that can read and edit files in a project workspace.
The package requires Python 3.11+ and lists anthropic, slack-sdk, sqlalchemy, aiosqlite, python-dotenv, PyYAML, and gitpython among its dependencies. Persistent state includes tasks.db, results, reports, logs, and metrics under workspace/data/; task and project workspaces live separately. The integrations are Slack Socket Mode and the Claude Code SDK/CLI path. This is not a documented MCP server, plugin interface, or provider-neutral model router.
Key Capabilities & Differentiators
The dividing line between lightweight and reviewable work is explicit: sle think captures an idea, while -p assigns a task to a project. Ideas are auto-committed to thought-ideas; project work uses feature branches and can be handed off as a PR. The Planner, Worker, and Evaluator stages can be enabled independently and each defaults to a maximum of three turns. The supported execution backend is Claude Code; there is no documented model matrix or alternate backend.
The scheduler checks usage through claude /usage. Defaults are a 96% night threshold from 01:00 to 09:00 and a 95% daytime threshold. At the threshold, automatic task generation pauses, pending work waits, and active work finishes; execution resumes after the usage reset. These thresholds govern scheduling, not hard spending or usage caps. sle check, sle usage, and sle report expose operating state and results. Slack chat retains conversation history within a dedicated thread and times out after 30 minutes of inactivity.
Trade-offs & Limitations
Compared with opening Claude Code directly, this wrapper adds unattended scheduling, durable task state, and a Git-based handoff, at the cost of another long-running process and more credentials to manage. Compared with a conventional CI workflow, it is better suited to open-ended work submitted in natural language. CI is the better fit for repeatable checks with explicit steps and pass/fail criteria; keep those checks on the PRs the agent produces.
SQLite simplifies deployment, but the documented design is a local daemon, not a demonstrated multi-node worker service. Separate workspaces reduce file collisions but are not evidence of a security sandbox. At this alpha stage, start with trusted users and a narrowly scoped repository, restrict Slack access and Git write permissions, and enforce review on protected branches. The Evaluator stage does not replace those controls, and the scheduler's reliance on Claude Code usage reporting makes that integration an operational dependency.
Hardware & Deployment Guide
Install sleepless-agent in a Python 3.11+ environment, install the Claude Code CLI via npm with Node.js, authenticate with claude login, and start sle daemon. Git supports automatic commits; gh is optional for PR automation. A CLI-only setup needs no Slack credentials. To add Slack, enable Socket Mode, configure commands and any chat events you need, and provide the bot and app tokens through .env or the process environment. Configure the remote repository before enabling remote Git automation.
Self-hosting covers the daemon and its local state, not model inference. This path still needs access to Claude, but it does not require a separate Claude API key. Run it on a host that can stay up and preserve its workspace and database across restarts; size CPU, memory, and disk for concurrent sessions and any builds or tests they invoke. Release v0.1.0 published the package on PyPI, v0.1.1 was an architectural and documentation overhaul, and v0.1.2 added requests as a dependency.
sle feed a persistent SQLite queue; a Python daemon runs Claude Code tasks and stores results.thought-ideas, while project tasks use feature branches and can open PRs.sle check, sle usage, and sle report expose queue health, plan usage, and task results; database and results paths can be overridden.Individual developers and small teams already using Claude Code who want to queue trusted, non-urgent work and review the results in Git later.
You require offline inference, interchangeable model backends, a shared multi-node worker service, or sandboxed execution of tasks from untrusted users.
Quick Start & Installation
pip install sleepless-agentComparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| sleepless-agent ★ | 843 | +3 | Python | MIT | A self-hosted daemon that queues Claude Code tasks and hands off changes in Git. |
| oh-my-pi | 40.5k | +483 | TypeScript | MIT | A Bun/Rust terminal agent for model-flexible coding with LSP and editor integrat |
| gemini-cli | 109.6k | +376 | TypeScript | Apache-2.0 | A Node.js terminal agent for enterprise Gemini coding workflows and MCP tools |
| goose | 57.3k | +219 | Rust | Apache-2.0 | Rust coding agent with MCP tools and local or hosted models, embeddable via ACP |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/context-machine-lab/sleepless-agent.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about sleepless-agent
How do the CLI, Slack, and Claude Code fit together?
sle to submit and inspect queued work without Slack. If you want Slack commands or threaded chat, configure a Slack app in Socket Mode and supply SLACK_BOT_TOKEN and SLACK_APP_TOKEN. Task execution goes through the Python Agent SDK and an authenticated Claude Code CLI; this setup does not require a separate Claude API key.Does it need a GPU, and what drives host resource usage?
Can a company self-host it for commercial use?
When is this preferable to using Claude Code directly?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy