feat(agents-vault): sync the vault from the claude and agy wrappers

Both wrappers stay behind the C1 guard, so disabling
__fish_config_op_aliases still passes straight through to the real binary.

Launch commits but never pushes, keeping the network and any credential
prompt off the critical path; pushing is left to the Claude Code SessionEnd
hook. agy has no such hook, so its memory lands one launch later.
This commit is contained in:
2026-09-03 18:56:46 -04:00
parent 11f4551fa5
commit 2ad5bf75d2
6 changed files with 131 additions and 9 deletions
+9 -4
View File
@@ -475,8 +475,12 @@ function agents-vault --description 'track curated agent memory in a host-scoped
# named: git add refuses a pathspec that matches nothing --
# which one of the two always is, once it has been moved
# back -- and then stages none of them, not even the one
# that did match.
git -C "$vault" add -A -- projects 2>/dev/null
# that did match. Its stderr is deliberately not swallowed:
# projects/ provably exists here, so the only thing a
# redirect could hide is a real failure -- a held
# index.lock, say -- after which the index stays
# half-applied while nothing says so.
git -C "$vault" add -A -- projects
return 1
end
end
@@ -498,8 +502,9 @@ function agents-vault --description 'track curated agent memory in a host-scoped
# because even the git-native rollback leaves it out of line:
# the forward `git mv` overwrote the stashed entry's index
# entries, and moving the files back does not bring them back.
# See the same call above for why projects/ is named whole.
git -C "$vault" add -A -- projects 2>/dev/null
# See the same call above for why projects/ is named whole,
# and why its stderr is left visible.
git -C "$vault" add -A -- projects
echo "$c_err""agents-vault: could not relink $claude_root/$mangled/memory; $cur was left as it was$c_reset" >&2
return 1
end
+10 -4
View File
@@ -8,7 +8,7 @@
# aliases/dev-tools
#
# DEPENDENCIES
# agents-init
# agents-init, agents-vault
#
# SYNOPSIS
# agy [ARGS...]
@@ -18,9 +18,14 @@
# sub-repository is initialized and any agent-made changes are committed
# before launch. Delegates all scaffold and commit logic to agents-init
# --quiet (full setup), which ensures AGENTS/ is scaffolded and CLAUDE.md
# is symlinked to AGENTS/AGENTS.md in the current project. Arguments are
# forwarded verbatim to the real agy binary, except for -r/--resume which
# are translated to -c/--continue.
# is symlinked to AGENTS/AGENTS.md in the current project.
#
# Also syncs the host-scoped agent memory vault (agents-vault). agy has
# no session-end hook, so its memory is captured on the next launch
# rather than at session end.
#
# Arguments are forwarded verbatim to the real agy binary, except for
# -r/--resume which are translated to -c/--continue.
#
# Opinionated component (C1): when disabled via __fish_config_op_aliases
# (or the __fish_config_opinionated master), the command is passed through
@@ -44,6 +49,7 @@ function agy --wraps=agy --description 'agy wrapper: auto-initializes AGENTS/ su
end
agents-init --quiet
agents-vault --quiet
for i in (seq (count $argv))
if test "$argv[$i]" = "-r"
+8 -1
View File
@@ -8,7 +8,7 @@
# aliases/dev-tools
#
# DEPENDENCIES
# agents-init
# agents-init, agents-vault
#
# SYNOPSIS
# claude [ARGS...]
@@ -19,6 +19,12 @@
# Delegates all scaffold and commit logic to agents-init --quiet (full
# setup), which ensures AGENTS/ is scaffolded and CLAUDE.md is symlinked
# to AGENTS/AGENTS.md in the current project.
#
# Also syncs the host-scoped agent memory vault (agents-vault), which
# tracks curated memory living outside the project tree. The vault
# commits on launch but does not push; pushing happens from the Claude
# Code SessionEnd hook or an explicit agents-vault --push.
#
# All arguments are forwarded verbatim to the real claude binary.
#
# Opinionated component (C1): when disabled via __fish_config_op_aliases
@@ -42,6 +48,7 @@ function claude --wraps=claude --description 'claude wrapper: auto-links AGENTS.
end
agents-init --quiet
agents-vault --quiet
command claude $argv
end