Agent Vault Hooks · Obsidian plugin documentation
Agent Vault Hooks documentation

Agent Vault Hooks runs declarative local vault rules when notes are created, modified, or renamed in Obsidian. It stamps YAML frontmatter fields, appends review tags, and logs entries to an activity feed note through atomic vault.process writes, with zero shell execution and zero background network calls.
Version 1.0.0. Requires Obsidian 1.13.4 or later. Works on desktop and mobile.
1 Installation
Community plugins
- Open Settings > Community plugins in Obsidian.
- Select Browse and search for Agent Vault Hooks.
- Select Install, then select Enable.
Manual installation
- Download
main.js,manifest.json, andstyles.cssfrom the latest release. - Copy them into
<vault>/.obsidian/plugins/agent-vault-hooks/. - Reload Obsidian and enable Agent Vault Hooks in Settings > Community plugins.
2 Getting started
Create and edit hook rules
- Open the command palette and run
Agent Vault Hooks: Open hook rules. - Select Add hook rule or select Edit on one of the three starter rules.
- Choose the trigger events (
create,modify, orrename) and set an optional folder prefix, tag filter, or frontmatter key-value filter. - Pick the action to run (
stamp_yaml,append_tag, orlog_activity) and adjust its field name, stamp format, tag, or message.
Preview changes with dry run
- Open any Markdown note inside your target folder.
- Run
Agent Vault Hooks: Test hooks on active note (dry run)from the command palette. - Switch between
create,modify, andrenamein the event selector to inspect which rules match, why other rules are skipped, and the exact line-by-line frontmatter diff. - Select Apply matching hooks now when you want to commit the planned changes to the note and activity feed.
Enable automatic execution and rollback (Pro)
- Open Settings > Agent Vault Hooks and turn on Automatic debounced execution.
- Tune the debounce window (200 to 10000 ms) and loop guard cooldown (500 to 30000 ms) to match your editing pace.
- Turn on Record execution audit log to track each run, export Markdown or JSON logs, or run
Agent Vault Hooks: Roll back last hook writeto undo the most recent hook mutation safely.
3 Features
Free declarative vault hooks
Agent Vault Hooks lets you build local event automation without writing scripts or running shell commands. In the free tier, you can configure up to 3 hook rules that respond to create, modify, or rename events. Each rule filters target notes by folder prefix, frontmatter or inline tag, and an optional frontmatter key and value.
- Stamp YAML frontmatter fields such as
updatedorlast_verifiedusing ISO timestamps, calendar dates, or literal values while keeping YAML comments, key order, and CRLF or LF line endings intact. - Append tags such as
#needs-agent-reviewto frontmattertagswithout duplicating tags that already exist in block lists, inline arrays, or scalar fields. - Append timestamped wikilink entries to an Agent Activity Feed note through atomic
vault.processcalls so concurrent edits stay safe. - Preview matched rules, skipped reasons, the exact line diff, and planned activity feed entries with the dry-run preview before touching any note.
- Run matching hooks on demand on the active note on desktop and mobile (
isDesktopOnly: false).
Pro automation, predicates, and rollback
Pro unlocks hands-free automation and deeper rule logic for active agent vaults while keeping every mutation local to your device.
- Define unlimited hook rules beyond the 3-rule free cap and chain multiple ordered actions in one rule, such as
stamp_yaml,append_tag, andlog_activity. - Turn on debounced automatic execution after
layoutReadyso vault indexing at startup never triggers hooks. A built-in loop guard suppresses self-originated writes within your cooldown window and skips the activity feed and audit log notes. - Filter notes with conditional frontmatter predicates such as
status == done && memory_type in [fact, decision],!=,not in [...],contains,exists, andnot exists. - Record hook executions to a structured Markdown or JSON audit log and roll back the last hook write with edit-conflict protection so subsequent manual edits are never overwritten.
- Explore live pure-TypeScript examples inside the interactive What pro adds modal from Settings or the command palette.
4 Commands
Open the command palette and type the plugin name to see these commands. You can give each one a hotkey in Settings, Hotkeys.
| Command | Command id |
|---|---|
| Open hook rules | agent-vault-hooks:open-hook-rules |
| Test hooks on active note (dry run) | agent-vault-hooks:test-hook-active-note |
| Run matching hooks on active note | agent-vault-hooks:run-hooks-active-note |
| Open hook execution audit log | agent-vault-hooks:open-audit-log |
| Roll back last hook write | agent-vault-hooks:rollback-last-hook |
| Open what pro adds | agent-vault-hooks:open-what-pro |
5 Settings
| Setting | Default | Description |
|---|---|---|
| Activity feed note path | Agent-Activity-Feed.md |
Note path where log_activity actions append entries. |
| Automatic debounced execution | Off | Pro: run hooks automatically after layoutReady. |
| Debounce window (ms) | 800 |
Pro: delay before running hooks after the last event (200 to 10000 ms). |
| Loop guard cooldown (ms) | 2500 |
Pro: suppression window for self-originated writes (500 to 30000 ms). |
| Record execution audit log | Off | Pro: keep recent hook runs in memory for export and rollback. |
| Audit log export path | Agent-Hooks-Audit.md |
Pro: destination note path for Markdown audit log export. |
6 Privacy, payment and network
The core features are free. Pro features need a GitHub Sponsors sponsorship of theluckystrike: $5 a month or more, or $15 once. A total payment of $15 meets the payment requirement for Pro without further payment. Sign-in and the checks below still apply. Your notes stay readable and editable with or without Pro.
GitHub handles the payment. Sponsor at https://github.com/sponsors/theluckystrike. You need no account for the free features. Pro needs the GitHub account that sponsors.
Until you select "Sign in with GitHub" in the settings, Agent Vault Hooks makes no network requests. Sign in uses the GitHub device flow. Agent Vault Hooks sends its public client ID and the scope read:user to https://github.com/login/device/code and shows you a code. While you enter the code at https://github.com/login/device, it asks https://github.com/login/oauth/access_token every few seconds to check the sign-in status. The scope permits profile reads only. GitHub needs this access to show the sponsorship tier. It grants no repository scope and no write access.
After sign in, Agent Vault Hooks sends one query to https://api.github.com/graphql. It checks if the signed-in account sponsors theluckystrike. It asks for the tier and the total payment to theluckystrike. The plugin reuses a successful check for 7 days. Failed checks can retry after 6 hours. Select Refresh to request an earlier check. It sends no note content, file names or other vault data, and it has no telemetry.
After a successful check, Pro can work offline for up to 14 days. Sign out or a negative sponsorship answer turns Pro off. The plugin stores the GitHub token through the secret storage API of Obsidian. It does not put the token in its saved settings or its local sponsorship data. The local storage of this device keeps your GitHub login, the tier and the time of the last check. Sign out clears the token. You can also revoke the access in your GitHub settings, under Applications.
7 Questions and answers
Does Agent Vault Hooks run shell commands or external scripts?
No. Agent Vault Hooks is pure TypeScript with zero shell execution, zero child processes, and zero network requests for hook rules. It works on desktop and mobile Obsidian.
How does the plugin avoid infinite modify loops?
When a hook writes to a note or appends to the activity feed, the loop guard records the file path and content hash for the configured cooldown window. Incoming modify events that match the self-write are suppressed, and the activity feed and audit log notes are always excluded from rule matching. Vault listeners also wait for layoutReady so startup indexing never fires hooks.
Will YAML comments or Windows CRLF line endings be lost?
No. Frontmatter updates operate surgically on lines inside the YAML block, preserving existing comments, inline comments, key order, and CRLF or LF line endings.
What happens if I edit a note after a hook runs and then click Roll back?
Rollback verifies that the current note content still matches the exact output produced by the hook. If you edited the note afterward, rollback stops and shows a notice so your manual edits are never overwritten.
8 Support
Report bugs, share workflow ideas, or attach a minimal frontmatter sample on the GitHub issue tracker for this repository.