Cfn night mode

From masharratt/claude-flow-novice · View interactive version

Cfn night mode is an AI agent skill from the GitHub repository masharratt/claude-flow-novice. Global autonomy flag with decision log and morning report. While on, sessions never stop on AskUserQuestion or plan approval stalls: they decide with a conservative reversible default, log every choice to decision-log under night-<date> slugs, commit finished work (pushing only plain fast-forwards t

How to use this skill

Skill file

Night Mode

Contract

While the flag is on, the main chat has full autonomy: it does not stop on AskUserQuestion, EnterPlanMode, or plan approval stalls. This is the same contract as cfn-megaplan --unattended, applied globally: take the recorded conservative default instead of stopping; never widen scope, never loosen a boundary, never skip a bar. Night mode only removes the wait. In exchange, every autonomous decision MUST be recorded in the decision log under slug night-<date> so the morning report can surface the batch for review and overturn. A session without logging is a violation, not an optimization: the report prints a red flag when denies outnumber records.

Safety floor

Autonomy NEVER covers these. They are never executed and never "decided" to execute. Each one becomes a deferred blocking decision (--blocking --status proposed --chosen "DEFERRED: <what>") and work continues on a different path:

Git policy

Commit finished work as you go (git commit). git push only to the project's night-mode-push-allow list (plain fast-forward); never force, delete or rewrite. Any other push is a morning action for a human.

The list is <project>/.claude/night-mode-push-allow: one remote branch pair per line, # comments allowed (example: vps_personal main). The guard resolves the project from the push's effective directory (cd X && git push, git -C X push) and accepts the tools/dev/with-main-lock.sh <owner> [--] git push ... wrapper. It blocks -f, --force*, +refspec, --delete/-d/:branch, --mirror/--all/--tags, a refspec writing a different branch, a bare git push, and any unlisted pair. A missing or unreadable list blocks every push. Fast-forward-only is enforced by git and the remote: a non-fast-forward push is rejected unless forced. Every allowed push appends a git-push line to .night-mode-events.log and shows under PUSHES in the morning report.

Decision logging

# Normal autonomous decision (pass --status accepted for settled calls;
# the writer default is proposed, which lands the row in review queues):
bash $HOME/.claude/skills/decision-log/record.sh --slug night-$(date +%F) \
  --id <D-n> --title "<the question, short>" \
  --chosen "<option you picked>" --rationale "<why, one line>" --status accepted

# Safety-floor deferral (then continue on a different path):
bash $HOME/.claude/skills/decision-log/record.sh --slug night-$(date +%F) \
  --id <D-n> --title "<the question, short>" \
  --chosen "DEFERRED: <what you wanted>" --rationale "<why>" \
  --blocking --status proposed

The guard hook emits ready-to-run versions of these when it blocks a question. Decision ids use the form D$(date +%H%M%S)-$$ so same-second concurrent denies cannot overwrite each other via upsert.

What is NOT a decision: run summaries and status notes ("backlog run complete: 3 commits", "all workstreams landed", "morning batch answered") do not go in the ledger — they are outcomes, not forks. Put them in the events log (.night-mode-events.log) or the session report instead. Every ledger row must name a question that could have gone another way.

Morning report

report prints the whole overnight window: NEEDS ACTION (proposed + blocking, full cards), AUTO-DECIDED FYI (accepted, one line each), PUSHES (allowed list pushes from the events log), Accountability (deny count vs decision count, with a printed red flag when there are denies and zero logged decisions), and best-effort git log --since as commit evidence. Turning the flag off (off) renders the report automatically and writes .night-mode-pending-review; a fresh session then reminds about the report until report --ack clears the marker and truncates the events log.

CLI reference

bash $HOME/.claude/skills/cfn-night-mode/night-mode.sh on        # activate + doctor check
bash $HOME/.claude/skills/cfn-night-mode/night-mode.sh off       # unlink flag, print report, mark pending
bash $HOME/.claude/skills/cfn-night-mode/night-mode.sh status    # flag, pending, registrations, today count
bash $HOME/.claude/skills/cfn-night-mode/night-mode.sh report [--ack] [--since YYYY-MM-DD] [--project P]
bash $HOME/.claude/skills/cfn-night-mode/night-mode.sh doctor [--install]

Surface night-mode decisions only when status says pending review: yes OR a new night's slug has rows. Historical proposed rows are not open asks.

Window precedence for report: --since > pending marker > flag start timestamp > today. State lives in $HOME/.claude/ (dotfiles: .night-mode-active, .night-mode-pending-review, .night-mode-events.log) unless overridden. Test/sandbox overrides: CFN_NIGHT_MODE_DIR, CFN_NIGHT_SETTINGS, DB_PATH.

Hooks

Registrations live in ~/.claude/settings.local.json (machine-local, never committed). Install or repair with doctor --install; verify with plain doctor. Exit 1 means something is missing and is named in the output.

Dependencies

The flag file does not expire

$HOME/.claude/.night-mode-active holds only a timestamp and no TTL. It read

2026-08-27T04:44:42Z when inspected on 2026-09-02, six days stale, and was still gating

pushes and outward-facing work in every session that saw it. Check its age before treating

night mode as a live instruction rather than a leftover from a previous batch.

Decisions log through $HOME/.claude/skills/decision-log/record.sh (listed under

Dependencies above), which exists and works:

bash $HOME/.claude/skills/decision-log/record.sh --slug night-$(date +%F) --id D-n \
  --title "..." --chosen "..." --rationale "..."

This skill's own directory holds only SKILL.md and night-mode.sh and has never held a

record.sh. A 2026-09-01 handoff claimed that file was "missing from disk" and treated

decisions as unloggable, which sent a session hunting for a script that was never there.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.