git-checkout-cache

A helper for keeping partial local copies of remote Git repositories, which are projects hosted on services such as GitHub or GitLab. It refreshes an existing checkout and avoids repeatedly downloading the full repository.

In plain words
What is it for?
Use it when a remote repository is supplied as a reference for code analysis, documentation, or comparison.
Why use it?
It provides a predictable reusable copy for reading or searching remote code while using less storage and time than repeated full clones.

Skill for Claude CodeCodex

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/aretw0/agents-lab/git-checkout-cache
Any agent
npx skills add aretw0/agents-lab --skill git-checkout-cache
Clone the repo
git clone --depth 1 https://github.com/aretw0/agents-lab

Made for: Claude Code, Codex.

Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 784 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 $0.00059 $0.00784
Opus 5 $0.00030 $0.00392
Sonnet 5 $0.00012 $0.00157
Haiku 4.5 $0.00006 $0.00078

Measured 2d ago against content hash 98da88b9400d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

git-checkout-cache 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 2d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (checkout.sh), 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.

packages/git-skills/skills/git-checkout-cache/SKILL.md · 75 lines

How it starts

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

Use this skill when the user points you to a remote git repository (GitHub/GitLab/Bitbucket URLs, git@..., or owner/repo shorthand) as a reference for reading or analysis.

The goal is to keep a reusable local checkout that is:

  • stable (predictable path)
  • up to date (periodic fetch + fast-forward when safe)
  • efficient (partial clone with --filter=blob:none, no repeated full clones)

Cache location

~/.cache/checkouts/<host>/<org>/<repo>

Example: github.com/aretw0/agents-lab~/.cache/checkouts/github.com/aretw0/agents-lab

Command

Use the versioned helper from this skill directory. From the repository root:

bash packages/git-skills/skills/git-checkout-cache/checkout.sh <repo> --path-only

Examples:

bash packages/git-skills/skills/git-checkout-cache/checkout.sh aretw0/agents-lab --path-only
bash packages/git-skills/skills/git-checkout-cache/checkout.sh github.com/mitsuhiko/minijinja --path-only
bash packages/git-skills/skills/git-checkout-cache/checkout.sh https://github.com/mitsuhiko/minijinja --path-only
bash packages/git-skills/skills/git-checkout-cache/checkout.sh [email protected]:mitsuhiko/minijinja.git --path-only

Avoid recipes that set shell variables in the pi bash tool command string (for example CACHE=...; echo $CACHE), because some harnesses can pre-expand $VAR before the command reaches bash. Prefer direct helper arguments and literal paths.

The script will:

  1. Parse the repo reference into host/org/repo
  2. Clone if missing (partial clone with --filter=blob:none)
  3. Reuse existing checkout if present
  4. Fetch from origin when stale (default interval: 300s)
  5. Attempt fast-forward merge if checkout is clean and has upstream

Force refresh

bash packages/git-skills/skills/git-checkout-cache/checkout.sh <repo> --force-update --path-only

Dry-run/path validation

For local smoke checks or path-only planning without network access:

bash packages/git-skills/skills/git-checkout-cache/checkout.sh <repo> --dry-run --path-only

Read the full file on GitHub · 75 lines

Files

What ships with it

1 file 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. 2d ago First seen · 75 lines · 59 tokens per session scan A 98da88b9400d

Subscribe to this mod's changes

git-checkout-cache is a skill published in the GitHub repository aretw0/agents-lab (11 stars, last pushed 2mo ago), licensed MIT. It adds 59 tokens to every session and 784 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.