ai-night-shift

ไฝœ่€… JudyaiLabโœ“ ๅทฒ้ชŒ่ฏ

Multi-agent autonomous framework โ€” let your AI work while you sleep ๐ŸŒ™

219
Stars
25
Forks
Shell
่ฏญ่จ€
2026/8/23
ๆทปๅŠ ๆ—ถ้—ด

โš ๏ธ ็ฌฌไธ‰ๆ–น่ฝฏไปถๅฃฐๆ˜Ž

ๆœฌ Skill ไธบ็ฌฌไธ‰ๆ–นๅผ€ๆบ่ฝฏไปถ๏ผŒ็‹ฌ็ซ‹ๆ‰˜็ฎกไบŽ GitHubใ€‚SkillTip ไป…ไธบไฟกๆฏ็›ฎๅฝ•๏ผŒไธๆŽงๅˆถๆˆ–็ปดๆŠคๅบ•ๅฑ‚ไป“ๅบ“ใ€‚ๆ‰€ๆ˜พ็คบ็š„ๅฎ‰ๅ…จๆฃ€ๆŸฅไธบ่‡ชๅŠจๅŒ–ไธ”่Œƒๅ›ดๆœ‰้™๏ผŒๅฎ‰่ฃ…ๅ‰่ฏท่‡ช่กŒๅฎกๆŸฅๆบ็ ใ€‚

้˜…่ฏปๆœๅŠกๆกๆฌพ

ๅฎ‰่ฃ…

ๆทปๅŠ ๅˆฐไฝ ็š„ Claude Code skills ็›ฎๅฝ•๏ผš

# Add to your Claude Code skills
git clone https://github.com/JudyaiLab/ai-night-shift

ๅฟซ้€Ÿๅ…ฅ้—จ

ไฝฟ็”จ ai-night-shift ็ญ‰ Skills ็š„ๆŒ‡ๅ—ใ€‚

ๅฎ‰ๅ…จๆŠฅๅ‘Š

ๅทฒ้ชŒ่ฏ

ไธŠๆฌกๆ‰ซๆ๏ผšโ€”

{
  "status": "PASSED",
  "issues": []
}

README.md

๐ŸŒ™ AI Night Shift

A multi-agent autonomous framework that lets your AI assistants work while you sleep.

License: MIT ็น้ซ”ไธญๆ–‡ ็ฎ€ไฝ“ไธญๆ–‡ ํ•œ๊ตญ์–ด

AI Night Shift is an open-source framework for running multiple AI agents (Claude Code, Gemini, and more) in coordinated autonomous sessions during off-hours. Born from 30+ real production night shifts, this isn't theoretical โ€” it's battle-tested.

What Makes This Different

Most "autonomous agent" tools run a single agent in isolation. AI Night Shift orchestrates multiple heterogeneous AI agents working together:

AgentEngineRoleMode
DeveloperClaude CodeCoding, debugging, deployingContinuous (hours)
ResearcherGemini CLIResearch, data gathering, triagePeriodic (minutes)
CoordinatorAny LLMTask routing, monitoringHeartbeat (30min)

They communicate through shared protocols โ€” a file-based message queue, shared chat log, and task board integration.

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              AI Night Shift                  โ”‚
โ”‚                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  Claude   โ”‚  โ”‚  Gemini  โ”‚  โ”‚Heartbeat โ”‚  โ”‚
โ”‚  โ”‚  Code     โ”‚  โ”‚  CLI     โ”‚  โ”‚  Agent   โ”‚  โ”‚
โ”‚  โ”‚          โ”‚  โ”‚          โ”‚  โ”‚          โ”‚  โ”‚
โ”‚  โ”‚ night_   โ”‚  โ”‚ patrol.  โ”‚  โ”‚ heartbeatโ”‚  โ”‚
โ”‚  โ”‚ shift.sh โ”‚  โ”‚ sh       โ”‚  โ”‚ _config  โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚       โ”‚              โ”‚              โ”‚        โ”‚
โ”‚       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜        โ”‚
โ”‚              โ”‚              โ”‚                โ”‚
โ”‚       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”          โ”‚
โ”‚       โ”‚ night_chat  โ”‚ โ”‚ bot_inboxโ”‚          โ”‚
โ”‚       โ”‚    .md      โ”‚ โ”‚  (JSON)  โ”‚          โ”‚
โ”‚       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ”‚
โ”‚                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ Plugins  โ”‚  โ”‚Dashboard โ”‚  โ”‚Templates โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Quick Start

1. Install

git clone https://github.com/judyailab/ai-night-shift.git
cd ai-night-shift
bash install.sh

2. Configure

# Copy the example config and edit your settings
cp config.env.example config.env
nano config.env

# Customize the night shift prompt
nano claude-code/prompt_template.txt

3. Test

# Run a single round to verify setup
bash claude-code/night_shift.sh --max-rounds 1

4. Schedule

# The installer adds cron jobs automatically, or set up manually:
crontab -e
# Add: 0 1 * * * cd ~/ai-night-shift && bash claude-code/wrapper.sh

Modules

ModuleDescriptionDocs
Claude CodeContinuous developer sessionsREADME
GeminiPeriodic patrol and researchREADME
OpenClawHeartbeat coordinator patternREADME
ProtocolsInter-agent communicationREADME
PluginsExtensible pre/post/task hooksREADME
DashboardVisual monitoring interfaceOpen dashboard/index.html
TemplatesPrompt templates by use case4 templates included

Prompt Templates

TemplateUse Case
development.txtCoding, testing, debugging
research.txtData gathering, analysis
content.txtWriting, translation, SEO
maintenance.txtSystem admin, monitoring

