gnhf (Good Night, Have Fun)
Tell your coding agent one objective before bed; it commits small changes all night and leaves you a clean branch with a full log.
- Source repo
- kunchenguid/gnhf
- Stars
- ★ 4.3k
- Last updated
- 17d ago gnhf-v0.1.53
- FARS reviewed
- Nov 08, 2026 +1 new
- License
- MIT
- Primary language
- TypeScript
- FA score
- 55/100 · Major gaps
At a glance
- How it runs
- Works with
- Universal · cross-platformCodex · Claude Code
- Cost
- Free software; you pay for model usage
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- Developers who want an agent to push a long objective — reducing complexity, adding tests — overnight and review a ready branch in the morning.
- Not a fit if
- Teams that want a human to approve every commit as it happens
- Users without a signed-in agent CLI account or sufficient usage quota
- Projects outside a Git repository or needing the working tree free
- Maintenance
- Commits in the last 30 dayslast commit 2026-11-17latest release gnhf-v0.1.53 (2026-11-17)+2.7 ★/day over 7 days
- Source review
- 55/100 · Major gaps
What does this agent do, and when should you use it?
gnhf is a command-line orchestrator that turns an existing coding agent CLI into a continuous overnight loop. On start it verifies a clean Git working tree, creates a gnhf/ branch (or stays put with --current-branch), writes the objective to prompt.md, then repeatedly builds an iteration prompt, invokes the agent non-interactively, and decides what to do with the result. Each successful iteration becomes its own unsigned git commit with a summary appended to notes.md; failed iterations are rolled back with git reset --hard, and three consecutive failures abort the run. Run metadata — prompt, notes, stop condition, end-state.json and a JSONL debug log — lives under the local, git-ignored .gnhf/runs/ directory so the branch only holds intentional work. It is built for unattended use, with iteration and token caps, sleep prevention, worktree parallelism, usage-limit waiting and a permanent exit summary.
Running gnhf "<prompt>" inside a Git repository checks that the working tree is clean, writes prompt.md and creates or reuses a gnhf/ branch. In every loop it assembles an iteration prompt from the objective, the accumulated notes.md context and a final output JSON schema, then runs the chosen agent non-interactively — claude, codex exec, Copilot in JSONL mode, pi in JSON mode, cursor-agent in --print stream-json mode, a locally started opencode serve or acli rovodev serve process, or an ACP target through the bundled acpx. On a structured success it makes one unsigned commit and appends a note; on failure it resets the tree, counts the failure, backs off exponentially for retryable errors, and aborts immediately on permanent errors such as exhausted credit while printing the run log path. When a Claude usage window is exhausted it reads the reset time from the rate-limit event, waits, and retries the same iteration, bounded by --max-rate-limit-wait. Runtime caps are --max-iterations, --max-tokens and --stop-when; the interactive TUI keeps the terminal title updated with elapsed time, token totals and commit count, and Ctrl+C requests a graceful stop before a second press force-stops. At exit it prints a permanent summary with branch, elapsed time, iteration and token totals, branch diff stats, notes and log paths and review commands, while a JSONL debug log is written to .gnhf/runs/<runId>/gnhf.log.
- Developers who want an agent to push a long objective — reducing complexity, adding tests — overnight and review a ready branch in the morning.
- Teams running several independent tasks in one repository at once using --worktree for isolated branches and directories.
- Loose projects where --current-branch --push keeps a deployed or locally watched branch updated during the run.
- Users with an existing Claude Code, Codex or Copilot subscription who want to put idle quota to work.
- Teams reaching non-native agents (Gemini, Grok, custom ACP servers) while keeping one unified log and rollback semantics.
- Cost-conscious users who want hard budgets (iterations, tokens, rate-limit wait) in place before letting go.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
npm install -g gnhf
- Config files
~/.gnhf/config.yml
How do you install or deploy this agent?
Requires Node.js, Git and a signed-in coding agent CLI; run it inside a Git repository.
npm install -g gnhfFrom source:
git clone https://github.com/kunchenguid/gnhf.git
cd gnhf
corepack enable
pnpm install
pnpm run build
pnpm link --globalThe first run creates ~/.gnhf/config.yml with defaults (agent: claude); edit as needed:
agent: claude
maxConsecutiveFailures: 3
preventSleep: trueHow do you use this agent?
From a clean Git repository, hand it a single-sentence objective:
$ gnhf "reduce complexity of the codebase without changing functionality"Add an iteration and token budget for a shorter nap:
$ gnhf "reduce complexity of the codebase without changing functionality" \
--max-iterations 10 \
--max-tokens 5000000Run several tasks in parallel:
$ gnhf --worktree "implement feature X" &
$ gnhf --worktree "add tests for module Y" &Commit and push on the current branch after each successful iteration:
$ gnhf --current-branch --push "keep improving this app"Switch agent or model:
$ gnhf --agent codex --model gpt-5.4 "fix failing tests"
$ gnhf --agent 'acp:gemini' "polish the docs"Disable anonymous telemetry:
export GNHF_TELEMETRY=0Safety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
What are this agent's strengths and limitations?
- One command covers the whole loop: clean-tree check, branch creation, iteration, commit or rollback, and exit summary — no custom scripting.
- Agent-agnostic: seven native coding agent CLIs plus any acp:<target> or custom ACP command via the bundled acpx runtime.
- Clear failure semantics: commit on success, reset on failure, abort after three consecutive failures, and preserve uncommitted work when a commit fails so the next iteration can repair it.
- Overnight-specific polish: automatic waiting for exhausted Claude usage windows, sleep prevention, and a TUI showing tokens and commit count.
- --worktree lets multiple agents work the same repository in parallel without interference, and worktrees with commits are kept for review.
- Local .gnhf/runs/ keeps prompt, notes, end-state.json and a JSONL debug log for post-mortems without polluting the branch.
- It ships no model of its own: you must install and sign in to an agent CLI, and pay whatever that subscription or API costs.
- Requires a clean Git working tree and refuses directories without Git; --current-branch cannot be combined with --worktree.
- Sends anonymous usage telemetry to the author's self-hosted analytics by default until GNHF_TELEMETRY=0 is set.
- Some capabilities are limited upstream: Copilot does not expose full input/cache tokens, and OpenCode and Rovo Dev restrict model overrides.
- On Linux under systemd-inhibit sleep prevention, a worktree without commits can be left behind and needs manual git worktree remove.
- Unattended operation means accepting agent-authored commits; you still need to review the branch diff before merging.
How does this agent compare with similar options?
The README positions gnhf as a ralph (ghuntley.com/ralph) and autoresearch-style orchestrator, i.e. the same family of continuous-iteration agent loops; it does not name specific competing tools, so no product-by-product comparison is offered.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| gnhf (Good Night, Have Fun) This agent | 55 · Major gaps | CLIFree + model costs | ★ 4.3k | 17d ago | TypeScript | Codex · Claude Code |
| Vicoa | 67 · Some gaps | Desktop appFree + model costs | ★ 561 | today | Python | Codex · Claude Code |
| Cezar — AI Coding Agent Orchestrator | 62 · Some gaps | CLIFree | ★ 1.2k | today | TypeScript | Codex · Claude Code |
| Reemoat | 72 · Some gaps | — | ★ 31 | 4d ago | TypeScript | Codex · Claude Code |
How does FollowAgents rate this agent?
Why each dimension lost points
The README describes a separate gnhf branch as the default and offers current-branch, per-iteration push, and parallel worktree modes. Pushes and agent commands have external effects, and no per-action confirmation flow is shown, so least privilege, confirmation, and external-effect control are only partial. The README describes local run metadata, commits, failure rollback, logs, and agent restrictions; AGENTS.md says telemetry excludes prompts, branches, and repository identifiers, supporting some data-flow transparency. Evidence for credential handling and dependency review is limited. Successful commits can be reverted individually and failures are generally reset, but commit failures preserve uncommitted work, so rollback is not complete. Attribution is limited to the repository name and copyright text in LICENSE; publisher identity is unverified and earns no credit.
The README gives detailed behavior for iterations, failures, retries, usage-limit waits, resume, and interrupts, broadly consistent with the core responsibilities listed in AGENTS.md. package.json specifies Node 20+ and dependencies, but evidence about dependency availability and security is limited. Permanent-error aborts, log paths, and an exit summary are documented, though the evidence does not cover every failure case.
The README covers multiple coding agents, ACP, operating systems, and input methods; the skill describes Hands-Off and Companion scenarios. It distinguishes worker execution from host coordination and calls for bounded tasks and observable stop conditions. Trigger wording directly covers requests to run or supervise GNHF. Configuration, models, run limits, and worktrees support customization, but evidence for broader user groups and environment combinations is limited.
The README provides installation, configuration, CLI reference, examples, and known limitations. AGENTS.md points product behavior to the README and describes code ownership and maintenance conventions. Naming is consistent across the package, CLI, and skill. The MIT license file is complete, justifying a 3. package.json versioning, release automation notes, and CI workflow provide some release-maintenance evidence, but the supplied material contains no changelog contents or clear long-term maintainer responsibility; publisher identity is unknown.
The product organizes long-running agent work into small commits and provides run summaries, logs, resume, and failure handling, making results reasonably reviewable. It offers clear automation value over a manually repeated loop, though results depend on the chosen agent and prompt. Unlimited runtime is the default, pushes publish branch updates as iterations succeed, and usage-limit waits can extend runs; several caps are available, but users must set cost controls themselves.
Most README claims are tied to concrete commands, configuration fields, or described flows; AGENTS.md and CI workflows add code-map, CI, and maintenance evidence. The README notes a config example is pinned to a source fixture, but the supplied source code is only a truncated CLI excerpt, so individual product claims cannot be thoroughly corroborated across files. Documentation generally distinguishes supported behavior, defaults, and known limitations, allowing facts to be separated from assessment.
- This is a low-confidence assessment of the supplied static material. The README is detailed, but the source sample is incomplete and does not independently verify every implementation detail.
- Set iteration, token, or runtime limits appropriate to the task. With --push, each successful iteration pushes the current branch.
Recent releases
Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.
-
gnhf-v0.1.53 gnhf: v0.1.53
Release notes excerpt
[0.1.53](https://github.com/kunchenguid/gnhf/compare/gnhf-v0.1.52...gnhf-v0.1.53) (2026-11-16) Bug Fixes * renderer: redraw after rapid terminal resizing ([#250](https://github.com/kunchenguid/gnhf/issues/250)) ([bfd97af](https://github.com/kunchenguid/gnhf/commit/bfd97af1f737237544d1925e983de591316547e7))View on GitHub ↗ -
gnhf-v0.1.52 gnhf: v0.1.52
Release notes excerpt
[0.1.52](https://github.com/kunchenguid/gnhf/compare/gnhf-v0.1.51...gnhf-v0.1.52) (2026-11-02) Features * add --max-run-time flag to end a run after a time limit ([#247](https://github.com/kunchenguid/gnhf/issues/247)) ([f330845](https://github.com/kunchenguid/gnhf/commit/f330845edce4705b3e834de815dd1d2388539930)) Bug Fixes * keep iteration moons visible in narrow terminals ([#248](https://github.com/kunchenguid/gnhf/issues/248)) ([b66471f](https://github.com/kunchenguid/gnhf/commit/b66471fe70641e7d3943c8d18aaa4edaa275c84b))View on GitHub ↗ -
gnhf-v0.1.51 gnhf: v0.1.51
Release notes excerpt
[0.1.51](https://github.com/kunchenguid/gnhf/compare/gnhf-v0.1.50...gnhf-v0.1.51) (2026-10-03) Bug Fixes * agents: recover one empty OpenCode turn and require session completion ([#233](https://github.com/kunchenguid/gnhf/issues/233)) ([bc9c9a1](https://github.com/kunchenguid/gnhf/commit/bc9c9a1f5477a5c9c2690d95ecaebbb1b79b1150))View on GitHub ↗
FAQ
Does gnhf call an LLM itself?
What happens when an iteration fails or the agent crashes?
What if the Claude usage window runs out mid-run?
Can I run several agents on the same repository at once?
Does run data end up on my branch?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.