git-under-contention

git-under-contention is a skill for Codex from TAKEOFF69/codex-skills-kit. It costs 71 tokens per session (960 once invoked), scanned A, original, MIT.

A set of rules for using Git safely when several people or AI agents may change the same repository, checkout, branch, or worktree.

In plain words
What is it for?
Use it before committing, pushing, merging, rebasing, creating worktrees, or recovering changes in a shared repository.
Why use it?
It helps prevent accidental staging, overwriting, or committing of someone else’s unfinished work.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it before committing, pushing, merging, rebasing, creating worktrees, or recovering changes in a shared repository.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/takeoff69/codex-skills-kit/git-under-contention
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add TAKEOFF69/codex-skills-kit --skill git-under-contention
Clone the repo
git clone --depth 1 https://github.com/TAKEOFF69/codex-skills-kit

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for git-under-contention

README.md
[![agentmods](https://agentmods.dev/badge/skills/takeoff69/codex-skills-kit/git-under-contention/github.svg)](https://agentmods.dev/skills/takeoff69/codex-skills-kit/git-under-contention)
Your own site
<a href="https://agentmods.dev/skills/takeoff69/codex-skills-kit/git-under-contention"><img src="https://agentmods.dev/badge/skills/takeoff69/codex-skills-kit/git-under-contention/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for git-under-contention

Your own site · 80×15
<a href="https://agentmods.dev/skills/takeoff69/codex-skills-kit/git-under-contention"><img src="https://agentmods.dev/badge/skills/takeoff69/codex-skills-kit/git-under-contention.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 960 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00071 $0.00960
Opus 5.5 $0.00028 $0.00384
Sonnet 5.5 $0.00014 $0.00192
Haiku 4.5 $0.00007 $0.00096

Measured 2mo ago against content hash f9fda51dd749, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

git-under-contention scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/contention_preflight.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/git-under-contention/SKILL.md · 103 lines

How it starts

The opening of the file, as written. The whole thing — 103 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Git Under Contention

Preserve every participant's work when repository state may change concurrently.

Core rule

Treat shared checkout as contested state. Stage exact paths, commit only owned changes, and leave unfamiliar hunks untouched.

Preflight

Run bundled detector before first commit in shared checkout:

python <skill-dir>/scripts/contention_preflight.py
python <skill-dir>/scripts/contention_preflight.py --mine path/owned-by-task

Signals include registered worktrees, recent HEAD movement, pre-staged files, and dirty paths outside owned pathspecs. CONTENTION is not automatic failure – it means use isolated worktree or stricter path ownership.

Skip detector only inside isolated worktree created for current task and still run normal status checks.

Shared-checkout rules

  • Inspect git status --porcelain, current branch, top-level path, and staged diff before mutation.
  • Stage with git add <path>...; avoid git add ., git add -A, and git commit -a.
  • Review git diff --cached --name-only and git diff --cached before commit.
  • Commit with explicit pathspec when repository conventions allow it.
  • Leave changes outside owned paths unchanged, staged or unstaged.
  • Avoid stash in contested checkout because stash captures shared state. Use task worktree or WIP commit on owned branch.
  • Fetch before deciding branch freshness; do not reset shared checkout to match remote.
  • Push durable work promptly so recovery does not depend on one disk.

Worktree lifecycle

Prefer worktree per task when work is multi-file, long-running, risky, or parallel.

  1. Fetch remote and create short-lived branch from intended base.
  2. Create worktree at explicit validated path.
  3. Record absolute root, branch, and base commit in handoff.
  4. Edit, stage exact paths, commit, and push as one durable sequence.
  5. Recheck dirty state and unpushed commits before cleanup.
  6. Remove worktree only through repository helper when one exists.

Before recursive worktree cleanup, inspect symlinks, junctions, mounts, and dependency links. Remove links safely before recursive deletion so cleanup cannot traverse into another checkout.

Read the full file on GitHub · 103 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 103 lines · 71 tokens per session scan A f9fda51dd749

Subscribe to this mod's changes

git-under-contention is a skill published in the GitHub repository TAKEOFF69/codex-skills-kit (8 stars, last pushed 3mo ago), licensed MIT. It adds 71 tokens to every session and 960 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

cloudron-app-publishing

Distribute Cloudron apps via CloudronVersions.json version catalogs.

marcusquinn/aidevops · 18 tokens

worktree-pr

Decide whether a task deserves its own git worktree and, if chosen, run it end to end: branch from the integration branch rather than the current tree, keep the main working copy untouched while the task runs, compare the result against the untouched baseline before declaring it done, and prepare it for a pull request…

scarletkc/agents · 148 tokens

infrastructure-publishing

Skill for the publishing infrastructure module providing academic publishing workflows including BibTeX CLI citation generation, APA/MLA citation helper functions, DOI management, Zenodo publication, arXiv submission preparation, GitHub releases, PyPI and TestPyPI package distribution, static-site deployment to GitHub…

docxology/template · 127 tokens

template-publish

Publishing scripts for DOI-bearing project releases, optional mirror uploads, PyPI release validation, post-publish verification, and publication export. Use with docs/guides/publication-runbook.md for standalone GitHub + Zenodo release workflows.

docxology/template · 52 tokens

cut-release

Cut a new agnostic-ai release end to end. Use when the user wants to ship a new version (tag + GitHub Release).

Chemaclass/agnostic-ai · 31 tokens

pr-sweep

Review every open PR with the code-reviewer agent and an adversarial review, apply the findings, and merge each one once CI is green. Use when asked to ship, sweep, or merge open PRs.

Chemaclass/agnostic-ai · 47 tokens