Skip to content

fix(CLAUDE.md): .hermit-quit now cancels the recurring cron trigger, not just the current pass - #194

Merged
ytnobody merged 1 commit into
developfrom
hermit/ytnobody/issue-192
Jul 28, 2026
Merged

fix(CLAUDE.md): .hermit-quit now cancels the recurring cron trigger, not just the current pass#194
ytnobody merged 1 commit into
developfrom
hermit/ytnobody/issue-192

Conversation

@ytnobody

Copy link
Copy Markdown
Owner

Summary

Closes #192.

Superintendent cycle step 2 said .hermit-quit is "a terminal stop" that
requires starting /hermit again to resume — but in practice it only
skipped work for the pass that detected the file. Any recurring
session-only cron job registered in step 1 kept firing /hermit every
tick regardless, so every subsequent tick burned a full pass just to
re-detect the same quit file, until the Claude session itself expired
(up to 7 days) or someone manually ran CronDelete.

  • Updated CLAUDE.md's Superintendent cycle step 2 to explicitly call
    CronList to find the recurring /hermit job and CronDelete to
    cancel it before ending the pass, so quit actually stops the
    autonomous loop rather than just leaving it spinning on no-ops.
  • Investigated hermit run (Issue hermit run: ループを Claude Code セッションの外に出し、HERMIT 自身のプロセスが所有する #181 / PR feat(run): add hermit run — Superintendent loop owned by HERMIT's own process #189, internal/runloop/runloop.go):
    it's a separate OS process loop that already watches .hermit-quit
    directly (runloop.go:145) and stops its own tick loop — it never
    registers or depends on session-only CronCreate/CronList/CronDelete
    jobs, so it isn't affected by this bug. Noted this explicitly in the
    step 2 text so the distinction is documented rather than assumed.
  • Applied the identical fix to cmd/hermit/templates/CLAUDE.md.tmpl
    (the scaffold used by hermit init) to keep the two in sync, per
    existing repo convention.
  • Left step numbering, .hermit-paused handling (step 3), and step 1's
    cron-registration logic untouched — this is purely additive detail
    inside step 2, no steps inserted/removed/renumbered.

Assumptions

  • Kept the added detail as sub-bullets under step 2 rather than
    inserting new top-level numbered steps, to avoid renumbering every
    step that's cross-referenced by number elsewhere in the document
    (e.g. step 5/6/7's back-references). This satisfies the Issue's
    scope constraint ("changed only step 2's procedure").
  • No Go test exists asserting on CLAUDE.md's Superintendent-cycle step
    content/structure beyond substring checks in
    cmd/hermit/inprocess_test.go (e.g. presence of
    ### Superintendent cycle (one pass, run inline), which still pass;
    no new test was added since this is a documentation-only change with
    no new tool-calling behavior to unit test.

Test plan

  • go build ./...
  • go test ./cmd/hermit/... ./internal/runloop/... (all pass)
  • Manually diffed CLAUDE.md vs cmd/hermit/templates/CLAUDE.md.tmpl to confirm step 2 text stayed in sync

…ot just the current pass (Closes #192)

Superintendent cycle step 2 previously only skipped the current pass when
.hermit-quit was found, leaving any session-only cron job registered in
step 1 to keep firing /hermit every tick indefinitely. Step 2 now
instructs calling CronList/CronDelete to actually cancel the recurring
job before ending the pass, and notes that hermit run (a separate OS
process, internal/runloop/runloop.go) already watches .hermit-quit
itself and is unaffected. Applied the same fix to the CLAUDE.md.tmpl
scaffold template used by `hermit init`.
@ytnobody

Copy link
Copy Markdown
Owner Author

Superintendent review (HIGH risk — CLAUDE.mdがhigh-riskパスのため)

diffを確認しました。CLAUDE.mdとその複製であるcmd/hermit/templates/CLAUDE.md.tmplのstep 2記述に、.hermit-quit検知時にCronList/CronDeleteで既存の定期トリガーを実際にキャンセルする手順を追加しただけの、純粋なドキュメント修正です(2ファイル、+8/-2行)。

  • hermit run(OSプロセスループ)は.hermit-quitを直接監視しており本問題の影響を受けないことをコード(internal/runloop/runloop.go)から確認した旨も明記されており、Issue #192の要件・受け入れ条件を満たしています。
  • 両ファイルの記述は同期しており、既存のステップ番号への影響もありません。
  • CIは全てpass、developとのマージ状態もCLEANです。

安全にマージできると判断します。

@ytnobody

Copy link
Copy Markdown
Owner Author

⚠️ HERMIT: HIGH risk detected.
Reasons: [CLAUDE.md is in a high-risk path]

@ytnobody
ytnobody merged commit 3e442fc into develop Jul 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(CLAUDE.md): .hermit-quit only skips the current pass, doesn't cancel the recurring cron trigger

1 participant