Agent Sessions

approvedunreviewed

by Kaz Namba

Run Claude Code, Codex, and OpenCode sessions as terminal tabs, with a session list, usage analytics, and a daemon that keeps sessions running.

↓ 86 downloadsUpdated 5d agoMIT

English | 日本語

Agent Sessions

An Obsidian plugin that runs Claude Code, Codex and OpenCode in terminal tabs next to your notes. One list shows every session's state and cost, plus each agent's usage limits.

Desktop only: macOS, Linux, and Windows.

A Claude Code session in a terminal tab, with the side panel listing open, running, and recent Claude Code and Codex sessions

Features

Sessions by category, with usage and cost

The Session manager groups sessions named Category: Name and shows their cost per 5-hour and 7-day window. Below, each agent's usage windows show the time to reset and whether you will reach the limit at your current pace. Costs are estimates, calculated on your machine from the agents' local files. More

The Session manager: sessions grouped by category with model, effort and cost, and below, the 5-hour and 7-day windows and cost per category

Start a session with any agent

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

The New session dialog with Claude Code and Codex to choose from, and the name Docs: Release notes

The agent's own CLI in a tab

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

A Codex session in a terminal tab, asking whether to run a test command

Switch between sessions in the side panel

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. Sessions keep running when you close the tab or quit Obsidian. More

The side panel: open tabs, running and recent sessions with state icons and categories, and the Needs input and Needs review counts at the top

A built-in editor for prompts

Press Ctrl+G to write the prompt in a pane under the terminal, with @ file completion, normal paste, undo and IME, while the output stays visible. For Claude Code, the bar also sets model and effort. More

The built-in editor under a Claude Code session: a multi-line prompt, with Model and Effort dropdowns and the Send and Back to prompt buttons above it

Rename and sort into categories

Each session has a ⋯ menu, which a right-click also opens. Its Rename gives the session a name; a name like Docs: Release notes puts it in the Docs category, with its own color and group. Move to category… changes only the category. More

The Move to category dialog for Storefront: Checkout total flicker, with the list of existing categories

Names and categories suggested by an agent

Organize names and categories has one of your agents suggest a name and category for recent sessions. Nothing is renamed until you press Apply selected. It sends session excerpts to that agent; see What Organize sends. More

The Organize names and categories dialog: current and suggested names side by side, with one suggestion unchecked and a comment for the next try

Compact, restart or change model from the session menu

In the same menu, Compact session sends /compact, and Restart session picks up changed settings or skills and keeps the conversation. For Claude Code, Change model… switches model and effort. More

A session's menu in four groups: Rename, Move to category…, Suggest name and category…; Change model…, Compact session, Restart session; Session analytics, Copy ID; End session, Archive

Setup with the welcome guide

On first install, the welcome guide checks Python and your agents, shows what the helper program will write before installing it, and walks you through your first session. More

The Install agent-sessions dialog listing the install folder, Python, the hooks added to Claude Code's settings, and the two agent skills added to the vault

What a session cost, turn by turn

Session analytics shows one session's cost, tokens, turns and duration, the tools it called, and each prompt with its own input, output and cost. Click the first and last row of a stretch of turns to count only those, and copy the result as Markdown. More

Session analytics for one session: cost, tokens, turns and duration at the top, input, output and tool-use bars below, and a table with one row per prompt

When each agent was working

The Activity calendar shows working time as blocks, by 7-day window, week or day. Click a block to see its prompts and open the session. More

The activity calendar: a week of sessions as colored blocks, one lane per agent in each day, with hours and concurrency per agent, and the details panel for one block with its prompts and Open session

Two agent skills also let you ask an agent about your usage, your other sessions, or how to use the plugin. All features: docs/usage.md.

Not included: a chat panel, inline editing of notes, and Obsidian mobile. OpenCode has no usage windows, and its sub-agent sessions and opencode run sessions are not listed.

Requirements

  • Obsidian 1.8.7 or later, desktop.
  • Python 3.9 or later, no extra packages. It runs the helper program that keeps sessions alive.
  • Claude Code, Codex or OpenCode, installed.

Supported environments

Obsidian runs onAgent runs onSupported
macOSmacOSYes
LinuxLinuxYes
Windows 10 (1809+) or 11WindowsYes
WindowsWSLNo
WSL2 through WSLgthe same WSL distributionYes

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.

Install

  1. In Obsidian, open Settings → Community plugins → Browse, search for Agent Sessions, install and enable it.
  2. Follow the welcome guide that opens. It installs the agent-sessions helper program and starts your first session. To come back to it later, run Continue the welcome guide from the command palette.

Where the program goes, and installing from source: docs/installation.md.

