Skip to content
Original
Reddit · ClaudeCode / Codex / VibeCoding· /u/Crunchy-Nut1·· 1 day agoAI score71

windvane:自动起草检查点、在合适时机压缩并自行恢复的 Claude Code 插件

Original title: Memory plugins keep what you knew. I built one that keeps where you were: windvane, a Claude Code plugin that drafts the checkpoint, compacts at the right point and resumes by itself (MIT, no deps)

The title and summary in the selected language are awaiting translation.

AI overview

作者发布 windvane,一个 MIT 许可、无依赖的 Claude Code 插件,用 Python 引擎在会话中自动看护上下文:recorder 根据任务列表、编辑、提交和上一条回复起草检查点,模型一次调用即可接受或改一个字段;插件监控上下文填充,在检查点落盘后于下一个回合边界压缩,并自行发一条提示让模型从检查点继续。

Full text
Memory plugins keep what you knew. I built one that keeps where you were: windvane, a Claude Code plugin that drafts the checkpoint, compacts at the right point and resumes by itself (MIT, no deps)

I've been running long Claude Code sessions for months, multi-day builds and some overnight unattended runs. I had a handoff routine long before this: a checkpoint before every compaction, restored at the start of the next window. It worked, but it needed a babysitter, and that was me: watching the context fill, telling the model to write the checkpoint, telling it to compact, checking that it picked the right thing back up. Miss the moment and auto-compaction hits mid-task and the summary drops the one detail that mattered.

So I built windvane. It's a context monitor that does the babysitting. It watches the fill, has the checkpoint drafted from what the session already did, compacts at a turn boundary once the state is banked, and sends the one prompt that gets the model moving again. The model keeps working without me stepping in and without stalling near a full window. The context stays lean, the task stays on track, and token use should come down, since the window is swapped at a chosen point instead of running to the limit. Under the hood it's a Claude Code plugin (the hooks-module kind, so it hot-reloads and there's no MCP server) with a small Python engine behind it. The idea underneath: the machine records the state, so the model never has to write it down.

What it does:

  • A recorder drafts the checkpoint from what the session already did: the task list, the edits, the commits, the closing paragraph of the last reply. The model accepts it with one bare call, or amends one field. If it saves at the top of a turn and then edits, the record is brought up to date when the turn ends, so what gets restored is the state at the end of the turn, not the start.
  • The plugin watches the context fill. Once a deliberate save has landed inside the checkpoint band, it compacts at the next turn boundary. Then it sends one prompt of its own, so the model picks up from the checkpoint without me typing anything.
  • After a compaction, the project rules and the checkpoint sit right after the summary. Every subagent gets the rules at the head of its prompt too.
  • Tool results get trimmed to a budget (head and tail kept) and secrets in them are redacted before they're stored.
  • Project memory and rules are one tool call away. A rule can carry a detector that matches shell commands; in unattended mode a matching command is refused instead of logged.
  • A token and cost ledger per project per day.
  • Session mining: it indexes your past transcripts, so you can ask when something was decided or what went wrong with a file. There's an optional embedding model. On my store of 200k chunks, hybrid search found the right chunk at MRR@10 0.25 against 0.05 for keyword alone, so it earns the install.

It's also a mod, not only hooks. Claude Code's newer plugin API lets a plugin draw in the terminal, and windvane uses it: a status segment with the context fill and the age of the last checkpoint, a band above the prompt that says what windvane last put in front of the model, a /windvane pane with the checkpoint, the rules and the mistakes for the file you're on, and the dialog on first run that offers to install the embedding model. It hot-reloads while you work on it, and there's no MCP server to keep alive.

How this differs from claude-mem and the other memory plugins: those keep facts for later, things you learned, decisions, observations, searchable next session. windvane is about the session you're in. The problem it fixes isn't "I forgot what we knew", it's "the window filled at the wrong moment and the summary dropped where we were". So the record is the resume state: the task, the step in hand, what's done, what's next, the files, the warnings. The model never writes it. The recorder drafts it from the task list, the edits, the commits and the last reply, and the model accepts it with one call. Then the plugin, not the model, decides when to compact: inside the band, once a save has landed, at a turn boundary. After that it sends one prompt of its own and the work carries on. The rules and the checkpoint also sit right after the summary and at the head of every subagent's prompt, so the state is wherever the model is. There's a memory store and a session miner in it too, but they're the supporting cast. If you run a memory plugin already, this sits beside it; it's doing a different job.

What it doesn't do: it doesn't change the model, and apart from the trimming it doesn't shrink what the model reads per turn. The win is that I stopped starting new chats per task and stopped compacting by hand, and so far it has come back from every compaction with the right checkpoint.

Install is clone, add as a marketplace, install. Python 3.10 or later, no dependencies for the engine. MIT.

Where it stands: 1.0.0, one person's workflow, tested on Windows and WSL with Claude Code 2.1.x. The first-run prompt and the headless halt were tested this week. I'd like to hear where it breaks for you.

Repo: https://github.com/20alexl/windvane The gif in the README is a real session, recorded with the plugin loaded: the model reads a document, the status segment asks for a checkpoint, the model saves and edits, the plugin compacts at the turn boundary and the session carries on from the checkpoint without anyone typing.

It replaces an earlier project of mine (claude-engram, now private) that ran the same engine as settings hooks plus an MCP server. If you used that, there's an import command for the store.

submitted by /u/Crunchy-Nut1 to r/ClaudeCode
[link] [留言]

Source: Reddit · ClaudeCode / Codex / VibeCoding · reddit.com