Skip to content

Instantly share code, notes, and snippets.

View mogarick's full-sized avatar

Ricardo Montoya mogarick

View GitHub Profile

Add an "overnight mode" Stop hook to this repository for Claude Code. ​ Goal: when overnight mode is on, an unattended agent must never end its turn by asking a human a question. If its final message asks one, the hook blocks the stop and tells it to pick the most reasonable (based on what it knows about the project, task, and my preferences) reversible option and keep working. After two blocks in one session it lets the stop through, so a truly stuck agent can still finish. ​ Overnight mode is on only while the file ~/.agents/OVERNIGHT exists. I create it before leaving and delete it in the morning. ​ Steps:

  1. Create Tools/hooks/guard_overnight_questions.py with exactly the script below (adjust the wording of MESSAGE only if I ask).
  2. Register it in .claude/settings.json under hooks.Stop. Merge into any existing hooks; do not overwrite other entries. Use this entry: {"hooks": [{"type": "command", "command": "python3 "${CLAUDE_PROJECT_DIR}/Tools/hooks/guard_overnight_questions.py""}]}
@mogarick
mogarick / 0_reuse_code.js
Created June 24, 2016 15:02
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console