Troubleshooting

  • "agent-sessions was not found": click Install agent-sessions in the side panel, or set the program's location in the plugin's settings.
  • "Install agent-sessions yourself (see the README)": install it from a clone (docs/installation.md), then set its location in the plugin's settings.
  • An agent shows "Not found.": set its path in the plugin's settings, or click Detect again in the welcome guide.
  • A session ignores changed settings, hooks or skills: choose Restart session in the session's ⋯ menu.
  • Windows: the install dialog says Python or Claude Code is missing: click Install Python with WinGet or Install Claude Code with WinGet (per user, no administrator prompt).
  • Windows on ARM: an OpenCode tab stops at 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.
  • A hook fails with node: not found, and other cases: docs/usage.md.

Uninstall

  1. Settings → agent-sessions program → Remove. This ends running sessions, removes the program, its entries in the agents' settings, and the skills in the vault, and restores your previous OpenCode tui.json values.
  2. Disable and remove Agent Sessions under Community plugins.
  3. If you want nothing left, delete ~/.agents/sessions/, <vault>/.agents/sessions/, and the backups ~/.claude/settings.json.bak-* and ~/.codex/config.toml.bak-*.

Source installs: docs/installation.md.

Disclosures

No telemetry and no account. The agents have the same permissions as in your terminal and connect to their own services under your accounts.

Network

  • 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), or on Windows 127.0.0.1 on a random port with a secret token.
  • While the welcome guide is open, it loads its pictures from 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.

Programs it starts

  • agent-sessions, with the Python found on your machine. It is written out from the plugin when you click Install; nothing is downloaded.
  • The Claude Code, Codex and OpenCode CLIs you installed, or ollama launch opencode if you choose it. The settings run ollama list to offer your Ollama models.
  • Your shell, as a login shell and as an interactive shell (which reads .zshrc or .bashrc), to get the same PATH as a terminal.
  • On Windows: reg.exe (to read PATH), py.exe (to find Python), and winget.exe only when you click an install button.

Files it reads outside the vault

To list sessions and calculate usage:

  • ~/.claude/projects/, ~/.claude/sessions/, ~/.claude/settings.json
  • ~/.codex/ (or $CODEX_HOME)
  • ~/.local/share/opencode/opencode.db, opened read-only

A database that cannot be opened read-only is copied to a temporary folder, read, and deleted.

Files it writes

PathContentsWhen
~/.agents/sessions/socket, logs, status files, cachesalways
~/.local/share/agent-sessions (Windows: %LOCALAPPDATA%\agent-sessions)the programon Install
~/.claude/settings.jsonfour hooks, statusLineon Install
~/.claude/keybindings.jsonsubmit key, editor keyif changed from the default
~/.codex/config.tomlsubmit and editor keys if changed, status line if unsetCodex enabled
~/.config/opencode/plugins/agent-sessions.jsstatus pluginOpenCode enabled
~/.config/opencode/agent-sessions-tui.jsxstatus lineOpenCode enabled
~/.config/opencode/tui.jsoneditor key, submit keys, status line entryOpenCode enabled
a temporary filethe prompt being editedbuilt-in editor open
<vault>/.agents/sessions/sessions.jsonsessions started here (folder, agent), archive, category colors, folded groupsalways
<vault>/.claude/skills/the agent-sessions and agent-sessions-help skillsClaude Code enabled
<vault>/.agents/skills/the same skillsCodex enabled
<vault>/.opencode/skills/the same skillsOpenCode alone
  • ~/.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.
  • Its entries are marked (Codex, OpenCode, skill files) or recognized by their command (Claude Code); nothing else is changed.
  • sessions.json travels with the vault if you sync it.
  • Other folders the program may be installed in: docs/installation.md.

What Organize sends

Nothing is sent until you press Suggest in Organize names and categories. Then the plugin runs one of your agents once, and the dialog names which:

  • Claude Code: claude -p with Sonnet (or Haiku, in the settings), without tools, nothing saved. Else
  • Codex: codex exec in a read-only sandbox. Else
  • OpenCode: opencode run, its stored session deleted afterwards.

For up to 30 sessions, or the one you chose, it sends the current name, the folder, the first prompt, your last three prompts and a short excerpt of the last reply; 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. This goes to that agent's service under your account and counts toward its usage limits.

Other access

  • The vault's file list: only to complete @ paths in the built-in editor.
  • The clipboard: only when you copy a session ID or an analysis table, or press Ctrl+Shift+C / Ctrl+Shift+V in a terminal tab (not on macOS).

Development

Build, test, release and design: docs/development.md.

License

MIT, see LICENSE. plugin/main.js bundles xterm.js and its addons (also MIT); their notices are in THIRD_PARTY_NOTICES.md.

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.