You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CLI and MCP ignore primaryNotesLocation: root when creating notes #745
With the vault set to "Vault root" mode, zn create and the MCP create_note tool still write new notes to inbox/. vault_info also reports primaryNotesLocation: inbox. Reading and searching root-level notes works fine, so only creation and mode detection are affected.
Environment
ZenNotes 2.45.0 (zn v2.45.0), macOS 26.6.2
Local vault, .zennotes/vault.json contains "primaryNotesLocation": "root"
Confirm .zennotes/vault.json has "primaryNotesLocation": "root".
Run zn create --title Test --body test --json.
Expected
path is Test.md at the vault root, and vault_info (MCP) reports primaryNotesLocation: root.
Actual
path is inbox/Test.md, and vault_info reports primaryNotesLocation: inbox.
Notes
Reproduces after restarting the app, the MCP process, and a full reboot.
zn list and zn search do return a note placed manually at the vault root, so reads honor the layout.
The tool descriptions in server-*.js document root-mode behavior, but I couldn't find any code path in the CLI bundle that reads primaryNotesLocation from vault.json.
Fixed on the v2.46.0 branch in 5e09fab (release PR #749).
You found the right place to look. The CLI and the MCP server share one function to decide the mode, and it did read primaryNotesLocation from vault.json, but only after the vault's layout had its say: loose content at the root meant root, notes inside inbox/ meant inbox, and the file was consulted only when the layout was ambiguous. That rule was written when root mode shipped so a vault switched in Settings but not yet migrated kept filing next to its old notes. The app does the opposite (an explicit setting wins, the layout is inferred only when the file leaves it unstated), so with old notes still in inbox/ the two disagreed on the same vault.
Now the file wins on every side: zn create and create_note land at the vault root, and vault_info reports primaryNotesLocation: root. Only a vault without a stated setting is inferred from its layout, the way the app does it. Reads were already right and are unchanged.
Verified through the running app: the vault switched to Vault root in Settings, then zn create with no --vault and the MCP tools over stdio, with both new notes showing up in the app at the root while the old ones stayed in inbox/. Three tests pin the order. It ships with 2.46.0; thanks for the precise report.
Activity
Fix(cli): zn create and the MCP tools follow primaryNotesLocation: ro…
adibhanna commentedon Sep 8, 2026
Fixed on the
v2.46.0branch in 5e09fab (release PR #749).You found the right place to look. The CLI and the MCP server share one function to decide the mode, and it did read
primaryNotesLocationfromvault.json, but only after the vault's layout had its say: loose content at the root meant root, notes insideinbox/meant inbox, and the file was consulted only when the layout was ambiguous. That rule was written when root mode shipped so a vault switched in Settings but not yet migrated kept filing next to its old notes. The app does the opposite (an explicit setting wins, the layout is inferred only when the file leaves it unstated), so with old notes still ininbox/the two disagreed on the same vault.Now the file wins on every side:
zn createandcreate_noteland at the vault root, andvault_inforeportsprimaryNotesLocation: root. Only a vault without a stated setting is inferred from its layout, the way the app does it. Reads were already right and are unchanged.Verified through the running app: the vault switched to Vault root in Settings, then
zn createwith no--vaultand the MCP tools over stdio, with both new notes showing up in the app at the root while the old ones stayed ininbox/. Three tests pin the order. It ships with 2.46.0; thanks for the precise report.