ai-agents push-lock.instructions.md

ai-agents push-lock.instructions.md is an instructions file for GitHub Copilot from rjmurillo/ai-agents. It costs 2,104 tokens per session, scanned A, original, MIT.

Repository instructions requiring every push recipe to use the same file lock, so simultaneous processes cannot update the same Git branch unsafely.

In plain words
What is it for?
Writing or reviewing automated Git push commands and checking that pre-push validation enforces one shared lock path.
Why use it?
They prevent two agents or scripts from pushing concurrently and losing a branch update because they used different lock files.

Instructions file for GitHub Copilot

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.

agentmods
npx agentmods add instructions/rjmurillo/ai-agents/push-lock
Clone the repo
git clone --depth 1 https://github.com/rjmurillo/ai-agents

Made for: GitHub Copilot.

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 ai-agents push-lock.instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/rjmurillo/ai-agents/push-lock.svg)](https://agentmods.dev/instructions/rjmurillo/ai-agents/push-lock)
Your own site
<a href="https://agentmods.dev/instructions/rjmurillo/ai-agents/push-lock"><img src="https://agentmods.dev/badge/instructions/rjmurillo/ai-agents/push-lock.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,104 This file is loaded in full into every session.
When invoked 2,104 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.02104 $0.02104
Opus 5 $0.01052 $0.01052
Sonnet 5 $0.00421 $0.00421
Haiku 4.5 $0.00210 $0.00210

Measured yesterday against content hash 51bfeeed01b8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ai-agents push-lock.instructions.md 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 yesterday.

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.

.github/instructions/push-lock.instructions.md · 167 lines

How it starts

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

One Push Lock Path

Scoped to the trees that carry push recipes rather than **. The always-on .md ceiling in scripts/validation/instruction_budget.py had 998 bytes of headroom when this rule was written and a universal copy failed it at 102.7 percent, which blocks every contributor's push. Nothing is lost by the narrower scope: the binding half is scripts/validation/check_push_lock_paths.py, which pre_pr.py runs on every push whatever rules the harness loaded.

flock excludes only processes that open the same path. Two agents pushing the same branch under two different lock names run concurrently while both believe they are serialized, which is the lost ref update the lock exists to prevent.

Three schemes were live at once on 2026-08-02 (issue #4366). A ps census taken while roughly 20 push processes were running found 5 processes on the per-branch scheme, 11 on a hashed four-slot scheme, and 2 on a $HOME variant. Two of the three provided no exclusion against the other two.

The rule is one path, written the same way everywhere:

BR=$(git branch --show-current)
SLUG=$(printf '%s' "$BR" | tr '/' '-')
mkdir -p "$HOME/src/scratch/locks"
flock "$HOME/src/scratch/locks/push-lock-$SLUG.lock" git push origin "$BR"

MUST

  1. Use $HOME/src/scratch/locks/push-lock-<slug>.lock and nothing else. Not /tmp, not a hashed slot, not a literal home directory, not a per-worktree filename. A recipe that names any other path is a fourth scheme, and a fourth scheme is only discoverable by ps.
  2. Key the lock on the branch, with / replaced by -. A branch named fix/foo writes a lock path with a / in the filename otherwise, which the shell reads as a directory. Two distinct branches must never share a lock: git takes its own lock per ref, so unrelated branches serializing behind a 10 to 16 minute pre-push hook is pure waste. The hashed four-slot scheme collided two different branches about 25 percent of the time.
  3. Create the directory in the same command. flock fails when the parent directory is missing, and a failed flock in a detached push is silent.
  4. Keep the lock out of /tmp. /tmp was wiped mid-session on 2026-08-02. A wipe while a push holds the lock leaves the holder's descriptor on a deleted inode while the next push creates a new inode at the same path, so the two stop excluding each other. That is a split lock under one filename, which no amount of name agreement fixes.

Read the full file on GitHub · 167 lines

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. yesterday First seen · 167 lines · 2,104 tokens per session scan A 51bfeeed01b8

Subscribe to this mod's changes

ai-agents push-lock.instructions.md is an instructions file published in the GitHub repository rjmurillo/ai-agents (45 stars, last pushed yesterday), licensed MIT. It adds 2,104 tokens to every session, about $0.0105 per session on Opus 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-09-03.

Related

Other instructions, from other repositories

Alex_Skill_Mall severity-tagged-commits.instructions.md

Every commit touching brain artefacts (instructions / skills / prompts / agents / config / docs/ledgers / HANDOFF) must carry a severity tag in the commit subject: [typo | clarification | behaviour | constitutional]. [behaviour] and [constitutional] require an ACT pass before commit.

fabioc-aloha/Alex_Skill_Mall · 1,630 tokens

claude-capsule-kit CLAUDE.md

Instructions for arpitnath/claude-capsule-kit, covering capsule kit v4.0, rules, context system (capsule), wikilink layer and docs.

arpitnath/claude-capsule-kit · 1,133 tokens

carmenta AGENTS.md

AGENTS.md instructions for carmentacollective/carmenta, covering project context for ai assistants, anti-patterns to avoid, always apply rules, project overview and directory documentation.

carmentacollective/carmenta · 947 tokens

carmenta CLAUDE.md

Claude Code instructions for carmentacollective/carmenta, a project described as: A heart-centered AI for creating at the speed of thought.

carmentacollective/carmenta · 3 tokens

Alex_Plug_In git-workflow.instructions.md

Consistent git practices, recovery patterns, and safe operations.

fabioc-aloha/Alex_Plug_In · 287 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens