sync-gbrain

Synchronizes the gbrain code index with the repository and refreshes agent search guidance in CLAUDE.md.

Updated Aug 9, 2026
One-click install
npx skills add https://github.com/raghavbadhwar/rstack --skill sync-gbrain-raghavbadhwar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sync-gbrain
Source: https://github.com/raghavbadhwar/rstack/tree/main/sync-gbrain
Command: npx skills add https://github.com/raghavbadhwar/rstack --skill sync-gbrain-raghavbadhwar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code search indexes drift out of date as a repository changes, causing semantic search tools like gbrain to return stale or missing results. This Skill re-indexes the repo against gbrain and updates the agent-facing search guidance in CLAUDE.md so AI coding agents can reliably find code. ## Core Features & Use Cases - Repo re-indexing: Wraps the gstack-gbrain-sync orchestrator to probe, register native code surfaces, run capability checks, and emit a verdict block. - Idempotent and re-runnable: Safe to run repeatedly; maintains state so repeated syncs do not corrupt the index. - CLAUDE.md guidance refresh: Updates the "GBrain Search Guidance" section so agents know when to prefer gbrain search over Grep. - Use Case: After a large refactor, an agent's semantic code search stops finding new symbols. Run this Skill to re-index the repo and restore accurate gbrain search results. ## Quick Start Ask the agent to sync gbrain and re-index this repository so code search finds the latest changes.

Frequently Asked Questions about sync-gbrain

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I re-index a repository for gbrain code search?

Invoke the sync-gbrain skill, which wraps the gstack-gbrain-sync orchestrator to probe the repo, register native code surfaces, and rebuild the index. It is idempotent, so you can re-run it after any large change.

Why is gbrain search not finding code in my repo?

The index is likely stale or the worktree is not pinned. Run sync-gbrain (or /sync-gbrain --full for an unpinned worktree) to refresh the index and create the .gbrain-source pin in the repo root.

Does sync-gbrain update CLAUDE.md automatically?

Yes. It refreshes the GBrain Search Guidance section in CLAUDE.md so agents know to prefer gbrain search and symbol-aware lookups over plain Grep when the index is available.

Can I run sync-gbrain multiple times safely?

Yes. The skill is explicitly re-runnable and idempotent, maintaining state between runs. Repeated invocations re-probe and re-register code surfaces without corrupting the existing index.

What is the difference between gbrain search and Grep for code lookup?

Grep matches literal text patterns, while gbrain search answers semantic questions and gbrain code-def, code-refs, and code-callers provide symbol-aware lookup. The skill's guidance tells agents to prefer gbrain once the repo is indexed.