From 0f70ea827c94df61ff0845bbdcb360a9f228f9dd Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sun, 16 Aug 2026 09:22:12 -0700 Subject: [PATCH] fix(sync-gbrain): remove the capability-check page file left in the user's repo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #2503. On worktree-pinned brains `gbrain put` materializes the checked page as _capability_check_.md in the current directory (the user's repo), and `gbrain delete` removes the page but not the file — every /sync-gbrain run left a stray file in the repo root. The check now deletes the materialized file explicitly after the page delete. Co-Authored-By: Claude Fable 5 --- sync-gbrain/SKILL.md | 4 ++++ sync-gbrain/SKILL.md.tmpl | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/sync-gbrain/SKILL.md b/sync-gbrain/SKILL.md index 45dc07ce8..48f003b22 100644 --- a/sync-gbrain/SKILL.md +++ b/sync-gbrain/SKILL.md @@ -1104,6 +1104,10 @@ if [ -f ~/.gbrain/config.json ] && \ fi fi gbrain delete "$SLUG" 2>/dev/null || true +# #2503: on worktree-pinned brains `gbrain put` can materialize the page as +# .md in the CURRENT directory (the user's repo), and `gbrain delete` +# removes the page, not the file. Remove the litter explicitly. +rm -f "./${SLUG}.md" 2>/dev/null || true ``` Then update CLAUDE.md based on capability state: diff --git a/sync-gbrain/SKILL.md.tmpl b/sync-gbrain/SKILL.md.tmpl index fa8becfd5..11471deb1 100644 --- a/sync-gbrain/SKILL.md.tmpl +++ b/sync-gbrain/SKILL.md.tmpl @@ -336,6 +336,10 @@ if [ -f ~/.gbrain/config.json ] && \ fi fi gbrain delete "$SLUG" 2>/dev/null || true +# #2503: on worktree-pinned brains `gbrain put` can materialize the page as +# .md in the CURRENT directory (the user's repo), and `gbrain delete` +# removes the page, not the file. Remove the litter explicitly. +rm -f "./${SLUG}.md" 2>/dev/null || true ``` Then update CLAUDE.md based on capability state: