From 3021fe60185a35f88b5f0e953e63579c9ac49dcb Mon Sep 17 00:00:00 2001 From: Joseph Fung Date: Tue, 28 Apr 2026 12:42:54 -0400 Subject: [PATCH 1/2] fix: add pull-before-branch instruction to CLAUDE.md injection Instructs Claude to always pull latest main before creating a worktree or branch, avoiding stale-code rebases and merge conflicts. Bumps version to 0.5.1. --- package.json | 2 +- settings/claude-md.md | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index d3a0e2e..d503fa4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "trimkit", - "version": "0.5.0", + "version": "0.5.1", "description": "Claude Code guardrails and utilities", "repository": { "type": "git", diff --git a/settings/claude-md.md b/settings/claude-md.md index e85cf06..766d1b4 100644 --- a/settings/claude-md.md +++ b/settings/claude-md.md @@ -1,5 +1,19 @@ # TrimKit Hook Compatibility +## Always pull before branching + +Before creating a worktree, branch, or starting any feature work, pull the +latest from the remote main branch first: + +```bash +git pull origin main +``` + +Branching from stale code leads to unnecessary rebases and merge conflicts. +Do this every time — no exceptions. + +## No-chaining hook + TrimKit installs a `no-chaining` hook that blocks `&&`, `||`, and unsafe pipes in Bash tool calls. Use the patterns below to avoid triggering it. From 10c0622380268b2d8a850798d95d57892c2d85bb Mon Sep 17 00:00:00 2001 From: Joseph Fung Date: Tue, 28 Apr 2026 12:43:47 -0400 Subject: [PATCH 2/2] fix: use --ff-only for safer pull before branching Prevents git pull from silently creating a merge commit if local main has diverged. --ff-only aborts cleanly, surfacing the problem instead. --- settings/claude-md.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings/claude-md.md b/settings/claude-md.md index 766d1b4..1314535 100644 --- a/settings/claude-md.md +++ b/settings/claude-md.md @@ -6,7 +6,7 @@ Before creating a worktree, branch, or starting any feature work, pull the latest from the remote main branch first: ```bash -git pull origin main +git pull --ff-only origin main ``` Branching from stale code leads to unnecessary rebases and merge conflicts.