๐ค 24/7 AI agent that maximizes Claude Code Pro usage via Slack. Auto-processes tasks, manages isolated workspaces, creates Git commits/PRs, and optimizes day/night usage thresholds.
# Add to your Claude Code skills
git clone https://github.com/context-machine-lab/sleepless-agentA 24/7 AgentOS that works while you sleep
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.
# Start the daemon
$ sle daemon
2025-10-26 03:30:12 | INFO | Sleepless Agent starting...
2025-10-26 03:30:12 | INFO | Slack bot connected
# Submit a task via Slack
/think Implement OAuth2 authentication -p backend
# Check status
$ sle check
โญโโโโโโโโโโโโโโโโโโโ System Status โโโโโโโโโโโโโโโโโโโโฎ
โ ๐ข Daemon: Running โ
โ ๐ Queue: 3 pending, 1 in_progress โ
โ ๐ป Usage: 45% (Day threshold: 95%) โ
โ ๐ Last task: "Implement OAuth2..." (in progress) โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
# View results
$ sle report 42
Task #42: โ
Completed
Branch: feature/backend-42
PR: https://github.com/user/repo/pull/123
No comments yet. Be the first to share your thoughts!
npm install -g @anthropic-ai/claude-code)sle CLI works without Slack)๐ก Slack is optional. You can run all
sleCLI commands without configuring Slack. Slack integration adds a convenient real-time interface for submitting tasks and checking status, but every feature is also available via the CLI.
pip install sleepless-agent
Or for development:
git clone <repo>
cd sleepless-agent
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -e .
โ ๏ธ Windows / WSL tip: After
pip install, theslecommand might not be found if Python'sScriptsdirectory is not on yourPATH. See Troubleshooting:slenot found below.
# Install the Claude Code CLI (requires Node.js)
npm install -g @anthropic-ai/claude-code
# Log in once (opens a browser)
claude login
# Verify
claude --version
Slack integration is not required. You can use the sle CLI directly:
# Start the daemon (no Slack needed)
sle daemon
# Queue a task
sle think "Research async Python patterns"
# Check status
sle check
If you want Slack integration, continue with the setup below.
Visit https://api.slack.com/apps and create a new app:
Basic Information
Enable Socket Mode
xapp-)Create Slash Commands Settings > Slash Commands > Create New Command:
/think - Capture thought or task (use -p project-name for serious tasks)/chat - Start interactive chat mode with Claude/check - Check queue status/usage - Show Claude Code Pro plan usage/cancel - Cancel task or project/report - Show reports or task details/trash - Manage trash (list, restore, empty)OAuth Scopes Features > OAuth & Permissions > Bot Token Scopes:
chat:writecommandsapp_mentions:readchannels:history (for chat mode)groups:history (for chat mode in private channels)reactions:write (for chat mode indicators)Event Subscriptions (for Chat Mode) Features > Event Subscriptions > Enable Events > Subscribe to bot events:
message.channelsmessage.groupsInstall App
xoxb-)cp .env.example .env
nano .env # Edit with your tokens
Set:
SLACK_BOT_TOKEN - xoxb-... tokenSLACK_APP_TOKEN - xapp-... token(Claude API key no longer needed - uses Claude Code CLI)
sle daemon
You should see startup logs similar to:
2025-10-24 23:30:12 | INFO | sleepless_agent.interfaces.bot.start:50 Slack bot started and listening for events
2025-10-24 23:30:12 | INFO | sleepless_agent.runtime.daemon.run:178 Sleepless Agent starting...
Logs are rendered with Rich for readability; set SLEEPLESS_LOG_LEVEL=DEBUG to increase verbosity.
sle Command Not FoundIf sle is not recognised after pip install on Windows or WSL, the Python Scripts directory is likely not on your PATH.
Windows (PowerShell / CMD)
# Find where pip installed the script
python -m site --user-scripts
# Add that directory to PATH permanently (PowerShell)
$scriptsDir = python -m site --user-scripts
[Environment]::SetEnvironmentVariable("PATH", "$env:PATH;$scriptsDir", "User")
# Or run sle directly with python -m
python -m sleepless_agent.interfaces.cli --help
WSL (Ubuntu / Debian)
# Add the local bin directory to PATH
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# Verify
sle --version
System-wide pip install (not recommended)
If you used sudo pip install, the script will be in /usr/local/bin which is normally already in PATH. However, prefer using a virtual environment or pip install --user.
Virtual environment (recommended)
Using a virtual environment avoids PATH issues on all platforms:
python -m venv venv
# Windows:
venv\Scripts\activate
# macOS / Linux / WSL:
source venv/bin/activate
pip install sleepless-agent
sle --version # always works inside the venv
All Slack commands align with the CLI commands for consistency:
| Command | Purpose | Example |
|---------|---------|---------|
| /think | Capture random thought | /think Explore async ideas |
| /think -p <project> | Add serious task to project | /think Add OAuth2 support -p backend |
| /check | Show system status | /check |
| /usage | Show Claude Code Pro usage | /usage |
| /cancel | Cancel task or project | /cancel 5 or /cancel my-app |
Start a real-time conversation with Claude in a dedicated Slack thread:
| Command | Purpose | Example |
|---------|---------|---------|
| /chat <project> | Start chat mode for a project | /chat my-backend |
| /chat end | End current chat session | /chat end |
| /chat status | Check active session status | /chat status |
| /chat help | Show chat mode help | /chat help |
Chat Mode Features:
exit in thread to end session๐ก Note: When you run
/chat <project>, a new thread is created. All your prompts must be sent inside this thread - Claude only responds to messages within the chat thread, not in the main channel.
| Command | Purpose | Example |
|---------|---------|---------|
| /report | Today's report, task details, date/project report, or list all | /report, /report 42, /report 2025-10-22, /report my-app, /report --list |
| /trash | List, restore, or empty trash | /trash list, /trash restore my-app, /trash empty |
Install the project (or run within the repo) and use the bundled CLI:
python -m sleepless_agent.interfaces.cli think "Ship release checklist" -p my-app
# or, after installing the package:
sle check
The CLI mirrors the Slack slash commands:
| Command | Purpose | Example | |---------|---------|-