/awsh:concurrent-safe-gitfrom awsh
Provides safe git workflows for shared working trees where multiple agents or humans commit simultaneously. Covers pathspec commits, commands that destroy others' work, and stat-dirty merge unblocking. Based on real incidents.
Ships in awsh. 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.
You do not have this working tree to yourself.
The moment more than one agent — or an agent plus a human, or an agent plus a
cron/maintenance loop — edits the same checkout, ordinary git commands become
destructive. Not "risky." Destructive. HEAD advances under you, files appear and
vanish between the moment you survey and the moment you stage, and a bare
git commit ships whatever somebody else happened to have staged.
If a CD loop deploys from your commits, this stops being a local problem. A careless git operation in a shared tree ships.
A reset --hard re-deployed a fixed security bug. One session ran
git reset --hard to clean up its own mess. That wiped hours of another session's
uncommitted work on tracked files — untracked files survived, which is the
signature that tells you this is what happened. The reverted source then flowed
through the deploy loop, putting an already-fixed cross-tenant data leak back into
production. Nobody typed "undo the security fix."
A 10-line fix committed 270 lines. A bare git commit in a file another session
had in-flight hunks in. The commit message described ten lines. The diff was
two hundred and seventy, including a half-finished change to an API contract.
Both were routine commands. Neither operator did anything they'd call careless.
git add <paths> && git commit -m "msg" -- <same paths>
The trailing -- <paths> is the part people drop, and it's the part that matters:
it makes the commit ignore foreign staged content in both directions. Same paths
in both halves.
Never a bare git commit. Never git add -A or git add ..
reset, checkout ., stash, or reset --hardThese operate on the whole tree and clobber whoever else is working in it.
If you must unstage, scope it: git reset -- <your-paths>.
If you think you need reset --hard: stop. That is the exact command from the
first incident. Find another way, or ask a human.
git status --porcelain immediately before each commit groupNot at the start of your task — immediately before. Skip files another session already landed. Leave their fresh in-flight modifications alone.
Before committing a file someone else may be editing:
git diff --stat -- <file>
Confirm the line count matches your edit. If it's larger, foreign hunks are riding along. Read the full diff. If they changed one end of a contract — a backend gate and its frontend field, a schema and its consumer — verify both ends before you let a deploy loop have it.
git show --stat <sha>
Broad pathspecs sweep more than you intended. A directory pathspec like
tests/ will happily collect three other people's new test files. Confirm only your
files landed — after the fact, not on faith.
git read-tree HEAD immediately before the commitWhen several agents share one tree, each usually commits through its own index
(GIT_INDEX_FILE=<private file> git add … && git commit …) so nobody sweeps anyone
else's staged files. That index is a snapshot of the HEAD it was read from. If a
peer commits after you read it, your next commit records the old blobs for every
file the peer touched — it silently reverts their whole commit. That happened: a
commit from a stale private index deleted all 22 files of a peer's commit, and
nothing in the diff looked unusual to the agent that made it.
The rule, every time, with nothing in between:
export GIT_INDEX_FILE=/tmp/my-agent.index
git read-tree HEAD # refresh from the CURRENT HEAD, right now
git add -- <only your paths>
git commit -m "msg"
git show --stat HEAD # only your paths? no deletions you didn't make?
awgit's vcs-stale-revert-guard pre-commit hook refuses a commit whose staged
content equals the state before a recent commit (override for a deliberate
revert: AITHER_ALLOW_REVERT=1). The awsh plugin installs it automatically
(awgit hooks ensure) before your first commit in a repo — but the hook is the
backstop, not the method. Read the tree, then commit.
Uncommitted work in a shared tree is not durable. Someone else's routine hygiene can eat it. Don't let a large edit sit unstaged while you keep going.
With many writers, index entries go stat-dirty: mtime changed, content identical.
Git then refuses to touch files to protect changes that do not exist — and the obvious
escape (git stash) is exactly what rule 2 forbids. In a shared tree the stash is
repo-global: it is shared by every worktree of the repository, and a stash/pop takes
other sessions' work off disk with yours.
Do this instead:
git diff --stat -- <the blocked paths> # which are REALLY modified?
git update-index --refresh # re-stat; clears false-dirty entries
Measured on a real tree: a merge blocked by 7 files. git diff --stat showed
exactly one had real changes; the other six were stat-only. After --refresh all
seven read clean and kept their content — no stash, no reset, nothing lost.
If a file is genuinely modified and still blocks, copy it to a scratch directory first — a filesystem backup git cannot lose — and only then restore that one path:
mkdir -p ../scratch && cp -p <path> ../scratch/
git restore -- <path> # that path only, never the tree
Do the merge itself in your own worktree on your own branch, never in the shared tree. A merge, rebase or pull rewrites files every other session is reading; the pack's git guard hook blocks them in a shared checkout for that reason.
awgit wt new my-merge --at <your-branch> --branch my/merge-branch # retire with `awgit wt done my-merge`
git -C ../my-merge merge origin/<branch>
When every session shares ONE worktree and ONE HEAD, another session's git push
carries your commits too, and their update clears your behind count.
If a push is rejected: re-fetch, re-check, wait. Observed on a real tree: a state
that looked like "ahead 6 / behind 6" became "ahead 5 / behind 0" on its own within
minutes, with no intervention.
Your commits are not at risk while they sit on the shared HEAD. The risk comes from forcing the issue.
Push as its own command, never chained — a force-push guard can false-positive on a
compound a && git push.
git reset --hard (any form)git reset, git checkout ., git stash (any mutating form)git merge / rebase / pull in the shared tree (do it in your own worktree)git add -A / git add . / bare git commitgit pushGIT_INDEX_FILE you did not git read-tree HEAD into
immediately beforeName your paths, check twice, and never run a command whose blast radius is "everything."
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub aitherium/awdk --plugin awsh120 skills in this plugin
/acp-driveDrive any external ACP agent from your agent. The Agent Client Protocol lets one agent drive another. When your task needs a different model, a different tool surface, or a sandbox your loop doesn't have, you can hand a sub-problem to an external ACP agent — Claude Code (claude-agent-acp), Codex (codex-acp), Gemini CLI (gemini-cli), or any binary that speaks ACP on stdio — and read back its answer. Your memory, faculties and approval gate stay in charge; the external agent runs its own loop underneath./acp-serveExpose an AitherOS agent to ACP editors. ACP editors — JetBrains IDEs, Zed, VS Code, neovim, Obsidian — drive coding agents over the Agent Client Protocol. adk acp serve makes any AitherOS agent one of those agents: the editor spawns it as a subprocess, and every prompt, permission request and tool round-trip goes over stdio JSON-RPC. Your agent's approval gate maps onto ACP permission requests./adk-deepseek-coderFill-in-the-middle, repo packing, and a reward that can fail. DeepSeek-Coder is two useful things at once, and most people only take the first./adk-harnessesOne shell that drives every coding shell. Your agent can hand a task to another coding agent's real product — Claude Code, Codex, Gemini CLI, Aider, OpenCode — and read back one answer./adk-unslothLocal training and serving, wired to your agent. [Unsloth](https://github.com/unslothai/unsloth) trains LoRA/QLoRA 2x faster with ~70% less VRAM and serves GGUF locally. Pairing it with the ADK gives you a loop that runs entirely on your own hardware: your agent serves from a local model, you fine-tune on what it produced, you swap the adapter, you measure again./adversarial-verificationStop grading your own homework. There is one failure that costs more agent-hours than any bug: the agent reads its own diff, decides it is correct, and reports success. Every expensive incident has that shape. A green healthcheck. An HTTP 200. A passing import. A test that goes green. All true, all at the same time as the feature being completely inert.Other plugins' skills for the same job