git-interaction

Git workflow rules for changing files and managing a Git repository, a project's version history. They define when to commit, push, merge, or stage files.

In plain words
What is it for?
Use them while working on branches, preparing commits, reviewing diffs, staging selected changes, or deciding when repository actions need confirmation.
Why use it?
They keep code changes reviewable and prevent accidental commits, pushes, merges, or inclusion of unrelated files.

Cursor rule for Cursor

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 rules/technickai/ai-coding-config/git-interaction
Clone the repo
git clone --depth 1 https://github.com/TechNickAI/ai-coding-config

Made for: Cursor.

Per session 2,667 This file is loaded in full into every session.
When invoked 2,667 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.02667 $0.02667
Opus 5 $0.01333 $0.01333
Sonnet 5 $0.00533 $0.00533
Haiku 4.5 $0.00267 $0.00267

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

Security

Grade A, and why

git-interaction 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.

.cursor/rules/git-interaction.mdc · 354 lines

How it starts

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

Git Collaboration and Communication Standards

I am a careful steward of your git repository. I make changes to files but leave version control decisions to you. I can commit to main when you ask, but I'll seek confirmation before pushing to main or merging branches since these affect the shared repository.

Core Identity

I work in your repository with these fundamental constraints: I make code changes but don't commit them unless you explicitly ask. When given permission, I can commit to main. Pushing to main or merging branches into main requires your confirmation. I work on feature branches when doing autonomous tasks. I treat your git history as permanent and important.

How I Handle Git Operations

By default, I make all the code changes you need but leave them uncommitted in your working directory. This lets you review everything with git diff before deciding what becomes part of your permanent history. When you're ready, you tell me "please commit" and I'll create the commit with an appropriate message.

Selective Staging

When you ask me to commit "your changes" or "my changes", I am surgical and precise:

I only stage files I modified - I use git add to stage only the specific files I changed in the current session. I never stage unrelated files or your other work-in-progress.

Partial staging when needed - If a file contains both my changes and your other unstaged work, I use git add -p (patch mode) to stage only the specific hunks I modified. This ensures I never accidentally commit your uncommitted work.

Verify before committing when using git add -A - While git add -A is allowed, I verify what's actually staged before committing. Multiple actors (other AI sessions, you, auto-generated files) may modify files in the same repository. Before any commit, I run git status to see what's staged and confirm I'm only committing changes I made in this session. If files I didn't modify are staged, I unstage them and stage only my changes explicitly.

Read the full file on GitHub · 354 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 · 354 lines · 2,667 tokens per session scan A d8d87732deaa

Subscribe to this mod's changes

git-interaction is a cursor rule published in the GitHub repository TechNickAI/ai-coding-config (24 stars, last pushed 2mo ago), licensed MIT. It adds 2,667 tokens to every session, about $0.0133 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-08-30.