sync

A command that incrementally updates NervaPack's code knowledge graph and vector store after files change, instead of processing the whole project again.

In plain words
What is it for?
Use it after editing files in a Git repository to re-parse code, refresh stored vectors, update linked documents, and save the graph.
Why use it?
It removes and rebuilds only the changed files, reducing the work needed to keep the graph current.

Command

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 commands/ramdhavepreetam/nervapack/sync
Clone the repo
git clone --depth 1 https://github.com/ramdhavepreetam/NervaPack
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 694 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.00000 $0.00694
Opus 5 $0.00000 $0.00347
Sonnet 5 $0.00000 $0.00139
Haiku 4.5 $0.00000 $0.00069

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

Security

Grade A, and why

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

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.

docs/user-guide/commands/sync.md · 102 lines

How it starts

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

nervapack sync

Incrementally update the graph after code changes — without re-ingesting the whole project.


Synopsis

nervapack sync [PATH]

Description

sync diffs your git working tree against the last commit, finds the files that changed, and surgically updates only those files in the graph and vector store.

  • Removes old nodes and ChromaDB vectors for each changed file.
  • Re-parses the updated file with tree-sitter.
  • Re-embeds the new entities into ChromaDB (batched in one call per file).
  • Re-binds any markdown docs linked to the changed file.
  • Saves the updated graph once at the end.

A full ingest on a large project can take minutes. sync turns that into a 2–5 second surgical update per file.

!!! warning "Requires git" sync uses GitPython to detect changed files. Your project must be a git repository.


Options

Argument Description Default
PATH Path to the repository root . (current directory)

Examples

# Sync after editing files
nervapack sync .

# Sync a different project
nervapack sync /path/to/project

Expected Output

Syncing changed files with NervaPack graph...
Found 3 changed files.
Updated AST for src/graph/builder.py
Updated AST for src/graph/retrieval.py
Removed old_module.py
Sync complete.

When to Use sync vs ingest

Situation Command
First-time setup nervapack ingest .
After editing 1–20 files nervapack sync .
After a large refactor (many renames) nervapack ingest .
After adding a new language/directory nervapack ingest .
Graph corrupt or wrong data ingested nervapack clean --all && nervapack ingest .

What Gets Updated

For each changed source file (.py, .js, .ts, etc.):

  1. Old graph nodes for that file are removed (O(1) — file index lookup).
  2. Old ChromaDB vectors for that file are deleted (delete_by_file).
  3. The file is re-parsed by tree-sitter into new entities.
  4. All new entities are batch-upserted into ChromaDB in one call.
  5. New graph nodes and DEFINES edges are added.

Read the full file on GitHub · 102 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. 2d ago First seen · 102 lines · 0 tokens per session scan A 2001f66f52b6

Subscribe to this mod's changes

sync is a command published in the GitHub repository ramdhavepreetam/NervaPack (1 stars, last pushed 9d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 694 tokens. 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-31.