sync-codebase

A codebase indexing tool that builds searchable representations of a local Git repository, including code embeddings and a code relationship graph. Later runs update only changed files.

In plain words
What is it for?
Use it to index or refresh a repository, choosing its path, branch, repository identifier, and optional graph-building method.
Why use it?
It gives code-review and search systems current knowledge of the repository instead of relying on stale or incomplete context.

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/mimfort/rag_for_git/sync-codebase
Any agent
npx skills add mimfort/rag_for_git --skill sync-codebase
Clone the repo
git clone --depth 1 https://github.com/mimfort/rag_for_git

Made for: Claude Code, Codex.

Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 907 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.00066 $0.00907
Opus 5 $0.00033 $0.00453
Sonnet 5 $0.00013 $0.00181
Haiku 4.5 $0.00007 $0.00091

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

Security

Grade A, and why

sync-codebase 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.

plugin/skills/sync-codebase/SKILL.md · 74 lines

How it starts

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

Sync Codebase

Builds or updates the reviewer base index — vector embeddings (Postgres/pgvector) and code graph (Neo4j) — from a local repo clone using reviewer index. This is a one-time setup operation; subsequent runs are incremental (only changed files are re-embedded).

Inputs

Parse from $ARGUMENTS (all optional):

  • --path <path>: path to the local repo clone. Default: current working directory.
  • --ref <branch>: git ref to index. Default: main.
  • --repo <owner/name>: repo identifier for multi-repo setups. If omitted, derived automatically from git remote get-url origin.
  • --backend <auto|scip|treesitter>: graph backend override. Default: auto (SCIP if in PATH, else tree-sitter).

Pipeline

  1. Resolve inputs. If --path not given, use the current working directory. If --ref not given, use main. If --repo not given, run:

    git -C <path> remote get-url origin
    

    Strip .git suffix, extract the last two path segments (owner/name).

  2. Check prerequisites. Verify:

    • uvx is available: uvx --version succeeds.
    • The path is a git repo: git -C <path> rev-parse --git-dir succeeds.
    • The reviewer MCP server is reachable (run reviewer check or confirm the user has .env configured with PG_DSN, NEO4J_URI, VOYAGE_API_KEY).
    • Docker services are up if using the default stack: docker compose ps shows paradedb and neo4j running.
    • Stop and tell the user what is missing if any check fails.
  3. Run indexing.

    uvx --from rag-reviewer reviewer index <path> --ref <ref>
    

    Add --repo <owner/name> if resolved or provided. Stream the output to the user.

    Expected duration: seconds for small repos, minutes for large ones — Voyage free tier (3 RPM / 10K TPM) causes throttling with automatic retry/backoff. That is normal, not an error. Use --limit N (if supported) for a quick smoke run.

  4. Verify. After indexing completes, optionally run a diagnostic search to confirm the corpus:

    uvx --from rag-reviewer reviewer search "your query here"
    

    Or call search_code via the reviewer MCP tools directly.

Read the full file on GitHub · 74 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 · 74 lines · 66 tokens per session scan A 884a04898822

Subscribe to this mod's changes

sync-codebase is a skill published in the GitHub repository mimfort/rag_for_git (21 stars, last pushed yesterday), licensed MIT. It adds 66 tokens to every session and 907 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

graft

This repo is indexed by graft/. For ANY task here, whether understanding how something works, finding where code lives, tracing what calls a symbol or what a change breaks, or scoping an edit, get your context from graft before grepping or reading source files.

trailhq/Graft · 56 tokens

roam

Codebase comprehension via roam-code CLI. Use when exploring codebases, planning modifications, debugging failures, assessing PR risk, or checking architecture health. Triggers on: understanding project structure, pre-change safety checks, finding symbols/files, blast radius analysis, affected tests, health scoring…

Cranot/roam-code · 86 tokens

code-graph

This skill should be used when understanding code structure, finding dependencies between functions/classes, tracing call graphs, or exploring code relationships. Trigger phrases include 'code graph', 'call graph', 'who calls', 'what calls', 'find dependencies', 'code structure', 'inheritance', 'find paths'.

FalkorDB/code-graph · 64 tokens

agentmap

Use for TypeScript/JavaScript codebase navigation — symbol lookup, blast radius, reuse checks, and repo orientation. Prefer agentmap before serial grep when exploring imports, exports, or where a symbol lives. Package is @raymondchins/agentmap (not the unrelated npm package agentmap).

raymondchins/agentmap · 64 tokens

m1nd-operator

Use when the user mentions m1nd or when repo investigation, search, review, docs/spec work, or risky change prep should go through m1nd first before grep, glob, or manual file reads. Covers m1nd-first routing, L1GHT and universal document ingestion, risky edit preparation, document-to-code binding, the served owner +…

maxkle1nz/m1nd · 111 tokens

m1nd-first

Use when investigating a repository, searching for implementation, reviewing changes, working from specs/docs, or preparing a risky code change in an environment where m1nd is available. This doctrine makes m1nd the first investigative layer before grep, glob, or manual file reads, except when the task is pure…

maxkle1nz/m1nd · 78 tokens