Rename the knowledge-base folder¶
The knowledge-base folder is the folder of the repository that holds the
pages: the OKF bundle and, with Obsidian, the vault. It is named after
kb_name by default, and is kb/ in knowledge bases created before v0.5.0.
uv run poe rename-bundle NEW, which runs
kb rename-bundle, gives it
another name. This guide renames kb/ to my-notes/; use your own names.
When to rename¶
- The vault name. Obsidian names a vault after its folder, so a knowledge base created before v0.5.0 appears as "kb" in the vault switcher. After a rename it appears under the new name.
- Several knowledge bases. When every folder is called
kb/, vaults, editor tabs and paths in the agent's output look the same in every knowledge base. Distinct names tell them apart; see Run several knowledge bases.
A rename changes no page. Links such as /ai/llm-wiki.md are relative to
the bundle root, whatever the folder is called, and the bundle stays
conformant. The kb command, the kb_name answer and the qmd collection
name keep their names. The repository directory itself is not renamed.
Before you start¶
- The knowledge base is at template v0.5.0 or later (
_commitin.copier-answers.yml, which must not be empty). If it is older, update it and commit the update first. At v0.5.x, runjust rename-bundle NEWinstead ofuv run poe rename-bundle NEW; it behaves the same. - Changes to tracked files outside the knowledge-base folder, and in its
_templates/, are committed or stashed: the command re-renders those files. Changes to pages and vault settings, and untracked files such as notes you have not committed yet, are fine: they move with the folder. - Obsidian is closed, so that it does not write into the folder while it moves.
- The template repository is reachable. The command fetches the template at
the version recorded in
.copier-answers.yml, ascopier updatedoes; for a private fork, see When the template repository is private. - The new name is lowercase kebab-case, is not an existing file or folder,
and is not
schema,tools,docs,imports,template,launcherorsite(folders of the repository), norsources,syntheses,entities,projectsorjournal(standard folders inside the knowledge base). It must not be the name of a folder inside the knowledge-base folder, or of a domain in thedomainsanswer: a domainnotes/inside a knowledge-base foldernotes/would make paths ambiguous. Choose, for example,notes-kbinstead.
Rename the folder¶
From the repository root:
If a check fails, the command says why and changes nothing; for uncommitted changes, it lists the files to commit or stash.
The command ends with a summary:
…
Renamed kb/ to my-notes/ and staged the move and the re-rendered template files.
WARNING: these template-managed files had local edits that the re-render reverted (see git diff --cached):
.claude/settings.json
Next: review git diff --cached, then commit. Your unstaged edits and untracked notes are untouched;
the pre-commit hook checks only what the commit contains (tracked and staged files).
By hand: mentions of kb/ in README.md and in schema/*.yaml comments (not re-rendered).
Obsidian: open my-notes/ with Open folder as vault.
qmd: qmd collection remove my-kb && uv run poe search-setup (the folder path changed)
The WARNING lines appear only when there is something to restore (see
below), the Obsidian line only with an Obsidian vault, and the qmd line
only when qmd is installed.
The command:
- checks the name, the recorded template version and the working tree, and stops without changing anything if a check fails;
- moves the folder to
my-notes/withgit mv, which stages the renames and keeps the pages' history. Untracked notes,.obsidian/settings and the installed Obsidian plugins move along; untracked files stay untracked, and pages you had modified stay unstaged; - re-renders the template-managed files with the new name, by running
uvx copier recopy --trust --defaults --overwrite --skip-tasks --vcs-ref=<_commit> --data bundle_dir=my-notes. This rewrites[tool.kb] bundleinpyproject.toml,.gitignore,.pre-commit-config.yaml,AGENTS.md,CLAUDE.md, the skills anddocs/obsidian-setup.md, and records the new answer in.copier-answers.yml. It uses the template version you already have, so nothing else is upgraded. Copier validates the name as it does oncopier copy. Files the knowledge base owns, such asREADME.md, are left alone; - warns about managed files whose change is more than the folder name: committed local edits that the re-render reverted;
- stages the re-rendered files (
git add -uon tracked files outside the folder and inmy-notes/_templates/). It never stages untracked files; - updates the folder name in
.cache/kb-touched.txt, wherekbcommands run by an agent record the pages they change until the session's next hook collects them, so that the Stop hook of a running agent session still finds those pages. The hooks' session state in.cache/kb-hooks/holds paths relative to the folder and needs no change; - regenerates the indexes, and prints the summary. The next
uv runsyncs the tooling with the re-renderedpyproject.toml.
It does not commit.
If the recopy fails, for example because the template repository cannot be
reached or Copier rejects the name, the command moves the folder back,
restores the managed files and kb/_templates/ to the last commit, says
that everything was put back as it was, and exits with an error.
Review and commit¶
-
Review what the command staged:
The pages show as renamed, and the managed files as modified.
-
If the command printed a
WARNING, the listed files had committed local edits, such as a hand-editedKB_ACTORin.claude/settings.json, that the re-render replaced with the template's version. The removed lines are ingit diff --cached: put back the ones you want to keep, keeping the new folder name, andgit addthe file. -
Update the old name in the files the knowledge base owns. Copier does not re-render them:
git addthe files you change. -
Commit what is staged:
Your unstaged edits and untracked notes are not part of this commit, and the pre-commit hook does not check them: it runs
kb --tracked, which reads only tracked and staged files.
Afterwards¶
- Obsidian. Choose Open folder as vault and select
my-notes/. To Obsidian this is a new vault; its settings and plugins moved with the folder. If Obsidian asks again whether you trust the author, or the Templater trigger is off, repeat the two manual steps of Set up Obsidian. Remove the old vault from Obsidian's vault list. From then on,uv run poe obsidian-setup --openopens the vault. -
qmd. The collection keeps its name but still points at the old folder. Recreate it with the command the rename printed, where
my-kbis the collection name: -
Launcher and scripts. The launcher registers repository roots, so its configuration keeps working. Update anything that uses a path inside the old folder: a
KB_DIRor launcher entry that points into it, shell aliases, editor workspaces, scripts. - CI. Nothing to change: the workflow reads the folder name from
pyproject.toml. - Other clones. After
git pullon another machine, git moves the tracked files, but the files git ignores or does not track stay in the old folder there: the Obsidian plugins, per-device settings and uncommitted notes. Move the notes you want to keep, delete the old folder, runuv run poe setupanduv run poe obsidian-setup, and open the new folder as a vault.
Rename it back¶
After the commit, rename it again the same way, for example
uv run poe rename-bundle kb.
To undo a rename you have not committed, move the folder back, restore the re-rendered files, and refresh the environment and the indexes:
git mv my-notes kb # or mv, if the folder had no tracked files
git restore --source=HEAD --staged --worktree -- . ':(exclude)kb' # files outside the folder
git restore --source=HEAD --staged --worktree -- kb/_templates # the Templater templates
uv sync
uv run poe index
Why not rename it by hand¶
A plain mv or git mv moves the pages, but pyproject.toml,
.gitignore, the pre-commit hooks and the agent instructions keep the old
name, so kb and the hooks no longer find the bundle. Those files are
managed by the template, and the next copier update would render them
again from the name recorded in .copier-answers.yml.
uv run poe rename-bundle changes the folder, the managed files and the
recorded answer together.