kunchenguid/gnhf

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

What it solves

gnhf is an autonomous orchestrator for coding agents that allows them to work on a codebase over long periods (such as overnight) without constant human supervision. It solves the problem of "empty-handed" wake-ups by ensuring agents make small, committed, and documented incremental changes toward a goal, rather than attempting one giant, risky leap.

How it works

The tool wraps existing coding agent CLIs in a loop. For each iteration, it:

  1. Prompts the Agent: Injects a goal and a notes.md file (which acts as shared memory across iterations).
  2. Executes: Runs the agent in non-interactive mode.
  3. Validates & Commits: If the agent succeeds, gnhf creates a git commit and appends to the notes. If it fails, it rolls back the changes using git reset --hard (unless it was a commit failure, which it preserves for repair).
  4. Handles Limits: It automatically manages rate limits (e.g., Claude's usage windows) by waiting for the reset time before resuming.
  5. Manages State: It can run on a dedicated gnhf/ branch, the current branch, or in isolated git worktrees to allow multiple agents to work on the same repo simultaneously.

Who it’s for

Developers who use AI coding agents and want to automate long-running refactors, feature implementations, or codebase cleanups without needing to monitor the terminal every few minutes.

Highlights

  • Agent-Agnostic: Works with popular coding agent CLIs and any ACP target.
  • Incremental Progress: Every successful step is committed to git, allowing for easy cherry-picking or reverts.
  • Worktree Support: Run multiple agents concurrently on the same repository in isolated directories.
  • Smart Rate-Limit Handling: Automatically sleeps through API usage windows and resumes work.
  • Resume Capability: Can pick up a previous run from an existing branch if interrupted.

Related

  • Project
  • Project
  • Project
  • Dispatch
  • Project