Can an AI agent drive Obsidian?
Claude Code works in my Obsidian vault by editing Markdown files, and I tested Obsidian's command line too. What worked, what failed, and the risks.
Yes, and most of the time it doesn’t need Obsidian to be involved. An Obsidian vault is a folder of Markdown files, so Claude Code has been reading and editing my notes as ordinary files. Obsidian’s own command line also worked in a short test on one note, but that’s all the use it has had here.
| Verdict | |
|---|---|
| Read and edit notes as files | Works |
| Create, edit, read and delete a note through the command line | Works: one test note |
| Search and set properties through the command line | Works: one test note |
| Report failure through the exit code | Didn’t work: errors exit 0, so read the output |
| Check its own work | Works with limits: facts in the file yes, whether the note is useful no |
| Run unattended | Not tried |
The way in
The files. In late October, I asked Claude to look through my notes and
keep lists in them. It found the vault’s location in Obsidian’s obsidian.json, read notes
with shell tools, and edited them with its normal file tools and small scripts. To reject a
note, it moved the file into the vault’s .trash folder. It needed nothing from Obsidian for
any of that. I went through a sample of those sessions for this page, not every one, and
saw no failed edits in that sample. I haven’t checked how Obsidian handles a file changing
while that same note is open.
The command line. Obsidian has an obsidian command that talks to the running app. It’s
a setting in the app, and mine was on. Commands like these ran against a test note with a
different name, with the app open, using the full path to the command inside the app. Add
vault=<name> if you don’t want your default vault:
obsidian create path=zz-test.md "content=first line"
obsidian append path=zz-test.md "content=appended line"
obsidian property:set name=status value=yes path=zz-test.md
obsidian read path=zz-test.md
obsidian search query=appended total
obsidian delete path=zz-test.mdThat’s useful when you want something files can’t give you, such as Obsidian’s search, its backlinks or a parsed property. The help lists about 100 commands, and I tried a handful.
What failed
- Exit codes. Reading a missing note, deleting a missing note and running a made-up
command each printed
Error:and exited 0. A script has to read the output. - A second
createmakes a copy. Creating a path that already exists exited 0, printedCreated: zz-agent-cli-test 1.mdand left a second note in my real vault. The test script’s cleanup only deleted the first name, so Claude had to catch the copy from the output and move it to the trash too. Check for the file before creating it, or test in a spare vault. The help also lists anoverwriteoption forcreate, which I didn’t try. - A claim about how we use it. Before this page, Claude told me we used Obsidian through a skill. The configuration mentions one, but it isn’t installed. The real work had gone through plain file edits.
- Successful output varies. The first
createprinted nothing, while the copy printedCreated:. Don’t use the output alone to decide that a command succeeded.
Can it check its own work?
Partly. It can read the note back, and in this test the added text and property were there.
After appending a unique word, search found it on a check 2 seconds later. It can’t tell you
whether the note says the right thing, so I still read anything that matters.
Can it run unattended?
I don’t know yet. File edits don’t need Obsidian at all, so they should work wherever the vault’s files are, but I’ve only done this in sessions on the Mac. I haven’t tried the command line with the app closed, over SSH, or on a schedule.
Security
- Reach: an agent running as your user can read the whole vault, and it doesn’t need Obsidian to do it. If you keep private material in there, that’s what you’re handing over. It’s also why this page has no screenshots.
- Prompt injection: a clipped web page in a note is untrusted text that an agent may read as instructions. I haven’t tested this.
- The command line reaches further than notes. Its help lists
eval, which runs JavaScript in the app,plugin:install,theme:install,dev:cdpanddeletewith apermanentoption. I read those in the help and didn’t run them. - Deleting:
deleteprintedMoved to trashfor my test notes. I didn’t check how that interacts with sync. - Your data: keep a backup or version history before letting an agent edit a vault in bulk.
Not tried
- A spare vault, which I’d use if I did this again
- Most of the command line, including
eval, sync, tasks, bases and plugins - Editing a note while it’s open in Obsidian
- Running the command line with the app closed, over SSH or on a schedule
Tested on
Obsidian 1.14.5 (installer 1.12.7) on an M2 Pro MacBook Pro with 16 GB, macOS 27.2, with Claude Code. File edits ran in late October 2026, and the command line tests ran on November 4.