kunchenguid/gnhf

Before I go to bed, I tell my agents: good night, have fun

What it solves

gnhf (Good Night, Have Fun) is an autonomous orchestrator designed to keep AI coding agents running while the user is away. It solves the problem of manual oversight by automating a loop of small, committed, and documented changes toward a specific objective, ensuring that the user wakes up to a branch of clean, incremental work rather than a stalled process.

How it works

The tool operates as a loop that invokes a non-interactive coding agent to perform a task. For each iteration:

  1. Execution: It triggers the agent to make a change.
  2. Validation: If the change is successful, it creates a separate git commit and appends notes to a notes.md file for shared memory across iterations.
  3. Failure Handling: If an iteration fails, it performs a git reset --hard to roll back changes, unless it was a commit failure, in which case it preserves the work for the next iteration to repair.
  4. Persistence: It manages runs using a .gnhf/runs/ directory to store prompts, logs, and metadata, allowing runs to be resumed later.
  5. Rate Limit Management: It automatically detects rate limits (e.g., from Claude) and waits for the reset time before resuming the run.

Who it’s for

Developers who use AI coding agents and want to perform long-running tasks (like refactoring or feature implementation) without needing to manually trigger every step or review every change in real-time.

Highlights

  • Incremental Commits: Every successful step is committed separately, allowing for easy cherry-picking or reverting.
  • Agent-Agnostic: Works with various coding agent CLIs and ACP targets.
  • Worktree Mode: Supports running multiple agents on the same repository simultaneously using isolated git worktrees.
  • Runtime Caps: Includes limits for maximum iterations, total tokens, and custom stop conditions (--stop-when).
  • Live Status: Provides a real-time terminal title update with token totals and commit counts.

Related

  • Project
  • Project
  • Project
  • Project
  • Project