npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

overnight-cli

v0.1.0

Published

Keep your coding agent running while you sleep. Rate-limit recovery, crash detection, Telegram/Slack alerts. Works with Claude, Codex, and Gemini.

Downloads

176

Readme

overnight

Claude Code stops when it hits a rate limit. You wake up, nothing got done.

overnight wraps your agent and handles it. Rate limits, crashes, hangs. When the limit clears it picks up right where it left off using the actual session ID, not a restart from scratch. Works on Windows without tmux or WSL.

Install

npm install -g overnight-cli

The command is still overnight.

Quick start

# Optional but worth it: set up Telegram so it pings you
overnight setup --telegram

# Then just prefix your normal claude command
overnight run -- claude -p "Build feature X" --dangerously-skip-permissions

That's it. Go to sleep.

What it does

| Situation | What overnight does | |---|---| | Rate limit | Waits for the reset, resumes with --resume SESSION_ID | | Crash | Restarts up to 3 times, uses --resume to keep context | | No output for 10 min | Sends an alert with the last 30 lines | | Auth prompt / merge conflict / y-n question | Sends an alert right away | | Task finishes | Sends a success ping |

Works with Claude, Codex, and Gemini

Each agent uses its own native resume so you don't lose context on a long task.

| | Claude Code | Codex CLI | Gemini CLI | |---|---|---|---| | Rate-limit detection | ✅ | ✅ | ✅ | | Resumes same session | ✅ --resume SESSION_ID | ✅ exec resume SESSION_ID | ✅ --resume SESSION_ID | | Parses exact wait time | ✅ | ✅ | ✅ | | Auto-injects JSON output | ✅ --output-format stream-json | ✅ --json | ✅ --output-format stream-json |

How overnight compares

| Feature | claude-auto-retry | autoclaude | overnight | |---|---|---|---| | Rate-limit recovery | ✅ | ✅ | ✅ | | Checkpoint before pause | ❌ | ❌ | ✅ | | Crash recovery + resume | ❌ | ❌ | ✅ | | Hang detection | ❌ | ❌ | ✅ | | Human-needed alerts | ❌ | ❌ | ✅ | | Telegram / Slack | ❌ | ❌ | ✅ | | Windows support | ❌ | ❌ | ✅ | | npm install | ❌ | ❌ | ✅ | | No tmux required | ❌ | ❌ | ✅ |

How it works

overnight spawns your agent as a child process and pipes the output through normally. In the background it:

  1. Injects --output-format stream-json (or the equivalent for each agent) so it can read the session ID from the output
  2. Watches for rate-limit messages using patterns sourced from each agent's actual error strings
  3. On rate limit: saves the last 30 lines as a checkpoint, waits until the exact reset time, then runs claude --resume SESSION_ID (or the Codex / Gemini equivalent) to continue the same session
  4. On crash: backs off and restarts, reusing --resume if a session ID was captured
  5. On silence: monitors for auth prompts, merge conflicts, and other patterns that mean the agent is stuck

Telegram setup (5 steps)

overnight setup --telegram
  1. Message @BotFather on Telegram, send /newbot, copy the token
  2. Paste the token into the wizard
  3. Send any message to your new bot
  4. overnight captures your chat ID automatically
  5. Test message sent

Commands

overnight run -- <command> [args]   # Watch any agent command
overnight setup --telegram          # Set up Telegram
overnight setup --slack             # Set up Slack
overnight status                    # Show config and recent events
overnight log                       # Full event history
overnight log --tail 20             # Last 20 events
overnight log --type rate_limit     # Filter by event type
overnight checkpoint list           # List saved checkpoints
overnight checkpoint show           # Show the latest checkpoint
overnight uninstall                 # Remove config and hooks

Flags for overnight run

overnight run -v -- claude ...              # Verbose: shows session ID and resume command
overnight run --hang-timeout 30 -- ...      # Alert if no output for 30 seconds (good for testing)

Claude Code status bar hook

overnight setup can install a hook into ~/.claude/settings.json:

{ "statusLine": "~/.overnight/hook.js" }

This makes overnight read the exact rate-limit reset time from Claude's structured data instead of parsing text. It also shows context usage in Claude's status bar: 🌙 overnight | ctx: 73%

Windows

Works on Windows PowerShell and Command Prompt without any extra setup. No tmux, no WSL, no admin rights needed.

Contributing

Node.js 18+, TypeScript, no native modules.

git clone https://github.com/volkthienpreecha/agent-watch
cd agent-watch
npm install
npm run build
node dist/cli.js run -- echo "test"

To test specific features:

node test/verify-resume-args.js                                    # Unit tests for resume logic
node dist/cli.js run -- node test/simulate-crash-then-complete.js  # Crash recovery
node dist/cli.js run --hang-timeout 5 -- node test/simulate-hang.js  # Hang detection
node dist/cli.js run -- node test/simulate-codex-rate-limit.js     # Codex rate limit
node dist/cli.js run -- node test/simulate-gemini-rate-limit.js    # Gemini rate limit

License

MIT