ClaudeMods
☰
EN
● 0 online · Views 0 times
SponsorsSubmit a project
GitHub repositories · by ShriD5

night-mode

A Claude Code plugin that, between configurable late-night hours, makes Claude extra cautious: risky Bash commands (deploys, force pushes, rm -rf, DROP/TRUNCATE) are held for confirmation, the system prompt gains a caution section, and a status line shows the active window.

ShriD5@ShriD5

ShriD5/claude-mods/tree/main/night-mode

Translated

About this mod

night-mode is a Claude Code plugin that activates a safety window (default 01:00–05:00 local time). During that window it appends a session-scoped caution section via a prompt.compose hook, intercepts Bash commands through a tool.call hook, and classifies risky operations such as wrangler/vercel/fly deploys, kubectl apply, terraform apply, git push --force, rm -rf, npm publish and SQL DROP/TRUNCATE. Risky commands require explicit confirmation via $.ui.ask; if no one can answer (e.g. claude -p) or the user declines, the command is held with an instruction to run it manually or reply 'yes, ship it'. Replying 'yes, ship it' bypasses prompts for 10 minutes. A status line displays '🌙 night mode until 05:00', and /night on|off| (status) controls the behavior per session. Options include start, end and timezone (IANA zone, falling back to $TZ then the machine clock). Install via claude --plugin-dir /path/to/claude-mods/night-mode or by adding the repo as a marketplace and using /plugin.

Installation

Check the author's README for the marketplace and plugin name first. Commands may change as the repository evolves.

claude plugin marketplace add ShriD5/claude-mods
claude plugin install night-mode
Original text / README

night-mode

Between 01:00 and 05:00, Claude Code gets more careful.

  • Claude's system prompt gets a short section: it's late, double-check anything destructive, prefer reversible steps, summarise the risks before acting.
  • Risky Bash commands stop and ask you first: It's 2:41am. Run this prod deploy (wrangler deploy)? That covers deploys (wrangler deploy, vercel --prod, fly deploy), kubectl apply, terraform apply, git push --force, rm -rf, npm publish and DROP/TRUNCATE in SQL. If nobody can answer (claude -p) or you pick "Not tonight", the command is held with: it's 2:41am. if you're sure, run it yourself or reply 'yes, ship it'.
  • Reply yes, ship it and risky commands run without asking for 10 minutes.
  • The status line shows 🌙 night mode until 05:00 while it's on.
  • /night off turns it off for the rest of the session. /night on brings it back, and /night says where things stand.

Install

claude --plugin-dir /path/to/claude-mods/night-mode

Or add the repo as a marketplace and install it with /plugin.

Options

| Option | Default | What it does | | --- | --- | --- | | start | 01:00 | local time night mode turns on | | end | 05:00 | local time it turns off (a window can wrap past midnight, e.g. 23:00 to 06:00) | | timezone | empty | an IANA zone like Asia/Kolkata; empty uses $TZ, then the machine's clock |

How it works

A prompt.compose hook appends a session-scoped section at night, a tool.call hook on Bash classifies the command and confirms it through $.ui.ask, which works in every permission mode, and a $.clock.every timer keeps the status line current.

Similar projects