feat: sync shared vault at session start

This commit is contained in:
2026-09-01 09:40:46 +07:00
parent 5166f12775
commit 912e85fbf7
7 changed files with 120 additions and 5 deletions

View File

@@ -0,0 +1,15 @@
# shared-vault-sync
Pulls a clean shared vault at `SessionStart` without blocking Claude Code or Codex when the network is unavailable.
Set `SHARED_VAULT_DIR` to the vault directory to sync it from any working directory. Without it, the hook acts only when the session starts inside a repository whose `AGENTS.md` identifies it as the shared persistent vault.
The hook skips a dirty worktree and uses `git pull --ff-only`; it never rebases, merges, or pushes.
## Install
Install `shared-vault-sync` from the `infra-plugins` marketplace, then open a new session to activate its `SessionStart` hook.
## Recommended push automation
Keep pushes commit-driven. A scheduled local job may run `git fetch` and `git push` only when the vault is clean and the local branch is ahead; it must never rebase, force-push, or resolve conflicts. Let this hook handle the next safe pull after a rejected push.