Skip to content

Commit 12db361

Browse files
committed
chore(wheelhouse): cascade template@2e2be56
Auto-applied by socket-wheelhouse sync-scaffolding into socket-cli. 43 file(s) touched: - .claude/hooks/claude-md-size-guard/index.mts - .claude/hooks/claude-md-size-guard/test/index.test.mts - .claude/hooks/dirty-worktree-on-stop-reminder/README.md - .claude/hooks/dirty-worktree-on-stop-reminder/index.mts - .claude/hooks/dirty-worktree-on-stop-reminder/package.json - .claude/hooks/dirty-worktree-on-stop-reminder/test/index.test.mts - .claude/hooks/dirty-worktree-on-stop-reminder/tsconfig.json - .claude/hooks/drift-check-reminder/README.md - .claude/hooks/drift-check-reminder/index.mts - .claude/hooks/immutable-release-pattern-guard/README.md - .claude/hooks/immutable-release-pattern-guard/index.mts - .claude/hooks/immutable-release-pattern-guard/package.json - .claude/hooks/immutable-release-pattern-guard/test/index.test.mts - .claude/hooks/immutable-release-pattern-guard/tsconfig.json - .claude/hooks/markdown-filename-guard/index.mts - .claude/hooks/markdown-filename-guard/test/index.test.mts - .claude/hooks/no-fleet-fork-guard/index.mts - .claude/hooks/no-fleet-fork-guard/test/index.test.mts - .claude/hooks/no-revert-guard/index.mts - .claude/hooks/no-revert-guard/test/index.test.mts ... and 23 more
1 parent 854c0b4 commit 12db361

43 files changed

Lines changed: 2225 additions & 230 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/hooks/claude-md-size-guard/index.mts

Lines changed: 36 additions & 87 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.claude/hooks/claude-md-size-guard/test/index.test.mts

Lines changed: 28 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# dirty-worktree-on-stop-reminder
2+
3+
Stop hook that emits a stderr reminder at turn-end if `git status
4+
--porcelain` shows any modified, untracked, or staged-uncommitted
5+
files in the harness project dir.
6+
7+
## Why
8+
9+
CLAUDE.md "Don't leave the worktree dirty" already states the rule:
10+
finish a code change → commit it. The complementary
11+
`no-orphaned-staging` hook catches only staged-but-uncommitted index
12+
entries; this hook closes the broader gap — **unstaged modifications
13+
and untracked files** that the agent left behind because they came
14+
from a `pnpm run format` sweep, a script side-effect, or
15+
"I'll get to it later."
16+
17+
Past failure: an agent committed surgical work (T1, T2) but left 28
18+
formatter-touched files dirty because they came from an earlier
19+
`pnpm run format` sweep. The agent announced "intentional pause"
20+
in the turn summary instead of resolving the state. The next session
21+
inherited a 28-file diff with no clear ownership.
22+
23+
## What it does
24+
25+
Runs `git status --porcelain` in `$CLAUDE_PROJECT_DIR`. Filters out
26+
untracked-by-default trees (`vendor/`, `third_party/`, `upstream/`,
27+
`additions/source-patched/`, `deps/`, `external/`, `pkg-node/`,
28+
`*-bundled/`, `*-vendored/`) so vendor drops don't trip the reminder.
29+
Reports the remaining dirty paths plus a 3-option remediation menu:
30+
commit / revert / explicitly announce.
31+
32+
Never blocks. Informational stderr only — the Stop event has no tool
33+
call to refuse.
34+
35+
## Disable
36+
37+
```bash
38+
SOCKET_DIRTY_WORKTREE_REMINDER_DISABLED=1
39+
```
40+
41+
## Related
42+
43+
- `no-orphaned-staging` — Stop hook for staged-but-uncommitted hunks
44+
- `node-modules-staging-guard` — PreToolUse block for `git add -f` of
45+
`node_modules/` (bypass: `Allow node-modules-staging bypass`)
46+
- `overeager-staging-guard` — PreToolUse block for `git add -A` /
47+
`git add .` (bypass: `Allow add-all bypass`)
48+
- Fleet doc: [`docs/claude.md/fleet/worktree-hygiene.md`](../../docs/claude.md/fleet/worktree-hygiene.md)

0 commit comments

Comments
 (0)