fix(sync-gbrain): remove the capability-check page file left in the user's repo

Fixes #2503. On worktree-pinned brains `gbrain put` materializes the checked
page as _capability_check_<pid>.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 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-08-16 09:22:12 -07:00
co-authored by Claude Fable 5
parent bab192391f
commit 0f70ea827c
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -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
# <slug>.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:
+4
View File
@@ -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
# <slug>.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: