ac-git-git-find-fork

ac-git-git-find-fork is a skill for Claude Code from WaterplanAI/agentic-config. It costs 64 tokens per session (683 once invoked), scanned A, original, MIT.

A Git command workflow for finding where a branch split from another branch. It also checks whether rebasing or squashing changed the branch's visible history.

In plain words
What is it for?
Use it to find a branch's fork point, identify its likely parent when unknown, or determine whether it was rebased or squash-merged.
Why use it?
The usual merge base may not show the original starting point after history has been rewritten. This workflow compares candidate parent branches and the branch reflog to investigate that history.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: positional $N argument.

Part of the agentic-config plugin — 49 skills, 1 plugin shipped together

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 skills/waterplanai/agentic-config/ac-git-git-find-fork
Any agent
npx skills add WaterplanAI/agentic-config --skill ac-git-git-find-fork
Clone the repo
git clone --depth 1 https://github.com/WaterplanAI/agentic-config

Made for: Claude Code.

Or install agentic-config, the plugin that ships this one along with the rest of its 49 skills, 1 plugin.

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 ac-git-git-find-fork

README.md
[![agentmods](https://agentmods.dev/badge/skills/waterplanai/agentic-config/ac-git-git-find-fork.svg)](https://agentmods.dev/skills/waterplanai/agentic-config/ac-git-git-find-fork)
Your own site
<a href="https://agentmods.dev/skills/waterplanai/agentic-config/ac-git-git-find-fork"><img src="https://agentmods.dev/badge/skills/waterplanai/agentic-config/ac-git-git-find-fork.svg" alt="Measured on agentmods" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 683 The whole file, excluding the scripts and references it only reads on demand.
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.1 $0.00064 $0.00683
Opus 5 $0.00032 $0.00342
Sonnet 5 $0.00013 $0.00137
Haiku 4.5 $0.00006 $0.00068

Measured 6d ago against content hash 1ffce01c5ff9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

ac-git-git-find-fork 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 6d ago.

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.

packages/pi-ac-git/skills/ac-git-git-find-fork/SKILL.md · 89 lines

How it starts

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

Git Find Fork

Determines the true fork point of a branch, accounting for rebases, squashes, and unknown parent branches.

Workflow

Step 1: Identify Current State

BRANCH=$(git rev-parse --abbrev-ref HEAD)
HEAD_SHA=$(git rev-parse --short HEAD)

Step 2: Find Candidate Parent Branches

When parent is unknown, find closest by commit count:

git branch -a --format='%(refname:short)' | while read b; do
  [[ "$b" == "$BRANCH" ]] && continue
  base=$(git merge-base "$b" HEAD) || continue
  count=$(git rev-list --count "$base..HEAD")
  echo "$count $base $b"
done | sort -n | head -5

Lowest count = closest parent.

Step 3: Get Merge-Base

PARENT="main"  # or detected from Step 2
MERGE_BASE=$(git merge-base "$PARENT" HEAD)

Step 4: Detect History Rewriting

REFLOG_ORIGIN=$(git reflog show "$BRANCH" --format='%H %gs' | grep 'branch: Created' | awk '{print $1}')

if [[ "$REFLOG_ORIGIN" != "$MERGE_BASE" ]]; then
  echo "HISTORY REWRITTEN"
  # Check if reflog commit still ancestor
  git merge-base --is-ancestor "$REFLOG_ORIGIN" HEAD && echo "Partial rebase" || echo "Full rebase/squash"
fi

Step 5: Detect Squash

COMMIT_COUNT=$(git rev-list --count "$MERGE_BASE..HEAD")
[[ "$COMMIT_COUNT" -eq 1 ]] && echo "Branch appears SQUASHED"

Step 6: Find Orphaned References (Optional)

# Tags pointing to orphaned commits
for tag in $(git tag); do
  tag_sha=$(git rev-parse "$tag")
  git merge-base --is-ancestor "$tag_sha" HEAD || echo "Orphaned: $tag -> $tag_sha"
done

Output Format

Field Value
Branch {branch_name}
HEAD {sha}
Parent Branch {parent}
Merge-Base {sha} - "{commit message}"
Commits Since Fork {count}
History Rewritten Yes/No
Squashed Yes/No

Key Principle

git merge-base gives the fork point for CURRENT history state. Original fork point after rebase/squash must be recovered from reflog, tags, or dangling objects (none guaranteed to exist).

Read the full file on GitHub · 89 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. 6d ago First seen · 89 lines · 64 tokens per session scan A 1ffce01c5ff9

Subscribe to this mod's changes

ac-git-git-find-fork is a skill published in the GitHub repository WaterplanAI/agentic-config (30 stars, last pushed 1mo ago), licensed MIT. It adds 64 tokens to every session and 683 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

share-a-library

Use when a managed library is ready to publish to GitHub and hand to teammates as an install command. Run the GitHub publishing steps, then return the exact shareable install command.

MoizIbnYousaf/Ai-Agent-Skills · 41 tokens

generate-release-notes

Generate categorized release notes from any source (GitHub, Linear, Jira, or manual input) with optional publishing.

huytieu/COG-second-brain · 27 tokens

git-flow-pr

Executes the full PR-driven development workflow: create an isolated feature branch from the current work, commit all staged changes, rebase cleanly onto the selected base branch (skipping any ancestor commits already merged), push the branch, and open a GitHub pull request linked to a related issue. Includes guidance…

soulcodex/agentic · 103 tokens

new-gh-issue-orchestration

Orchestrates a GitHub-issue-driven delivery workflow from issue intake to PR creation using reviewer-first then worker execution. Invoked when the user provides a GitHub issue link/number and asks to start end-to-end delivery.

soulcodex/agentic · 54 tokens

git-worktree-workspaces

Sets up and uses Git worktrees for parallel task workspaces in the same repository clone, including safe cleanup of local worktrees. Invoked when the user asks to work on multiple branches at once, isolate tasks without extra clones, or create/remove worktrees.

soulcodex/agentic · 58 tokens

github-pages-portfolio

Build, update, and verify a single-page static portfolio / intro site on GitHub Pages (pure HTML+CSS+JS, no build step). Covers sourcing content read-only from the user's existing GitHub repos (public AND private), the free-tier public-repo requirement, anchor+accordion single-page design (hidden content revealed on…

pedroiff0/awesome-skills · 115 tokens