feat: lean .wolf handoff files — TODO.md, ROADMAP.md, history.md rotation + buglog index - #63
Open
meketreve wants to merge 3 commits into
Open
Conversation
Two related handoff-file improvements, both wired through init and the
Stop hook, zero required config.
TODO.md as a first-class .wolf file
- init now creates .wolf/TODO.md (create-if-missing, so an existing file
is never overwritten) with {{PROJECT_NAME}}/{{DATE}} seeding, alongside
a src/templates/TODO.md template.
- Stop hook nudges (via additionalContext) when 3+ files changed but
TODO.md still has open items and wasn't touched this session.
- OPENWOLF.md + claude-rules document the STATUS.md (handoff) vs TODO.md
(checklist) split and the session-end update step.
- config: openwolf.todo.enabled (default true).
Auto-rotating STATUS.md journal
- A running session journal at the top of STATUS.md (a leading blockquote
of "> **SESSION N ..." / "> **SESSÃO N ..." blocks) grows every session
and makes the "read STATUS.md first" resume expensive. The Stop hook now
keeps only the newest N blocks and moves older ones to
.wolf/STATUS-archive.md (newest first).
- N = openwolf.status.max_sessions (default 2). No-op unless there are more
than N blocks, so most Stops touch nothing.
- Writes are atomic (tmp + rename) so a concurrent Stop hook from another
agent/session in the same project can never read a half-written file.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…OADMAP Generalizes the STATUS.md auto-rotation from the previous commit into a consistent "keep the files Claude reads every turn small" pass in the Stop hook. All defaults are safe; existing installs are untouched on upgrade. - Shared history file: STATUS.md journal + memory.md old sessions now rotate into a single .wolf/history.md (## Session Journal / ## Action Log), newest first. Configurable name via openwolf.status.archive_file (default history.md; replaces the earlier STATUS-archive.md). - memory.md rotation: chronological "## Session:" blocks are trimmed to the newest N (openwolf.memory.max_sessions, default 20); older blocks move to history.md. memory.md is oldest-first, handled explicitly. - buglog.md index: the Stop hook renders a compact index (id · tags · file · truncated message) from buglog.json when the source changes. The protocol now says scan buglog.md and open only the matching entry — never read the whole JSON. buglog.json is never modified. - cerebrum.md budget nudge: reminder (via additionalContext) when cerebrum.md exceeds ~2x openwolf.cerebrum.max_tokens. NOT auto-trimmed — it's curated knowledge, so Claude is asked to consolidate by hand. - ROADMAP.md: new create-if-missing file for planned-but-not-active work, so STATUS.md stays focused on the current quest. Documented in OPENWOLF.md + claude-rules. All writes are atomic (tmp + rename); every housekeeping step is best-effort and never breaks the Stop hook. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Caps live buglog.json at the newest N bugs (openwolf.buglog.max_entries, default 200) in the Stop hook; older bugs move to buglog-archive.json (chronological, append-only). Keeps the generated buglog.md index small without ever deleting a logged fix. Atomic writes, archive-first so a crash can only duplicate, never lose, a bug. Protocol notes that older bugs live in buglog-archive.json (checked only if the index has no match). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
A cohesive pass to keep the
.wolffiles that Claude reads every turn small, so long-lived projects don't pay a growing token tax on each session. On one real project (~130K-lineSTATUS.md, 200Kmemory.md, 270Kbuglog.json) the per-resume + per-fix read cost dropped dramatically with no data loss. Everything is opt-out-safe: existing installs are untouched on upgrade, and every mechanism is a no-op until a file actually grows.Two commits, one theme.
New managed files
TODO.md— working checklist (🔥 Now / ⏭️ Next / 💡 Later / ✅ Done), complementing STATUS.md's handoff narrative.create-if-missing, seeded with{{PROJECT_NAME}}/{{DATE}}.ROADMAP.md— planned-but-not-active work (milestones, backlog, someday), so STATUS.md stays focused on the current quest.create-if-missing.Auto-rotation into a shared
history.md(Stop hook)> **SESSION N .../> **SESSÃO N ...blocks) →history.md## Session Journal, keeping the newestopenwolf.status.max_sessions(default 2).## Session:blocks →history.md## Action Log, keeping the newestopenwolf.memory.max_sessions(default 20). memory.md is oldest-first; handled explicitly.history.md(name configurable viaopenwolf.status.archive_file) with both sections, newest-first. No-op unless a file exceeds its keep count.buglog index + rotation (Stop hook)
buglog.md(id · tags · file · truncated message) frombuglog.jsonwhen the source changes. Protocol now says scanbuglog.md, then open only the matching entry — never read the whole JSON.buglog.jsonat the newestopenwolf.buglog.max_entries(default 200); older bugs move tobuglog-archive.json(chronological, append-only). Keeps the index small without ever deleting a logged fix.cerebrum budget nudge
additionalContext) whencerebrum.mdexceeds ~2×openwolf.cerebrum.max_tokens. Not auto-trimmed — it's curated knowledge, so Claude is asked to consolidate by hand (keeping active preferences / Do-Not-Repeat).Config (all defaulted)
Safety
additionalContext(the v2 convention), except the pre-existing STATUS freshness check.Testing
tsc -p tsconfig.jsonandtsc -p tsconfig.hooks.jsonboth clean.SESSION/SESSÃOmarkers, empty stdin.history.md).🤖 Generated with Claude Code