commit-cadence
Her turn sonunda working tree'yi ölçen ve hâlâ commit edilmemiş olanı adlandıran bir Claude Code Mod'u. Böylece biten iş session'ın sonuna yığılmak yerine biter bitmez commit edilir.
Ne yapar
Her main-loop turn sonunda mod, session'ın başladığı dizinde
git status --porcelain=v1 -zkomutunu çalıştırır ve adlandırdığı path'leri okur, stage'lenmiş olsun olmasın. Ignore edilen dosyalar ve üretilen.claude/dizini dışarıda kalır.Kirli bir tree, path kümesi başına bir kere raporlanır. Hiçbir şeyi değiştirmeyen sonraki bir turn hiçbir şey söylemez; yeni ya da kalkmış bir path tekrar raporlanır. Böylece uzun bir edit serisi aynı satırı tekrarlamaz.
Kişi bulguyu sidebar stream'inde tek satır olarak okur, sidebar kapalıyken tek transcript satırı olarak:
commit-cadence: 2 uncommitted file(s): src/app.ts, src/new.tsBir sonraki prompt yalnız modelin okuduğu bir not taşır: neyin commit edilmediğini ve biten, doğrulanmış her parçanın şimdi kendi commit'ine ait olduğunu. Not rapor başına bir kere borçlanılır, yani bir prompt onu taşır, sonraki taşımaz.
Temizlenen bir tree bulguyu yeşil bir satırla kapatır:
the working tree is clean again./commit-cadenceo anda ölçer ve ayarı ile tree'nin ne tuttuğunu yazar.
Hiçbir şeyi durdurmaz. Neyin commit'e değer olduğuna kişi karar verir; model notu bir gate olarak değil, bir hatırlatma olarak okur.
Komut
/commit-cadence ayar ve tree'nin şu an ne tuttuğu
/commit-cadence on | off varsayılan on
Kurulum
claude plugin marketplace add KilimcininKorOglu/claude-code-mods
claude plugin install commit-cadence@kilimcininkoroglu-mods
Function hook'lar early access. Flag olmadan hiçbir şey yüklenmez. Flag'i kalıcı yapmak için ~/.claude/settings.json dosyasına ekleyin:
{ "env": { "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1" } }
Kurulumdan sonra
- Claude Code'u yeniden başlatın.
- Bulgu satırları için sidebar mod'unu kurun. O olmadan mod satırları transcript'e yazar.
Nereye uzanır
Claude Code 2.1.278 üzerinde claude plugin validate ile doğrulandı:
❯ ./register.ts hooks: session.start, command.run{command=commit-cadence}, turn.complete, prompt.submit
❯ ./register.ts calls: $.command.register, $.process.run (via readTree), $.session.cwd, $.sidebar.set (via toPerson), $.store.get, $.store.set (via setEnabled), $.ui.log (via toPerson)
Reach L2, bir process çalıştırır.
1. Okur: session'ın kendi dizininde git status'ün adlandırdığı path'leri. Hiçbir dosya içeriğini, prompt'u ya da cevabı okumaz.
2. Çalıştırır: git status --porcelain=v1 -z, biten her turn'de bir kere ve her /commit-cadence komutunda bir kere
3. Gönderir: modele, commit edilmemiş dosyaların sayısını ve ilk altı path'ini, onları commit etmekle ilgili tek cümleyle
4. Saklar: $.store içinde on/off ayarını; raporlanan path'ler bellekte yaşar ve session ile biter
5. Düşman girdi: çizilen ve gönderilen tek metin git'in kendi yazdığı path'lerdir, altı adla ve bir sayıyla sınırlanmış
Sınırlar
- Tree ölçülür, yazarlık değil. Sizin elle değiştirdiğiniz bir dosya, modelin değiştirdiğiyle aynı sayılır.
- Ölçüm session'ın kendi dizinidir. Aynı session'da başka bir yerdeki repository okunmaz.
- Bir subagent'ın turn'ü ölçülmez; yalnız main loop'un sonu ölçülür.
- Sadece ignore edilen bir path dışarıda kalır,
.claude/altındaki her şey de, çünkü o dizin üretilmiştir. - Dosyaları adlandırır, hunk'ları değil. İki alakasız değişiklik tutan bir dosya tek path olarak okunur.
- Hiçbir şey commit edilmez ve hiçbir şey durdurulmaz.
Geliştirme
make install # eslint, typescript-eslint, typescript
make lint # complexity limiti 10, üstünde build'i düşürür
make typecheck # /plugin-types ile üretilen .claude/types/ gerekir
make validate
make test # claude plugin test
commit-cadence
A Claude Code Mod that measures the working tree at the end of each turn and names what is still uncommitted, so finished work is committed as it lands instead of piling up for the end of a session.
What it does
At the end of each main-loop turn the mod runs
git status --porcelain=v1 -zin the directory the session started in and reads the paths it names, staged or not. Ignored files and the generated.claude/directory are left out.A dirty tree is reported once per set of paths. A later turn that changed nothing says nothing, and a new or removed path reports again, so a long stretch of edits does not repeat the line.
The person reads the finding as one line in the sidebar stream, or as one transcript line while the sidebar is closed:
commit-cadence: 2 uncommitted file(s): src/app.ts, src/new.tsThe next prompt carries a note only the model reads: what is uncommitted, and that each finished and verified piece belongs in its own commit now. The note is owed once per report, so one prompt carries it and the next does not.
A tree that went clean closes the finding with a green line:
the working tree is clean again./commit-cadencemeasures on the spot and prints the setting and what the tree holds.
It stops nothing. The person decides what is worth a commit, and the model reads the note as a reminder, not as a gate.
Command
/commit-cadence the setting and what the tree holds right now
/commit-cadence on | off on by default
Install
claude plugin marketplace add KilimcininKorOglu/claude-code-mods
claude plugin install commit-cadence@kilimcininkoroglu-mods
Function hooks are early access. Nothing loads without the flag. To keep it on, add this to ~/.claude/settings.json:
{ "env": { "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1" } }
After installing
- Restart Claude Code.
- Install the sidebar mod for the finding lines. Without it the mod writes them to the transcript.
What it can reach
Validated with claude plugin validate on Claude Code 2.1.278:
❯ ./register.ts hooks: session.start, command.run{command=commit-cadence}, turn.complete, prompt.submit
❯ ./register.ts calls: $.command.register, $.process.run (via readTree), $.session.cwd, $.sidebar.set (via toPerson), $.store.get, $.store.set (via setEnabled), $.ui.log (via toPerson)
Reach L2, it runs a process.
1. Reads: the paths git status names in the session's own directory. It reads no file content, no prompt and no answer.
2. Runs: git status --porcelain=v1 -z, once per turn that ends and once per /commit-cadence
3. Sends: to the model, the count and the first six paths of the uncommitted files, with one sentence about committing them
4. Persists: in $.store, the on/off setting; the reported paths live in memory and end with the session
5. Hostile input: the only text drawn and sent is the paths git itself printed, cut to six names and a count
Limits
- The tree is measured, not the authorship. A file you changed by hand counts exactly as one the model changed.
- The measure is the session's own directory. A repository somewhere else in the same session is not read.
- A subagent's turn is not measured; only the main loop's end is.
- A path that is only ignored is left out, and so is everything under
.claude/, because that directory is generated. - It names files, never hunks. A file that holds two unrelated changes reads as one path.
- Nothing is committed and nothing is stopped.
Development
make install # eslint, typescript-eslint, typescript
make lint # complexity limit 10, fails the build above it
make typecheck # needs .claude/types/ from /plugin-types
make validate
make test # claude plugin test