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

At a glance

How it runs
CLI
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
Node.jsGitpnpm (for source builds)a coding agent CLI such as claude, codex, copilot, pi, cursor-agent, acli rovodev, or opencodeShell / CLINetwork accessLocal filesystem
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

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.

  1. Developers who want an agent to push a long objective — reducing complexity, adding tests — overnight and review a ready branch in the morning.
  2. Teams running several independent tasks in one repository at once using --worktree for isolated branches and directories.
  3. Loose projects where --current-branch --push keeps a deployed or locally watched branch updated during the run.
  4. Users with an existing Claude Code, Codex or Copilot subscription who want to put idle quota to work.
  5. Teams reaching non-native agents (Gemini, Grok, custom ACP servers) while keeping one unified log and rollback semantics.
  6. 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 gnhf

From source:

git clone https://github.com/kunchenguid/gnhf.git
cd gnhf
corepack enable
pnpm install
pnpm run build
pnpm link --global

The first run creates ~/.gnhf/config.yml with defaults (agent: claude); edit as needed:

agent: claude

maxConsecutiveFailures: 3

preventSleep: true

How 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 5000000

Run 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=0

Safety 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)

Local shell command execution

Can run terminal commands; pair with approval gates or container/OS sandboxing.

Local filesystem read/write

Modifies local files; work on a clean Git branch or dedicated worktree.

Outbound network access

Makes outbound requests; verify telemetry settings and model data routing on private repos.

What are this agent's strengths and limitations?

Pros
  • 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.
Limitations
  • 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?

FollowAgents source review · FARS-2.1
Major gaps
55/ 100 5-point scale 2.8 / 5
This review covers the source as of Nov 08, 2026. The project has shipped 1 stable release(s) since, which have not been re-reviewed. The score and verdict describe the reviewed version only. Recent releases ↓
Trust 12/29
Reliability 8/14
Adaptability 12/18
Convention 12/18
Effectiveness 7/13
Verifiability 4/8
Why each dimension lost points
Trust12 / 29 · 2.1/5

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.

Reliability8 / 14 · 2.9/5

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.

Adaptability12 / 18 · 3.3/5

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.

Convention12 / 18 · 3.3/5

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.

Effectiveness7 / 13 · 2.7/5

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.

Verifiability4 / 8 · 2.5/5

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.

Risks and how to mitigate them
  • 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.
Evidence confidence: Low Reviewed Nov 08, 2026 Reviewed revision 3e1179f8460a New commits since this review; the score may not cover them
See the full review method →
Maintain this project? Add the FARS badge to your README

The badge shows the current review score and verdict and links back to this page. It refreshes about once an hour after a re-review.

FARS

[![FARS review](https://followagents.com/badge/gnhf.svg)](https://followagents.com/en/agents/gnhf)
<a href="https://followagents.com/en/agents/gnhf"><img src="https://followagents.com/badge/gnhf.svg" alt="FARS review"></a>

Recent releases

Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.

  1. 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 ↗
  2. 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 ↗
  3. 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?
No. It only orchestrates: it drives an agent CLI you have already installed and signed in to, so the model, quota and billing belong to that agent.
What happens when an iteration fails or the agent crashes?
Failed iterations are rolled back with git reset --hard, except commit failures which keep the uncommitted work for repair. Retryable errors back off exponentially; three consecutive failures or a permanent error such as low credit aborts the run and prints the log path.
What if the Claude usage window runs out mid-run?
gnhf reads the reset time from the rate-limit event, rolls back that iteration without counting it as a failure, waits, then retries automatically. --max-rate-limit-wait bounds total waiting, with a 24h default cap.
Can I run several agents on the same repository at once?
Yes, with --worktree, which creates a separate git worktree and branch per run. Worktrees that received commits are preserved after the run for review, merge or cherry-pick.
Does run data end up on my branch?
No. The prompt, notes, end-state.json and gnhf.log live under the local, git-ignored .gnhf/runs/ directory, so the branch contains only the commits from successful iterations.
Was this page helpful?
View on GitHub ↗ Install ↓

Host ecosystems

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related concepts