Claude Nights Watch 🌙

🚀 NEW: Now available as a Claude Code Plugin! 🎉
Autonomous task execution system for Claude CLI that monitors your usage windows and executes predefined tasks automatically. Built on top of the claude-auto-renew concept but instead of simple renewals, it executes complex tasks from a task.md file.
⚠️ Warning: This tool uses --dangerously-skip-permissions for autonomous execution. Use with caution!
🎯 Two Ways to Use Claude Nights Watch
Choose your preferred installation method:
🔥 Recommended: Claude Code Plugin (NEW!)
- Seamless Integration: Works directly within Claude Code
- 7 Slash Commands:
/nights-watch start/stop/status/logs/task/setup/restart
- AI Agent Integration: Built-in Task Executor agent for autonomous guidance
- Smart Hooks: Automatic session integration and activity logging
- MCP Server: Programmatic control tools for Claude
- Enhanced UX: Better error handling and user experience
⚡ Original Daemon Method (Legacy)
- Standalone Operation: Works independently of Claude Code
- Script-based Control: Direct shell script execution
- Proven Reliability: Battle-tested daemon implementation
- Full Feature Set: All core functionality available
🎯 Overview
Claude Nights Watch extends the auto-renewal concept to create a fully autonomous task execution system. When your Claude usage window is about to expire, instead of just saying "hi", it reads your task.md file and executes the defined tasks autonomously.
Key Features
- 🤖 Autonomous Execution: Runs tasks without manual intervention
- 📋 Task-Based Workflow: Define tasks in a simple markdown file
- 🛡️ Safety Rules: Configure safety constraints in
rules.md
- ⏰ Smart Timing: Uses ccusage for accurate timing or falls back to time-based checking
- 📅 Scheduled Start: Can be configured to start at a specific time
- 📊 Comprehensive Logging: Track all activities and executions
- 🔄 Based on Proven Code: Built on the reliable claude-auto-renew daemon
🚀 Quick Start
Prerequisites
- Claude CLI installed and configured
- (Optional) ccusage for accurate timing:
npm install -g ccusage
🔥 Plugin Installation (Recommended)
Option 1: As Claude Code Plugin
Standard Installation
# Method 1: From marketplace
claude plugin marketplace add https://github.com/aniketkarne/ClaudeNightsWatch
claude plugin install claude-nights-watch@claude-nights-watch-marketplace
# Method 2: Direct from GitHub
claude plugin install https://github.com/aniketkarne/ClaudeNightsWatch
# Method 3: From local directory (for development)
claude plugin marketplace add /path/to/ClaudeNightsWatch
claude plugin install claude-nights-watch@claude-nights-watch-marketplace
One-Command Installation
Use the Claude Plugins CLI to skip the marketplace setup:
npx claude-plugins install @aniketkarne/claude-nights-watch-marketplace/claude-nights-watch
This automatically adds the marketplace and installs the plugin in a single step.
Plugin Usage
# Interactive setup
/nights-watch setup
# Start daemon
/nights-watch start
# Check status
/nights-watch status
# View logs in real-time
/nights-watch logs -f
# Stop daemon
/nights-watch stop
Plugin Features:
- 🎯 7 Slash Commands:
/nights-watch start/stop/status/logs/task/setup/restart
- 🧠 AI Agent: Built-in Task Executor for autonomous guidance
- 🔗 MCP Server: 8 programmatic tools for Claude control
- 🎣 Smart Hooks: Automatic session integration
⚡ Original Daemon Installation (Legacy)
Option 2: Install as Standalone Daemon
-
Clone this repository:
git clone https://github.com/aniketkarne/ClaudeNightsWatch.git
cd ClaudeNightsWatch
-
Make scripts executable:
chmod +x *.sh
-
Run the interactive setup:
./setup-nights-watch.sh
Daemon Usage
-
Create your task file (task.md):
# Daily Development Tasks
1. Run linting on all source files
2. Update dependencies to latest versions
3. Run the test suite
4. Generate coverage report
5. Create a summary of changes
-
Create safety rules (rules.md):
# Safety Rules