- Home
- Skills
- Agents & Orchestration
- Vault Autosync: Auto-Save Claude Code Sessions
Works with the AI Agents you already use
Vault Autosync: Auto-Save Claude Code Sessions
Sets up a Claude Code hook that writes every finished session to your Obsidian vault automatically, with nothing to remember to run.
$5
Vault Autosync: Auto-Save Claude Code Sessions
Example session with this skill installed
/vault-autosync
- Read your context and instructions
- Compiled the vault autosync
Your vault path is set: VAULT_PROJECTS_ROOT=~/Vault/01_Projects (the folder exists). Node.js is v22.11.0, which is fine.
I copied the hook script to ~/.claude/vault-sync/vault-sync.mjs.
Proposed change to ~/.claude/settings.json. It keeps your existing settings and adds:
{
"env": { "CLAUDE_VAULT_ROOT": "/Users/you/Vault/01_Projects" },
"hooks": {
"SessionEnd": [
{ "hooks": [ { "type": "command", "command": "node \"/Users/you/.claude/vault-sync/vault-sync.mjs\"", "timeout": 15 } ] }
]
}
}
Okay to write this?
yes
Done. settings.json is updated and is still valid JSON.
Smoke test: I ran the script with a test payload. The log shows:
Skip: no transcript_path given …
That's the expected result: the hook found your vault and runs.
What happens now
- Autosync starts with your next session. When you exit Claude Code, the session is written to
01_Projects/<project>/Chats/and the project README is updated, about a minute later. - Each sync is a short background
claude -prun, so it uses a little of your usage. - Short sessions and sessions inside the vault are skipped.
- Log:
~/.claude/hooks/vault-sync.log. To remove autosync, ask me to uninstall it.
Connects securely to your tools. The creator never sees your data.
About this skill
Vault Sync works when you remember to run it. Autosync makes it automatic: every time a Claude Code session ends, the session is summarized into your vault in the background.
What the skill does
- Reads your vault path and checks your Node.js version.
- Installs a small zero-dependency script to
~/.claude/vault-sync/. - Adds a
SessionEndhook to~/.claude/settings.jsonand keeps your existing settings. It shows you the exact change and waits for your OK. - Runs a smoke test, so you know it works before your next session.
What happens each time you exit
- The transcript is condensed locally.
- A background
claude -prun, limited to Read, Write and Edit, writes a dated chat log and updates the project README. - Each chat log is tagged with its session id, so Vault Import never imports it twice.
- Very short sessions are skipped, and so are sessions run inside the vault itself.
Also included
- A troubleshooting guide, with a clear log at
~/.claude/hooks/vault-sync.log - A setting for a custom
claudepath (useful on Windows) - Uninstall steps
Requirements: Claude Code, Node.js 18+ and an Obsidian vault (or any Markdown folder). Each sync is a short Claude run, so it uses a little of your usage.
The script makes no network calls of its own. It only starts your local claude CLI.
- Claude Code only. Other agents can use the free Vault Sync skill manually.
- Each sync is a short background claude -p run, so it uses a little of your Claude usage.
- The note appears about a minute after you exit. If you shut the computer down right away, that sync may not finish.
- Sessions that are too short, and sessions run inside the vault folder, are skipped.
- On Windows, the hook may not find claude on its own. Set VAULT_SYNC_CLAUDE_BIN to its full path (the skill explains how).
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
Trust & safety
Security scan
Security scan passed 21 days ago
Requires
Permissions
File Scopes
Terminal: runs node to check the version and the smoke test. Writes ~/.claude/settings.json only after you approve the exact change. The installed hook starts your local claude CLI in the background (Read/Write/Edit only, no shell) to write the session summary. The script itself makes no network calls.