Turn your AI agents into overnight contributors
gnhf runs your favorite AI coding agent in a headless loop, committing each successful iteration and rolling back failures so you wake up to clean, reviewable progress.

What it does
gnhf is a headless orchestrator for AI coding agents. You hand it a natural-language objective, point it at your agent of choice, and it runs an overnight loop: one small change per iteration, committed to a fresh branch on success, rolled back on failure. You return to a clean git branch, an accumulated notes.md memory file, and a permanent stdout summary of elapsed time, tokens burned, and diff stats.
The interesting bit
The value is in the failure hygiene. gnhf classifies errors into agent-reported failures (retry immediately), retryable hard errors (exponential backoff), and permanent errors (abort). If git commit itself fails, the uncommitted work is deliberately preserved so the next iteration can attempt repair rather than starting from zero. It also supports git worktrees, letting you run multiple overnight agents on the same repository in parallel without collision.
Key highlights
- Agent-agnostic: works out of the box with Claude Code, Codex, Rovo Dev, OpenCode, GitHub Copilot CLI, Pi, or generic ACP targets
- Resume support: restart on an existing
gnhf/branch and continue from where the previous run stopped - Runtime guardrails: hard caps on iterations, tokens, or natural-language stop conditions
- Live TUI with terminal title updates and a detailed exit summary covering branch state, log paths, and review commands
- Worktree mode for parallel runs, each isolated in its own branch and directory
Caveats
- Requires a clean git working tree to start, and
--current-branchcannot be combined with--worktree - Preserved worktrees and commit-repair states are left for manual review and cleanup
- Push failures abort the run immediately after the local commit is saved; there is no auto-pull or force-push
Verdict
Useful if you already pay for AI coding agents and want to convert idle hours into incremental, reviewable commits. Not for you if you need tight interactive control over every change.
Frequently asked
- What is kunchenguid/gnhf?
- gnhf runs your favorite AI coding agent in a headless loop, committing each successful iteration and rolling back failures so you wake up to clean, reviewable progress.
- Is gnhf open source?
- Yes — kunchenguid/gnhf is open source, released under the MIT license.
- What language is gnhf written in?
- kunchenguid/gnhf is primarily written in TypeScript.
- How popular is gnhf?
- kunchenguid/gnhf has 3.3k stars on GitHub and is currently accelerating.
- Where can I find gnhf?
- kunchenguid/gnhf is on GitHub at https://github.com/kunchenguid/gnhf.