setup-knowledge-sync

setup-knowledge-sync is a command for Claude Code from Everyone-Needs-A-Copilot/claude-copilot. It costs 0 tokens per session (1,196 once invoked), scanned A, original, MIT.

A setup command that installs a Git hook to update product knowledge after release tags. Git is a system for tracking code changes, and a release tag is a named marker for a released version.

In plain words
What is it for?
Use it to check prerequisites, verify the project is a Git repository, install or test the post-tag hook, and stop with guidance when required configuration is missing.
Why use it?
It connects releases with knowledge updates so the process does not depend on someone remembering to update them manually.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths.

Part of the claude-copilot plugin — 72 skills, 17 commands, 17 agents, 4 hooks shipped together

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/everyone-needs-a-copilot/claude-copilot/setup-knowledge-sync
Clone the repo
git clone --depth 1 https://github.com/Everyone-Needs-A-Copilot/claude-copilot

Made for: Claude Code.

Or install claude-copilot, the plugin that ships this one along with the rest of its 72 skills, 17 commands, 17 agents, 4 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for setup-knowledge-sync

README.md
[![agentmods](https://agentmods.dev/badge/commands/everyone-needs-a-copilot/claude-copilot/setup-knowledge-sync.svg)](https://agentmods.dev/commands/everyone-needs-a-copilot/claude-copilot/setup-knowledge-sync)
Your own site
<a href="https://agentmods.dev/commands/everyone-needs-a-copilot/claude-copilot/setup-knowledge-sync"><img src="https://agentmods.dev/badge/commands/everyone-needs-a-copilot/claude-copilot/setup-knowledge-sync.svg" alt="Measured on agentmods" height="20"></a>
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 1,196 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.1 $0.00000 $0.01196
Opus 5 $0.00000 $0.00598
Sonnet 5 $0.00000 $0.00239
Haiku 4.5 $0.00000 $0.00120

Measured yesterday against content hash c6326900093e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

setup-knowledge-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 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.

.claude/commands/setup-knowledge-sync.md · 111 lines

How it starts

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

Setup Knowledge Sync

Install a project Git hook that updates product Knowledge after release tags.

1. Resolve prerequisites

Use the nearest configured Knowledge tier; do not assume ~/.claude/knowledge is configured.

eval "$(cc env)"
KNOWLEDGE_REPO_PATH="${CC_KNOWLEDGE_REPOS%%,*}"
if [[ -n "$KNOWLEDGE_REPO_PATH" && -f "$KNOWLEDGE_REPO_PATH/knowledge-manifest.json" ]]; then
  echo "FOUND: $KNOWLEDGE_REPO_PATH"
else
  echo "MISSING"
fi
git rev-parse --is-inside-work-tree 2>/dev/null && echo "GIT_OK" || echo "NOT_GIT"
  • On MISSING, tell the user to run /knowledge-copilot, then stop.
  • On NOT_GIT, explain that tag-based sync requires a Git repository, then stop.

Resolve project identity:

PROJECT_ROOT="$(git rev-parse --show-toplevel)"
PROJECT_NAME="$(basename "$PROJECT_ROOT")"

2. Check for an existing install

test -f "$PROJECT_ROOT/.git/hooks/post-tag" && echo HOOK_EXISTS || echo HOOK_MISSING
test -f "$PROJECT_ROOT/.git/hooks/sync-knowledge.sh" && echo SCRIPT_EXISTS || echo SCRIPT_MISSING

If both exist, ask whether to Reinstall, Test, or Cancel. Cancel stops. Test runs the dry-run command in step 4 without copying files.

3. Install

mkdir -p "$PROJECT_ROOT/.git/hooks"
cp ~/.claude/copilot/scripts/knowledge-sync/sync-knowledge.sh "$PROJECT_ROOT/.git/hooks/"
cp ~/.claude/copilot/scripts/knowledge-sync/extract-release-changes.sh "$PROJECT_ROOT/.git/hooks/"
cp ~/.claude/copilot/scripts/knowledge-sync/update-product-knowledge.sh "$PROJECT_ROOT/.git/hooks/"
cp ~/.claude/copilot/templates/hooks/post-tag "$PROJECT_ROOT/.git/hooks/"

# Git hooks run outside an env-hydrated shell. Bake in the tier selected above.
sed -i.bak "s|--tag \"\$TAG\"|--tag \"\$TAG\" --knowledge-repo \"$KNOWLEDGE_REPO_PATH\"|" "$PROJECT_ROOT/.git/hooks/post-tag"
rm -f "$PROJECT_ROOT/.git/hooks/post-tag.bak"
chmod +x "$PROJECT_ROOT/.git/hooks/post-tag" \
  "$PROJECT_ROOT/.git/hooks/sync-knowledge.sh" \
  "$PROJECT_ROOT/.git/hooks/extract-release-changes.sh" \
  "$PROJECT_ROOT/.git/hooks/update-product-knowledge.sh"

Read the full file on GitHub · 111 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 · 111 lines · 0 tokens per session scan A c6326900093e

Subscribe to this mod's changes

setup-knowledge-sync is a command published in the GitHub repository Everyone-Needs-A-Copilot/claude-copilot (13 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,196 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-09-04.