Codex Chat Panel

unlisted

by Hael Song

A VS Code-style side panel that reads the active note and chats with local Codex CLI.

Updated 1mo agoMIT
View on GitHub

Codex Chat Panel for Obsidian

Release CI License: MIT Obsidian Stars

A native-feeling Obsidian side panel for chatting with Codex about the note you are reading.

Open a note, select the exact paragraph you care about, and ask Codex in the right sidebar. Codex Chat Panel can answer questions, explain selected text, propose reviewed Markdown edits, and save useful conversations back into your vault.

Download the latest release · Install · Safe editing · Roadmap · Report an issue

Codex Chat Panel demo

If this saves you from copying notes into a browser tab, a star helps other Obsidian users find it.

Why People Star This

  • It stays in Obsidian. The panel sits beside your note, keeps the current file in view, and renders Codex replies as real Markdown.
  • It uses your Codex CLI login. No plugin-owned server, no separate API key flow, and no custom account system.
  • It is selection-first. Drag text in the note and use quick actions like Ask, Explain, Summarize, Rewrite, Quiz, and Checklist.
  • It can edit notes without surprise writes. Codex proposes a diff, then you choose Apply or Reject.
  • It has a safe Agent mode. Larger workflows return a plan and reviewed file edits limited to the active note plus Markdown files you explicitly attach.
  • It is built for real vault work. Extra context files, model picker, streaming status, chat export, stale-content checks, and practical defaults are already included.

30-Second Install

  1. Install and log in to Codex CLI:
codex --version
codex login
codex debug models
  1. Download main.js, manifest.json, and styles.css from the latest release.

  2. Put those three files in your vault:

YOUR_VAULT/.obsidian/plugins/codex-chat-panel/
  1. In Obsidian, open Settings -> Community plugins, enable community plugins if needed, then enable Codex Chat Panel.

What You Can Do

WorkflowWhat happens
Ask about the active noteThe current Markdown file is sent as context and the answer appears in the side panel.
Ask about selected textDrag-select note text and use the floating Ask in side chat style actions.
Add more contextAttach a few extra Markdown files as labeled context chips.
Choose a modelPick gpt-5.5, gpt-5.4-mini, or gpt-5.3-codex-spark next to the send button.
Stream responsesCodex CLI JSON events update the panel while the model is working.
Render MarkdownHeadings, lists, links, code blocks, and inline code render as formatted content.
Edit the noteCodex returns structured edit JSON, the plugin shows a diff, and you approve the write.
Use Agent modeCodex plans larger note workflows and returns one reviewed diff per proposed file change.
Save useful chatsExport the current conversation to Codex Chat History/ inside your vault.

Modes

Chat

The default mode for questions, summaries, explanations, and study prompts.

Open a note, type a question, and press Enter. Use Shift+Enter for a new line.

Edit

Use Edit mode when you want Codex to rewrite the active note or selected text.

Examples:

make this explanation shorter and clearer
turn this section into bullet points
fix the code comments in the selected block
rewrite this note as an exam checklist

The note is not changed immediately. Review the diff, then choose Apply or Reject.

Agent

Use Agent mode when you want a larger note workflow, such as reorganizing a research note or updating several attached Markdown files.

Agent mode can inspect:

  • the active note,
  • selected text,
  • Markdown files you explicitly add with Add context....

Agent mode returns:

  • a short plan,
  • zero or more proposed edits,
  • one reviewable diff per proposed file change.

Safe Editing

Codex Chat Panel is intentionally conservative about writes.

  • Chat calls run Codex with --sandbox read-only.
  • Edit mode is limited to the active Obsidian note.
  • Agent mode is limited to the active note and attached Markdown files.
  • Edits are shown as diffs before anything is written.
  • Each proposed edit needs explicit user approval.
  • The plugin checks that a file has not changed since the proposal was generated.
  • Large whole-note edits are blocked so you can select a smaller section instead.

You should still treat selected text and active notes as data you are intentionally sending through your local Codex CLI session.

