sync-gbrain

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

Updated May 15, 2026
One-click install
npx skills add https://github.com/tgmarinho/canetaco --skill sync-gbrain-tgmarinho
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sync-gbrain
Source: https://github.com/tgmarinho/canetaco/tree/main/.claude/skills/sync-gbrain
Command: npx skills add https://github.com/tgmarinho/canetaco --skill sync-gbrain-tgmarinho

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When gbrain search stops finding code in a repository, the index is stale or the worktree was never pinned. This Skill re-syncs the repo with gbrain, registers the native code surface, and updates the search guidance in CLAUDE.md so agent code lookup works again. ## Core Features & Use Cases - State probing and capability checks: Detects gbrain configuration, worktree pins via .gbrain-source, remote-MCP mode, and artifacts sync state before acting. - Idempotent re-sync: Wraps the gstack-gbrain-sync orchestrator so it can be re-run safely without duplicating registrations. - CLAUDE.md guidance refresh: Updates the GBrain Search Guidance section so agents know when to prefer gbrain search over Grep. - Use Case: After cloning a new worktree or noticing gbrain search returns nothing for recent code, run the sync to pin the worktree, re-index, and restore semantic code lookup. ## Quick Start Ask the agent to sync gbrain and re-index this repository so code search works again.

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 with gbrain?

Run the sync-gbrain skill, which wraps the gstack-gbrain-sync orchestrator. It probes current state, registers the native code surface, and re-runs safely since the workflow is idempotent.

Why is gbrain search not finding code in my repo?

The worktree likely lacks a .gbrain-source pin at the git toplevel, so queries are not scoped to it. Run a full sync to pin the worktree; until then, lookups fall back to Grep.

Does gbrain sync work with a remote MCP brain server?

Yes. When the gbrain MCP server is configured as remote HTTP, local artifacts sync is a no-op because the brain server pulls from GitHub or GitLab on its own cadence.

Is it safe to run gbrain sync multiple times?

Yes. The skill is designed to be re-runnable and idempotent, with state probing and capability checks before each run, so repeated executions do not duplicate registrations.

What does the sync update in CLAUDE.md?

It refreshes the GBrain Search Guidance section, telling agents when to prefer gbrain search and query over Grep and when to use code-def, code-refs, and code-callers for symbol-aware lookup.