Kaz Namba337 downloadsRun Claude Code, Codex and OpenCode in terminal tabs in your Obsidian vault, next to your notes. Sessions keep running after you close a tab. See each session's state and cost, and your usage limits.
English | 日本語
Claude Code, Codex and OpenCode in terminal tabs inside your Obsidian vault.
Install · Docs · Troubleshooting · Disclosures · 日本語
Run Claude Code, Codex and OpenCode in terminal tabs inside Obsidian, next to the notes in your vault.

agent-sessions (run by Python), keeps them going. (Programs it starts)For people who have agents write documents, often for several projects at once.
Not for people who want a chat panel or an agent that edits the open note in place (you get the agent's own terminal), people who work only on mobile, or people who want Obsidian on Windows to use agents inside WSL (see Supported environments).

The plugin shows this dialog before it installs anything.
~/.claude/settings.json, after backing up the file. Through them, Claude Code tells the plugin each session's state and its usage. The hooks apply to all your Claude Code sessions, including ones started outside Obsidian. (Files it writes)All three open in tabs and appear in the lists with their state. They differ mainly in the usage figures. Claude Code and Codex subscriptions limit how much you can use in each 5-hour and 7-day window, and the plugin shows how much of each you have used.
| Agent | Opens in a tab | Listed with its state | Usage limits and cost |
|---|---|---|---|
| Claude Code | ✅ Yes | ✅ Yes | ✅ Yes |
| Codex | ✅ Yes | ✅ Yes | ✅ Yes |
| OpenCode | ✅ Yes | ✅ Yes | Cost only |
OpenCode has no 5-hour or 7-day usage limits, so only its cost is shown. Its sub-agent sessions and opencode run sessions are not listed.
@ file completion, normal paste and undo, and input methods for languages such as Japanese and Chinese. MoreThe Session manager groups sessions by category (a session named Docs: Release notes is in Docs) and shows their cost per 5-hour and 7-day window. Below the sessions, each window shows the time until it resets and whether you will reach the limit at your current pace. Costs are estimates. More

New session asks for a name, and for the agent when more than one agent is enabled in the settings. Claude Code, Codex and OpenCode sessions share the same lists. More

Each session is the agent's command-line program in an Obsidian tab, with your settings, login, slash commands, hooks, skills and MCP servers. More

Open tabs, running sessions without a tab, and recent ones, each with an icon for its state. Click one to bring its tab to the front or open it again; an ended session resumes its conversation. Below the list, a sentence explains the selected session's state. More

Docs: Release notes puts a session in the Docs category.All features: docs/usage.md.
| Obsidian runs on | Agent runs on | Supported |
|---|---|---|
| macOS | macOS | ✅ Yes |
| Linux | Linux | ✅ Yes |
| Windows 10 (1809+) or 11 | Windows | ✅ Yes |
| Windows | WSL | ❌ No |
| WSL2 through WSLg | the same WSL distribution | ✅ Yes |
Obsidian and the agent must run in the same operating system, because the plugin starts and follows the agent's processes and files. If your agents run in WSL, run Obsidian in WSL through WSLg, and keep the vault in the WSL file system rather than under /mnt/c.
agent-sessions helper program and starts your first session. During setup it shows whether Python and each agent were found; if one is missing, see Requirements. To come back to the guide later, run Continue the welcome guide from the command palette.Where the program goes, and installing from source: docs/installation.md.
docs/installation.md), then set agent-sessions location in the plugin's settings to the program in the clone.bun:ffi dlopen() is not available in this build (TinyCC is disabled): OpenCode's ARM64 build (the one WinGet installs there) cannot start its terminal UI. Install OpenCode's x64 build instead; Windows runs it under emulation.node: not found, or a problem not listed here: see docs/usage.md.tui.json values. From ~/.claude/keybindings.json it removes only the keys the plugin added (enter, meta+enter, cmd+enter, ctrl+enter, shift+enter, alt+enter, ctrl+q, meta+g and ctrl+g: null), and only where the value is still the one the plugin set. A key with another value stays, with a warning. An emptied Chat block is removed. It does not bring back a binding you had before, and it does not delete the file.~/.agents/sessions/, <vault>/.agents/sessions/, and the backups ~/.claude/settings.json.bak-* and ~/.codex/config.toml.bak-*. Claude Code also leaves empty project folders in ~/.claude/projects/ for the plugin's own runs (see Files it writes); delete the ones whose names end in -agents-sessions-organize or -agents-sessions-efficiency-run-current, or contain agent-sessions-usage-.Source installs: docs/installation.md.
No telemetry and no account. The plugin itself sends no conversation text anywhere, except when you press Suggest in Organize names and categories or Analyze in Stretch your usage limit. Remote Control, when you turn it on, works as described under Network. The agents in your tabs have the same permissions as in your terminal and connect to their own services under your accounts. The agents that Organize and Stretch start have fewer permissions (see What Organize sends and What "Stretch your usage limit" sends), and Remote Control sessions use the mode you choose.
/usage, the welcome guide's pictures and the Windows install buttons, all described below, the plugin and its program make no network connections for their own work. The plugin talks to the program's background process on this machine: a Unix socket (mode 0600, so only your user can open it), or on Windows 127.0.0.1 on a random port with a secret token.claude remote-control --spawn=same-dir --permission-mode <mode> in the vault folder (same-dir starts every session in that folder). That Claude Code process stays connected to Anthropic's servers and starts a session in this vault for each connection made from claude.ai or the Claude app by anyone signed in to your Claude account. You choose the mode with Remote Control permission mode in the plugin's settings, under Claude Code: default (asks for permission as Claude Code normally does), acceptEdits, plan or auto. The default is auto, where Claude uses tools without asking and Claude Code's classifier (which judges how risky an action is) blocks risky actions; if Claude Code does not accept auto, the sessions run in Claude Code's default mode, which asks for permission. The first time you turn the toggle on, and again the first time after you change the mode to auto, a dialog names the mode, says who can start sessions and, for auto, that Claude uses tools without asking; the server starts only after you confirm. It is off until you click the toggle, and it is never started by loading Obsidian or the plugin. Quitting Obsidian does not stop it, because the program's background process runs the server; switch the toggle off, or use Remove, to stop it./usage, at most once every 5 minutes. Claude Code then asks Anthropic's servers for your account's current usage. It sends no prompt or file and calls no model.raw.githubusercontent.com. No data of yours is sent; GitHub sees your IP address and which picture is requested. Turn this off with Load the guide's pictures from GitHub in the settings.winget install for your user only. WinGet downloads the package from its source on the internet. Nothing runs until you click the button.agent-sessions new --remote-control, run by an agent skill, or resuming a session that was in Remote Control) runs claude --remote-control=<name>. That process also stays connected to Anthropic's servers.agent-sessions, with the Python found on your machine. It is written out from the plugin when you click Install; nothing is downloaded.claude remote-control, only after you click the rc toggle.claude -p /usage --no-session-persistence, while Claude Code is enabled, at most once every 5 minutes, in an empty temporary folder without MCP servers or your user settings. It saves no conversation; see Network.ollama launch opencode if you choose Ollama to launch OpenCode in the settings. The plugin's settings run ollama list to offer your Ollama models..zshrc or .bashrc), to get the same PATH as a terminal. Through the login shell it runs command -v <agent> and npm config get prefix, to find agents installed with npm.<agent> --version for each agent, to show its version in the settings, and codex --help, to check whether Codex accepts --no-daemon.ps, to see which processes belong to which session. On macOS, lsof, to find the files a Codex process has open.rg, or grep if rg is missing, to find session names and goals in Claude Code's transcripts.reg.exe (to read PATH), py.exe (to find Python), cmd.exe (to run .cmd launcher files such as npm's, and to shorten folder names that contain spaces), and winget.exe only when you click an install button.To list sessions and calculate usage:
~/.claude/projects/, ~/.claude/sessions/, ~/.claude/settings.json~/.codex/ (or $CODEX_HOME)~/.local/share/opencode/opencode.db, opened read-onlyIf opencode.db cannot be opened read-only, it is copied, with its -wal and -shm files, to a temporary folder, read there, and the copy deleted when the program closes it.
These are the default places. The plugin follows $CLAUDE_CONFIG_DIR in place of ~/.claude for settings.json and keybindings.json, $XDG_DATA_HOME for OpenCode's database and $XDG_CONFIG_HOME for ~/.config/opencode/.
For Stretch your usage limit, it also reads:
CLAUDE.md, .claude/rules/ and auto memory MEMORY.md and the number of skills at each session's start, and Codex's rollouts the AGENTS.md it loaded. For OpenCode, it reads the size of AGENTS.md (or CLAUDE.md) in the session's folder and the folders above it up to the Git root, and of ~/.config/opencode/AGENTS.md.model and model_provider of $CODEX_HOME/config.toml and the model list in $CODEX_HOME/models_cache.json, to choose the model for the analysis.baseURL in ~/.config/opencode/opencode.json, to tell which models run on this machine..git, a CLAUDE.md or (Codex and OpenCode) an AGENTS.md, to tell which instruction file covers it.| Path | Contents | When |
|---|---|---|
~/.agents/sessions/ |
socket, logs, status files, caches | always |
~/.local/share/agent-sessions (Windows: %LOCALAPPDATA%\agent-sessions) |
the program | on Install |
~/.claude/settings.json |
four hooks, statusLine |
on Install |
~/.claude/keybindings.json |
submit key, editor key | if changed from the default |
~/.codex/config.toml |
submit and editor keys if changed, status line if unset | Codex enabled |
~/.config/opencode/plugins/agent-sessions.js |
status plugin | OpenCode enabled |
~/.config/opencode/agent-sessions-tui.jsx |
status line | OpenCode enabled |
~/.config/opencode/tui.json |
editor key, submit keys, status line entry | OpenCode enabled |
| a temporary file | the prompt being edited | built-in editor open |
| a temporary folder | a copy of opencode.db with its -wal and -shm files, only if it cannot be opened read-only |
while it is read; removed when closed |
~/.agents/sessions/efficiency/cache/ |
statistics for Stretch your usage limit (numbers and relative paths, no conversation text) | Stretch your usage limit opened |
~/.agents/sessions/efficiency/last-<tab>.json, prev-<tab>.json |
the last two analyses of each tab in the Stretch dialog (one tab per agent and provider: claude, codex-openai, opencode-ollama, …), with masked quotes |
after Analyze |
~/.agents/sessions/efficiency-run/current/ |
the analysis's empty working folder | during Analyze |
<vault>/.agents/sessions/sessions.json |
sessions started here (folder, agent), archive, category colors, folded groups | always |
<vault>/.claude/skills/ |
the agent-sessions and agent-sessions-help skills |
Claude Code enabled |
<vault>/.agents/skills/ |
the same skills | Codex enabled |
<vault>/.opencode/skills/ |
the same skills | only OpenCode enabled |
~/.claude/settings.json and ~/.codex/config.toml are backed up before they are changed. The previous tui.json values are kept in ~/.agents/sessions/opencode-tui-backup.json.~/.claude/keybindings.json, it adds $schema and $docs entries if they are missing and saves the whole file with two-space indentation.sessions.json travels with the vault if you sync the vault.~/.claude/projects/ (holding at most an empty memory folder) for each folder the plugin runs it in, even when no conversation is saved: one for Stretch's working folder, one for Organize's, and a new one for every /usage run. The plugin does not delete them; see Uninstall.docs/installation.md.Nothing is sent until you press Suggest in Organize names and categories. Then the plugin runs one of your agents once: Claude Code if it is enabled in the plugin's settings, else Codex, else OpenCode. The dialog names which:
claude -p with Sonnet (or Haiku, in the settings), without tools, nothing saved.codex exec in a read-only sandbox, without tools (shell, web search, MCP servers).opencode run without tools, its stored session deleted afterwards.For up to 30 sessions, or for the one session you opened it from, it sends the current name, the folder, the first prompt, your last three prompts and a short excerpt of the last reply (the folder, prompts and reply masked in the same way as for Stretch your usage limit, below; the current name and the example session names are sent as they are); your existing category names with their session counts and up to three example session names each; and, if you ask again, the previous suggestion and your comments. The request goes to the agent's service under your account and counts toward that account's usage limits.
Opening Stretch your usage limit… computes statistics on this machine and sends nothing. Only when you press Analyze in a tab does the plugin run that conversation's own agent: once, judging all nine checks (listed in the docs), or, when the range is too large for one request, once per period, one after another, at most ten times. Codex and OpenCode are analysed for the provider their conversations used most; conversations held with another provider are left out.
The range is chosen in this order: the 5-hour usage window, if it is used at least 80%; else the 7-day window, if it is; else the newest calls up to 10,000,000 weighted tokens (input, output and cache tokens weighted to one scale), going back at least 24 hours and at most 7 days. The 80% (50 to 95%) and the 10,000,000 (1,000,000 to 100,000,000) are Usage limit threshold and Budget in the settings.
claude -p with Sonnet (or Opus, in the settings), without tools, nothing saved.codex exec with a read-only sandbox, without tools and no rollout saved, on a model Codex lists for your account ($CODEX_HOME/models_cache.json). Sol, Terra and Luna are Codex's three model tiers, named by the end of the model ID (…-sol, …-terra, …-luna): in the newest generation, the plugin takes the Sol model, else Terra, else Luna. If Codex refuses the model, the plugin tries the next of those three, then the next older generation, then the model in config.toml (the only one, if the list is missing). A local provider (Ollama, LM Studio) uses its most used model in the range.opencode run without tools, with the provider and its most used model in the range; the run's session is deleted afterwards. A provider on this machine (Ollama, LM Studio, or a baseURL on this machine) is analysed by its local model, so nothing leaves the machine.A conversation is never sent to another agent or provider, and a tab's statistics name only that provider's sessions. Before you press Analyze, Details above it shows where the request goes, about how much is sent and in how many requests. Show what is sent, inside Details, shows the exact text of every request.
What is sent is a digest of every task in the range, in numbers and short excerpts:
~/.agents/sessions/efficiency-run/current/, made fresh for each run and removed when it ends. Claude Code keeps one empty project folder for it under ~/.claude/projects/.~/.agents/sessions/efficiency/ until you delete them.After an analysis, an issue that a file or setting can fix has Ask the agent to fix it. It only starts a new session in the vault, with a request you can read and edit first, set to ask before it changes anything: Claude Code in plan mode (it proposes the change and waits for your approval), Codex with a read-only sandbox that asks before writing, OpenCode with its plan agent. The plugin writes no file itself.
@ paths in the built-in editor.Build, test, release and design: docs/development.md.
MIT, see LICENSE. plugin/main.js bundles xterm.js and its addons (also MIT); their notices are in THIRD_PARTY_NOTICES.md.