Running Obsidian CLI from Codex crashes Obsidian on macOS

Open 💬 6 comments Opened Mar 6, 2026 by jinchenma94
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

Description

Running any obsidian CLI command from Codex Desktop causes Obsidian to immediately crash on macOS.

For example, this alone is enough to trigger the crash:

obsidian --help

When the command is executed from Codex, Obsidian crashes instantly and macOS shows the standard crash dialog saying that "Obsidian quit unexpectedly" and asking whether it should be reopened.

Environment

  • macOS 26.1 (25B78)
  • MacBook Pro (M1 Pro)
  • Obsidian 1.12.4
  • Obsidian binary: /Applications/Obsidian.app/Contents/MacOS/obsidian

Reproduction

From Codex Desktop, run:

obsidian --help

Result:

  • Obsidian immediately crashes
  • macOS shows the system crash dialog ("Obsidian quit unexpectedly")

Notes

In my Codex setup I have a custom skill that executes CLI commands.

When the obsidian command crashes, the skill detects that the CLI execution failed and falls back to using a system query command instead. This fallback behavior is part of my custom skill logic and not something built into Codex itself.

The key issue is that launching the Obsidian CLI binary from Codex causes Obsidian to crash immediately.

The same obsidian binary works normally when executed from a regular terminal or from another agent environment on the same machine.

The crash only occurs when the command is launched from Codex.

From the macOS crash report:

  • Parent Process: codex
  • Responsible Process: Codex
  • Exception: EXC_CRASH (SIGABRT)

Happy to provide the full crash report if helpful.

View original on GitHub ↗

6 Comments

imp0wd3r · 4 months ago
ghost · 4 months ago

I can confirm that this happens periodically.

There's a chance that it's related to the file that's being edited by Codex is currently opened in Obsidian UI. Will try to test more to understand the exact reproduction steps.

dphil · 4 months ago
@jinchenma94 check this, https://x.com/ziwen_uu/status/2029213673370353835

I am getting this same issue and can confirm the diagnosis and solution from that tweet are accurate. Switching the Codex chat from "Default permissions" to "Full access" (via the dropdown below the chat input) results in the obsidian cli invocations now working. Targeted authorization of obsidian commands by a rules file (also mentioned in the tweet) is working as well.

For example from my test, in .codex/rules/default.rules:

prefix_rule(
    pattern = ["obsidian"],
    decision = "allow",
    justification = "Allow Obsidian CLI commands to run outside the sandbox.",
    match = [
        "obsidian help",
        "obsidian search query=test",
        "obsidian eval code=app.vault.getFiles().length",
    ],
    not_match = [
        "open -a Obsidian",
        "bash -lc obsidian help",
    ],
)

For rules reference see https://developers.openai.com/codex/rules#create-a-rules-file .

I'm assuming the proper behaviour would be Codex prompting the user about a need for escalated permissions for the obsidian command.

I'm guessing the reported behaviour (Obisidian crash) may be related to the fact that - per their docs - the Obsidian cli requires the app to be running. The cli appears to be a thin client to the GUI app rather than a standalone terminal app. So likely Codex is running the cli, which spawns the gui app (you can see it do this yourself if you invoke the cli from a terminal without the gui app open yet), then sandbox restrictions kick in which causes the gui app to be aborted which likely explains the Obsidian crash dialog popup.

3f6a · 3 months ago

I think this is what's going on:

  • Codex runs an Obsidian CLI command inside its sandbox.
  • In this environment, the sandbox cannot reliably reach the running app over the local CLI socket.
  • obsidian then behaves as if Obsidian is unavailable and tries to launch Obsidian again.
  • That second, Codex-spawned Obsidian process crashes on startup, so macOS shows “Obsidian quit unexpectedly”.
  • Your original Obsidian app keeps running, which is why the app “seems fine” despite the dialog.
etraut-openai contributor · 3 months ago

@3f6a, thanks for the analysis. That sounds quite plausible. If that's the case, then this is something that we probably cannot fix in Codex. We've seen other tools that behave poorly when run inside of a sandbox, and in many cases the maintainers of those tools have been willing to make improvements. I recommend reporting this to the maintainers of Obsidian to see if they can make it work better when it encounters the limitations of a sandbox.