Skip to content

feat: keep the vaults in one directory with DECANT_VAULTS - #1

Merged
GeisonJr merged 4 commits into
mainfrom
feat/vaults-dir
Sep 10, 2026
Merged

GeisonJr merged 4 commits into
mainfrom
feat/vaults-dir

Conversation

@GeisonJr

@GeisonJr GeisonJr commented Sep 10, 2026

Copy link
Copy Markdown
Member

What

  • DECANT_VAULTS pins the vaults to one absolute directory, instead of vaults/ under wherever the command ran.
    • A relative value is refused; a leading ~ is expanded even when the shell left it quoted.
    • Only the last level is created — a missing parent stops the run instead of building a tree where nobody will look.
    • A run that creates the directory and then fails removes it again while it is still empty. This also fixes the empty vaults/ a failed first run used to leave behind.
  • Vaults by name. view, analyze and credits take 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.
  • The analysis agent runs inside the vault. Every agent is started with permission to write only in its working directory, which was wherever the command ran, so a vault outside it was out of reach. The prompt now names the vault's files relative to it.

Why

From a clone, bun run decant always runs in the repository root, so the vaults live inside the repository — ignored by git, and so within reach of git clean -fdX. Installed globally, they scatter across whatever directory the command ran in.

Testing

  • bun run typecheck
  • Manual runs against scratch directories:
    • relative DECANT_VAULTS → error, exit 1, nothing created
    • quoted ~/… with a missing parent → expanded to the home directory, run stops, nothing created in the working or home directory
    • new directory under an existing parent, failed run → created, then removed
    • default ./vaults, failed run → created, then removed
    • existing directory with content, failed run → left intact
    • a short generated video → the vault lands in DECANT_VAULTS, no .staging left behind
    • view, credits and analyze by name (with and without the variable), by path, with an unknown name and with a missing path
    • analyze with a stub claude on PATH that prints its working directory and writes NOTES.md → runs inside the vault, even when the vault is outside the current directory
  • Not tested: a real analysis with Claude Code, Codex or Gemini running inside the vault.

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
@GeisonJr
GeisonJr merged commit 5e7028f into main Sep 10, 2026
1 check passed
@GeisonJr
GeisonJr deleted the feat/vaults-dir branch September 10, 2026 21:22
@GeisonJr
GeisonJr restored the feat/vaults-dir branch September 10, 2026 21:23
@GeisonJr
GeisonJr deleted the feat/vaults-dir branch September 10, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant