/dotfiles:shared-tree-commitfrom Kevin's dotfiles skills
Provides git recipes for staging, committing, and pushing edits in a shared checkout where multiple agent sessions work concurrently, avoiding conflicts and rewriting other sessions' files.
Ships in Kevin's dotfiles skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The user runs agent sessions in parallel in one checkout. A second session may commit, stage or rewrite a file while this one works. Each recipe below commits, pushes or undoes the work of this session alone.
HEAD again before you stage. Do not trust an earlier git status.git status: it lists the other session's files too.git commit -a. A plain git commit also takes the files the other session staged. Commit with git commit -- <your paths>, which leaves its index as it was.git commit -- <path> takes that path from the working tree, the other session's hunks included. Stage a blob in its place:
HEAD for text you never touched.git hash-object -w, then git update-index --cacheinfo 100644,<sha>,<path>. This never rewrites a file the other session is still writing.git commit once git diff --cached --name-only lists only your paths.When git diff shows your edits and its edits in separate hunks, a filtered patch is shorter. It is the scripted form of git add --patch, and it writes the index only:
git diff --no-prefix -- <path> to a file outside the tree.@@ line to the line before the next @@ line. Keep the header lines above the first hunk.git apply --cached -p0 --check <patch>, then the same command without --check.git diff --cached -- <path> shows only your hunks, and git diff -- <path> shows only its hunks.git commit once git diff --cached --name-only lists only your paths.Use the blob route when one hunk holds edits of both sessions, and for a file the other session keeps editing, like a changelog: it can change between your check of its diff and git commit -- <path>.
When git diff --cached --name-only also lists files the other session staged, commit on a temporary index instead: GIT_INDEX_FILE=<scratch> git read-tree HEAD, update-index your blobs, write-tree, then git commit-tree -S <tree> -p HEAD. Move the branch as "Commit authorized, push not authorized" says.
git hash-object matches the blob on the index line of a git diff taken before your first edit.For each commit, run a plain git commit once git diff --cached --name-only lists only that path. git commit -- <path> takes that path from the working tree, the other session's hunks included.
To regenerate a derived artifact from that reconstruction, export git archive HEAD to a scratch directory and run the generator under uv run --project <scratch>. A generator that reads Git, like a version from git log, needs a clone instead: git clone --no-hardlinks <repo> <scratch>, then run the copy of the generator in the clone. A swap of files in the shared tree races the other session.
The other session's pending copy of a file you both edit still lacks your line, so its next commit of that file reverts it. Once yours is in, add your lines to its working copy with an exact-match edit.
To push your work while its commits sit unpushed on the branch:
origin/<branch> with a temporary index: GIT_INDEX_FILE=<scratch> git read-tree origin/<branch>, then update-index and write-tree.git commit-tree -S. Without -S, commit-tree ignores commit.gpgsign and writes an unsigned commit.<sha>:refs/heads/<branch>.When your work builds on those commits, ask the user before you push them with it.
Work not written yet is simpler in a git worktree add --detach at origin/<branch>: run uv sync --frozen --all-groups there, commit, and push HEAD:refs/heads/<branch>.
Keep a file meant only for such a commit outside the tree: an untracked copy of a path the remote now tracks blocks the other session's next pull.
Still end with the commit on local <branch>, never on a side branch. Fast-forward with git merge --ff-only, or move the ref:
git update-ref refs/heads/<branch> <new> <old>.git reset --quiet -- <your paths>. A full reset drops what the other session staged.When it staged a hunk in one of your paths, skip the reset for that path: point its entry at the blob of the new commit plus that hunk, with git update-index --cacheinfo.
The user or another session can check out that branch while you build its commits. Read git symbolic-ref HEAD right before git update-ref, and when it names the branch, move it with git reset --keep <new> instead. A move under a checkout leaves the old tree in the index, which git status shows as a staged reverse of your commits: run git read-tree -m -u <old> <new>, which stops when a path it changes holds local edits.
git rebase needs a clean tree, and its --autostash is the git stash that "Undo and compare" forbids. Rebuild the range with plumbing instead, after you check that git log origin/<branch>..HEAD lists each of its commits:
HEAD, oldest first. Read its tree into a temporary index (GIT_INDEX_FILE=<scratch> git read-tree <sha>), set the entry of your path to your blob with git update-index --cacheinfo, then run git write-tree.git commit-tree <tree> -p <new parent> -F -. Give it the old message on standard input, read from git cat-file commit <sha> | sed '1,/^$/d': git log --format=%B adds a newline that commit-tree keeps. Give it the old author in GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL and GIT_AUTHOR_DATE.-S. Check that git diff --name-only <old head> <new head> lists only your paths, and that each message and author is unchanged. A check that fails after the signed build wastes one signature for each commit.-S, one commit at a time, then move the branch as "Commit authorized, push not authorized" says.git pull refuses the dirty tree for the same reason. Rebuild the unpushed range on origin/<branch> as "Amend an older unpushed commit" says, with two changes:
git merge-tree --write-tree --merge-base=<old parent> <new parent> <commit>, which stops on a conflict, and compare each pair with git patch-id --stable.git update-index --cacheinfo. Then run git checkout-index --force -- <path>, unless the working copy already holds that blob: otherwise the path reads as reverted.A session can also commit work it did not write. An uncommitted strand in this checkout is a strand offered to whoever commits next. Commit promptly, or rebuild yours as a blob once the absorption shows.
git checkout -- {path} also drops the other session's edits to that file.edit calls in its ~/.pi/agent/sessions/ transcript, to replay.git stash to compare an older commit. The push removes your paths from the tree the other session reads. A git status after the pop can show its commit instead of your pop, which reads as lost work. Add a throwaway git worktree at the SHA, and run the tool with uv run --project <worktree>: your tree never changes.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
10 skills in this plugin
/agent-config-self-tuneAudit and tune the configuration of coding agents across Claude Code and pi - settings files (settings.json, settings.local.json), permission rules, instruction files (CLAUDE.md, AGENTS.md), skill bodies and agent definitions. Use when an instruction file, a skill or an agent definition gets bloated or too big, or when asked to slim down, spread, deduplicate, relocate or compress it. Reads each source once, drops what another layer states, moves each rule beside the code, test or docs page it governs, then re-encodes what stays in a dense register to cut token count and context bloat. Also compresses system prompts and tool descriptions, percolates recurring local patterns into the global config, and reviews past session transcripts for tool calls denied by the sandbox or allow/deny rules to propose allowlist refinements./audit-repo-issuesAnalyze a GitHub repository's issues and PRs to find unaddressed feature requests, dismissed ideas, maintenance signals, and opportunities relevant to the current project. Use when you want to scout a related or competing repo for gaps your project could fill./fill-web-formFill a web form using data extracted from local documents (PDFs, images, spreadsheets). Uses Claude Desktop (Cowork) with Chrome integration to read source documents and navigate/fill browser forms. Use when the user wants to automate filling an online form from document data./memory-reviewReview, prune and repair the persistent memory of Claude Code (~/.claude/projects/*/memory). Verify every memory against the code, the docs, the skills and the upstream state, fix or delete the stale ones, merge duplicates, and keep each MEMORY.md index in step with its folder. Use when a memory misled a session, when memories look stale or bloated, when asked to clean up, prune, audit or consolidate memories, or every few months./pr-triageAudit open PRs across multiple repos for duplicates, stale drafts, Renovate noise, and conflicts. Produces a unified priority report./rename-with-datesRename documents and files (PDFs, images, screenshots, etc.) by reading their content to extract the effective/publication date, then renaming them with a "YYYY-MM-DD - Clear descriptive title.ext" format. Use when the user wants to organize files with date prefixes based on document content.npx claudepluginhub kdeldycke/dotfiles --plugin dotfilesOther plugins' skills for the same job