You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A 24/7 AI assistant daemon that continuously works on tasks via Slack. Uses Claude Code CLI via Python Agent SDK to process both random thoughts and serious jobs automatically with isolated workspaces.
4
-
5
-
## About
6
-
7
-
- Maintained by Context Machine Lab
8
-
- Ships as `sleepless-agent` on PyPI (`pip install sleepless-agent`)
9
-
- Automates task intake, execution, and reporting via Slack + Claude integration
10
-
- Designed for continuous operation with isolated workspaces and automated git hygiene
11
-
12
-
## Full Precedure
13
-
14
-
1. Command arrives via CLI (sle think -p project "..." or sle think "...") or Slack (/think --project=project ... or /think ...)
15
-
2. TaskQueue stores it in SQLite database with status PENDING
16
-
3. Daemon polls every 5 seconds, calling _process_tasks()
Have Claude Code Pro but not using it at night? Transform it into an AgentOS that handles your ideas and tasks while you sleep. This is a 24/7 AI assistant daemon powered by Claude Code CLI and Python Agent SDK that processes both random thoughts and serious tasks via Slack with isolated workspaces.
15
+
16
+
17
+
## ✨ Features
39
18
40
19
- 🤖 **Continuous Operation**: Runs 24/7 daemon, always ready for new tasks
41
20
- 💬 **Slack Integration**: Submit tasks via Slack commands
42
-
- 🎯 **Hybrid Autonomy**: Auto-applies random thoughts, requires review for serious jobs
21
+
- 🎯 **Hybrid Autonomy**: Auto-applies random thoughts, requires review for serious tasks
43
22
- ⚡ **Smart Scheduling**: Optimizes task execution based on priorities
- 🔌 **Claude Code SDK**: Uses Python Agent SDK to interface with Claude Code CLI
46
25
- 🏗️ **Isolated Workspaces**: Each task gets its own workspace for true parallelism
47
26
- 📝 **Result Storage**: All outputs saved with metadata for future reference
48
27
49
-
## Prerequisites
28
+
## ⚙️ Prerequisites
50
29
51
30
- Python 3.11+
52
31
- Slack workspace admin access
53
32
- Claude Code CLI installed (`npm install -g @anthropic-ai/claude-code`)
54
33
- Git (for auto-commits)
55
34
- gh CLI (optional, for PR automation)
56
35
57
-
## Quick Start
36
+
## 🚀 Quick Start
58
37
59
38
### 1. Install
60
39
@@ -86,8 +65,7 @@ Visit https://api.slack.com/apps and create a new app:
86
65
87
66
**Create Slash Commands**
88
67
Settings > Slash Commands > Create New Command:
89
-
-`/task` - Add serious task
90
-
-`/think` - Capture random thought
68
+
-`/think` - Capture thought or task (use `-p project-name` for serious tasks)
91
69
-`/check` - Check queue status
92
70
-`/cancel` - Cancel task or project
93
71
-`/report` - Show reports or task details
@@ -119,11 +97,7 @@ Set:
119
97
### 4. Run
120
98
121
99
```bash
122
-
# Terminal 1: Start the daemon
123
100
sle daemon
124
-
125
-
# Terminal 2 (optional): Monitor logs
126
-
tail -f workspace/data/agent.log
127
101
```
128
102
129
103
You should see startup logs similar to:
@@ -133,48 +107,33 @@ You should see startup logs similar to:
133
107
```
134
108
Logs are rendered with Rich for readability; set `SLEEPLESS_LOG_LEVEL=DEBUG` to increase verbosity.
135
109
136
-
### Logging
137
-
138
-
Rich console output is powered by [Rich](https://rich.readthedocs.io/) and now mirrors the structured events that feed our JSON logs. Every console line maps to a canonical `event` (for example `task.phase.done`, `scheduler.dispatch`, `usage.snapshot`) so you can skim the terminal or process the data programmatically.
139
-
140
-
Structured copies of each log line are written to JSONL files under `workspace/.logs` by default (override with `SLEEPLESS_LOG_DIR`). These files preserve context such as `task_id`, `phase`, `usage_percent`, and timing deltas, making it easy to build dashboards or run ad-hoc analysis later.
141
110
142
-
Set `SLEEPLESS_LOG_LEVEL` to tune verbosity; `DEBUG` includes low-level worker/evaluator metrics while `INFO` keeps to lifecycle milestones.
143
-
144
-
145
-
## Slack Commands
111
+
## 💬 Slack Commands
146
112
147
113
All Slack commands align with the CLI commands for consistency:
Runtime settings come from environment variables loaded via `.env` (see `.env.example`). Update those values or export them in your shell to tune agent behavior.
260
219
261
-
### Pro Plan Usage Management
220
+
### Usage Management
262
221
263
-
The agent automatically monitors your Claude Code Pro plan usage and prevents task overruns with an **85% usage pause threshold**. This ensures you never accidentally exhaust your message limit.
222
+
The agent automatically monitors Claude Code usage and intelligently manages task execution based on configurable thresholds.
264
223
265
224
**How it works:**
266
225
267
-
1.**Usage Monitoring** - Every task checks your Pro plan usage via `claude /usage` command
0 commit comments