Plugin System

Extend your night shift with pre-built or custom plugins:

# Enable a plugin
ln -s plugins/examples/system_health.sh plugins/enabled/

# List all plugins
bash plugins/plugin_loader.sh --list

Built-in plugins: System Health, Backup, Git Commit Summary, Morning Report, De-Sloppify

Dashboard

Open dashboard/index.html in a browser. Drag and drop your report files to visualize:

  • Agent activity and status
  • Round-by-round timeline
  • Night chat messages
  • System health metrics

Agent Adapters

The night shift runner is agent-agnostic. Switch agents with one config change:

# In config.env
AGENT_ADAPTER=claude-code   # default
# AGENT_ADAPTER=codex-cli   # OpenAI Codex CLI
# AGENT_ADAPTER=aider       # Aider
# AGENT_ADAPTER=custom      # Your own (copy adapters/custom.sh)

Or via CLI flag:

bash claude-code/night_shift.sh --adapter codex-cli

Create your own adapter: copy adapters/custom.sh, implement 5 functions, done. See adapters/ for details.

Prompt Design for Autonomy

The most common pitfall: your agent stops mid-task and waits for confirmation that never comes.

All included templates have an Autonomy Rules block that prevents this:

  • Never ask for confirmation โ€” decide and execute
  • Never wait for user input โ€” choose the safest option and proceed
  • Never use interactive commands
  • If stuck 3 times, log and move on

See docs/advanced.md for the full prompt design guide.

Advanced Features

  • Completion Signal โ€” agents can say "I'm done" to end the shift early
  • Shared Task Notes โ€” cross-round context memory bridge
  • De-Sloppify Pattern โ€” separate cleanup pass for code quality
  • Anti-Pattern Guide โ€” avoid common autonomous loop pitfalls

Requirements

  • Bash 4+ and Python 3.6+
  • At least one AI CLI tool:
  • A Linux/macOS system with cron and timeout (GNU coreutils; macOS: brew install coreutils)

Safety & Security

  • PID locking prevents concurrent runs
  • Time windows ensure shifts end on schedule
  • Rate limit handling with automatic retry
  • No secrets in code โ€” all credentials via environment variables
  • Append-only communication โ€” agents can't delete each other's messages
  • Plugin timeout โ€” max 5 minutes per plugin execution

Contributing

See CONTRIBUTING.md for guidelines.

License

MIT โ€” Judy AI Lab


Built with real-world experience from 30+ autonomous night shifts. If your AI works harder while you sleep, you're doing it right. ๐ŸŒ™

ๅธธ่ง้—ฎ้ข˜

What is ai-night-shift?โŒ„

ai-night-shift is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by JudyaiLab. Multi-agent autonomous framework โ€” let your AI work while you sleep ๐ŸŒ™. It has 219 GitHub stars.

Is ai-night-shift safe to use?โŒ„

Yes. ai-night-shift passed SkillsLLM's automated security scan โ€” a dependency vulnerability audit plus prompt-injection heuristics โ€” with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install ai-night-shift?โŒ„

Clone the repository with "git clone https://github.com/JudyaiLab/ai-night-shift" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is ai-night-shift written in?โŒ„

ai-night-shift is primarily written in Shell. It is open-source under JudyaiLab on GitHub, so you can review or fork the full source.

Are there alternatives to ai-night-shift?โŒ„

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh ai-night-shift against similar tools.

่ฏ„่ฎบ (0)

ๆš‚ๆ— ่ฏ„่ฎบ๏ผŒๆˆไธบ็ฌฌไธ€ไธชๅˆ†ไบซๆƒณๆณ•็š„ไบบ๏ผ

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

โญ 242,219โ‘‚ 36,702JavaScript
AI ๆ™บ่ƒฝไฝ“ai-agentsanthropicclaude-code
ๆŸฅ็œ‹่ฏฆๆƒ… โ†’

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

โญ 185,940โ‘‚ 28,768JavaScript
AI ๆ™บ่ƒฝไฝ“ai-agentsanthropicclaude-code
ๆŸฅ็œ‹่ฏฆๆƒ… โ†’

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

โญ 128,868โ‘‚ 8,826Rust
AI ๆ™บ่ƒฝไฝ“claude-codeai-tools
ๆŸฅ็œ‹่ฏฆๆƒ… โ†’

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

โญ 120,031โ‘‚ 19,897Shell
AI ๆ™บ่ƒฝไฝ“
ๆŸฅ็œ‹่ฏฆๆƒ… โ†’

ๅผ€ๅ‘่€…่ฟ˜ๅ–œๆฌข

ๅŸบไบŽๅ–œๆฌขๆญค Skill ็š„ๅผ€ๅ‘่€…ๆŠ•็ฅจๅ’Œๆ”ถ่—

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

โญ 242,219โ‘‚ 36,702JavaScript
AI ๆ™บ่ƒฝไฝ“ai-agentsanthropicclaude-code
ๆŸฅ็œ‹่ฏฆๆƒ… โ†’

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

โญ 201,881โ‘‚ 60,308TypeScript
MCP ๆœๅŠกๅ™จapisai-tools
ๆŸฅ็œ‹่ฏฆๆƒ… โ†’

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

โญ 185,940โ‘‚ 28,768JavaScript
AI ๆ™บ่ƒฝไฝ“ai-agentsanthropicclaude-code
ๆŸฅ็œ‹่ฏฆๆƒ… โ†’

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

โญ 128,868โ‘‚ 8,826Rust
AI ๆ™บ่ƒฝไฝ“claude-codeai-tools
ๆŸฅ็œ‹่ฏฆๆƒ… โ†’