Privacy At A Glance

  • No plugin-owned server.
  • No separate API key storage.
  • Uses your local Codex CLI session.
  • Sends only the note context you choose to include.
  • Chat history export is opt-in.
  • Writes happen through Obsidian APIs after review.

Models

The model picker focuses on practical Codex models for ChatGPT-account Codex usage:

ModelGood for
gpt-5.5Harder reasoning, editing, and Agent mode.
gpt-5.4-miniEveryday note questions and shorter rewrites.
gpt-5.3-codex-sparkFast study prompts, quick explanations, and lightweight chat.

If a model fails, check your local Codex account:

codex debug models

Settings

Open Settings -> Codex Chat Panel.

SettingDefaultNotes
Codex CLI pathcodexUse an absolute path if Obsidian cannot find the CLI.
Modelgpt-5.5Same models as the panel picker.
Include active fileonSends the current note as context.
Include selectiononSends highlighted text when available.
Max active-file context24000 charsLarge notes are clipped in the middle.
Timeout180 secondsStops long Codex calls.
Answer languageKoreanCan be changed to English or match latest message.

Build From Source

git clone https://github.com/hesong0222-dev/obsidian-codex-chat-panel.git
cd obsidian-codex-chat-panel
npm ci
npm run build
npm run install-local -- /path/to/your/obsidian/vault

Then reload Obsidian and enable the plugin.

How It Works

The plugin calls Codex CLI in JSON event mode:

codex exec \
  --model gpt-5.5 \
  --json \
  --skip-git-repo-check \
  --ephemeral \
  --ignore-user-config \
  --ignore-rules \
  --sandbox read-only \
  -C /path/to/vault \
  --output-last-message /tmp/obsidian-codex-answer.txt \
  -

The prompt includes:

  • vault root
  • active note path
  • active note content
  • highlighted selection, if any
  • extra context files, if any
  • recent chat turns
  • latest user message

The panel listens to Codex JSONL events for status updates and assistant messages. It still reads --output-last-message as a final fallback, so noisy CLI logs do not show up in the chat.

In Edit mode, Codex must return structured JSON:

{
  "operation": "replace_selection",
  "content": "updated Markdown",
  "summary": "what changed"
}

The plugin then shows a diff preview. The result is written only after you choose Apply.

Troubleshooting

Obsidian Says Codex Failed

Run this in a terminal:

codex exec --model gpt-5.5 --sandbox read-only --skip-git-repo-check "Reply with ok"

If that fails, fix Codex CLI login or model access first.

Obsidian Cannot Find codex

Set an absolute path in plugin settings.

Common macOS paths:

/opt/homebrew/bin/codex
/usr/local/bin/codex

Selection Is Not Sent

Make sure Include selection is enabled in settings. Then select text in the note before clicking the panel.

The panel shows Selected N chars when it has captured a selection. When possible, the note also shows quick actions beside the selected text.

Development

npm ci
npm run dev
npm run build
npm run check

The generated Obsidian files are:

  • main.js
  • manifest.json
  • styles.css

Release Checklist

  1. Bump version in manifest.json, package.json, package-lock.json, and versions.json.
  2. Run npm run check.
  3. Commit changes.
  4. Tag the version:
git tag 1.0.1
git push origin main --tags

GitHub Actions uploads the three release files.

Roadmap

  • Submit to the official Obsidian community plugin directory.
  • Add BRAT install instructions.
  • Add optional prompt preset editing.
  • Add smarter model availability detection from codex debug models.
  • Add keyboard-first quick action shortcuts.
  • Add a small public demo video with a clean sample vault.

Contributing

Small, practical improvements are welcome. Please keep the panel quiet, fast, and note-first.

Good first issues:

  • polish the Obsidian theme integration,
  • improve selection behavior across editor modes,
  • add tests around diff parsing and stale-content checks,
  • write a clean sample vault for screenshots and demos.

Before opening a PR:

npm run check

License

MIT.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.