feat: keep the vaults in one directory with DECANT_VAULTS - #1
Merged
Merged
Conversation
Every agent is started with permission to write only in its working directory, and that was wherever the command ran. A vault that did not sit below it was out of the agent's reach. The agent now starts inside the vault, and the prompt names the vault's files relative to it. Claude-Session: https://claude.ai/code/session_015GMvfHKL7G9y3JncLX2Xwh
Vaults land in vaults/ under whichever directory the command ran from. Installed, that scatters them; from a clone, it keeps them inside the repository, within reach of git clean. DECANT_VAULTS moves them to one absolute path. A mistake in it fails instead of filing vaults where nobody will look: a relative value is refused, a leading ~ is expanded even when quoted, and only the last level is created, so a missing parent stops the run. A run that creates the vaults directory and then fails removes it again while it is still empty. Before, a failed first run left an empty vaults/ behind in whatever directory it ran from. Claude-Session: https://claude.ai/code/session_015GMvfHKL7G9y3JncLX2Xwh
view, analyze and credits took only a path, resolved against the current directory. With the vaults pinned elsewhere, that meant typing the full path every time. A bare name is now looked up in the vaults directory when nothing by that name exists here; a path that does not exist is still an error, not retried as a name. Claude-Session: https://claude.ai/code/session_015GMvfHKL7G9y3JncLX2Xwh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
DECANT_VAULTSpins the vaults to one absolute directory, instead ofvaults/under wherever the command ran.~is expanded even when the shell left it quoted.vaults/a failed first run used to leave behind.view,analyzeandcreditstake a vault's name as well as its path, looking the name up in the vaults directory. A path that does not exist is still an error, not retried as a name.Why
From a clone,
bun run decantalways runs in the repository root, so the vaults live inside the repository — ignored by git, and so within reach ofgit clean -fdX. Installed globally, they scatter across whatever directory the command ran in.Testing
bun run typecheckDECANT_VAULTS→ error, exit 1, nothing created~/…with a missing parent → expanded to the home directory, run stops, nothing created in the working or home directory./vaults, failed run → created, then removedDECANT_VAULTS, no.stagingleft behindview,creditsandanalyzeby name (with and without the variable), by path, with an unknown name and with a missing pathanalyzewith a stubclaudeonPATHthat prints its working directory and writesNOTES.md→ runs inside the vault, even when the vault is outside the current directory