Manage Hermes Agent and OpenCode sessions directly within VS Code.
Features
- Hermes Session Manager
- Resume one or more Hermes sessions into VS Code terminal tabs.
- Show a session's recorded directory, with the Hermes CLI Workspace label as a fallback for older sessions.
- Resume a session in its recorded directory when that directory still exists.
- Rename sessions inline.
- Delete single or multiple stopped sessions.
- Optionally delete parent Hermes sessions discovered from
~/.hermes/state.db. - Stop running sessions by PID.
- Clean untitled/empty sessions, including newly exposed empty child-session chains.
- Create a named session, rename it, and immediately resume it in a terminal.
- OpenCode Session Manager
- List OpenCode sessions across projects from
~/.local/share/opencode/opencode.db. - Resume one or more sessions in their original project directories.
- Detect active OpenCode sessions from each process's local
--portstatus endpoint, so/forkand/newfollow the current session instead of stale startup arguments. - Fall back to a
--session <id>process argument only when the status endpoint cannot be queried. - Show a directory-level count for idle OpenCode terminals without guessing their current session IDs.
- Delete stopped sessions and stop running OpenCode processes.
- Clean empty/untitled sessions and generated subagent sessions.
- Start a new OpenCode terminal.
- Optionally append
--autoand a probed random five-digit--portto every extension-started OpenCode terminal. - Notify through VS Code when an extension-started session finishes a busy turn; the notification can focus its terminal.
- Toggle subagent-session visibility from the manager toolbar; the choice persists between openings.
- List OpenCode sessions across projects from
- Explorer Context Menu
- Right-click a folder and run 打开 Hermes.
- Pick one or more Hermes sessions associated with that directory or Git repository, or start a new Hermes terminal in the folder.
- Right-click a folder and run 打开 opencode.
- Pick one or more existing OpenCode sessions for that directory or start a new one.
Requirements
- For Hermes features:
hermesmust be installed and available inPATH. - Hermes directory matching and cwd details require the
sqlite3CLI because they are read from~/.hermes/state.db. - For OpenCode features:
opencodemust be installed inPATHor at~/.opencode/bin/opencode. - OpenCode session listing requires the
sqlite3CLI because sessions are read from the local OpenCode database.
Settings
| Setting | Default | Description |
|---|---|---|
hermesSessionManager.hermes.yolo |
false |
Appends Hermes's --yolo option to every terminal launched by this extension. This bypasses dangerous command approval prompts. |
hermesSessionManager.opencode.autoApprove |
false |
Appends OpenCode's --auto permission-approval option to terminals launched by this extension. |
hermesSessionManager.opencode.useRandomPort |
false |
Probes a random port from 10000 to 65535, then passes it as --port <port> to terminals launched by this extension. The best-effort probe does not reserve the port. |
hermesSessionManager.opencode.completionNotifications |
true |
Sends a VS Code notification when an extension-started OpenCode session finishes a busy turn and becomes idle. It automatically enables a random port for status polling. |
The OpenCode manager toolbar can hide subagent sessions. This choice is remembered locally and uses the session database's parent_id relationship.
Commands
This extension contributes the following command:
Hermes: Resume Sessions: opens the Hermes session manager.打开 Hermes: folder context menu command for resuming a directory-associated Hermes session or starting one in that directory.OpenCode: Resume Sessions: opens the OpenCode session manager.打开 opencode: folder context menu command for opening OpenCode in that directory.
Development
cd extension
npm install
npm test # compile and run Node tests
npm run compile
npx vsce package
code --install-extension hermes-session-manager-0.1.10.vsix --force
Release Notes
0.1.10
- Track active OpenCode sessions from each process's status port so
/forkand/newdo not leave an old session marked as running. - Show idle OpenCode terminal counts at the directory level and include session IDs in list details to distinguish same-title forks.
0.1.9
- Mark running OpenCode sessions only when the process explicitly carries
--session <id>. - Show a directory-level notice for OpenCode processes without a session argument, without guessing a session ID.
- Added an opt-in Hermes
--yololaunch setting. - Added batch recovery to both directory context-menu session pickers.
- Made Hermes empty-session cleanup rescan orphaned empty child-session chains.
- Added VS Code notifications for extension-started OpenCode sessions that return from busy work to idle.
0.1.8
- Added the
打开 HermesExplorer action for directory-associated Hermes sessions and new directory-scoped terminals. - Added title, workspace, and full-path filtering to both session managers.
- Fixed OpenCode session timestamps stored in milliseconds and simplified duplicate directory display.
0.1.7
- Added opt-in OpenCode
--autoand random five-digit--portlaunch settings. - Added a persisted toolbar toggle for hiding or showing OpenCode subagent sessions.
0.1.6
- Renamed the public product to Hermes + OpenCode Session Manager.
- Preserved the existing Marketplace extension ID and command IDs for seamless upgrades.
0.1.5
- Refreshed README and changelog to match the current Hermes + OpenCode implementation.
- Updated package metadata for the next VSIX build.
0.1.4
- Added OpenCode session management.
- Added folder context menu entry for OpenCode.
- Added running-process detection, stop actions, cleanup actions, and new-session entry points.
- Fixed Hermes new-session creation in WSL by running
hermes chat -qfrom the user's home directory.
0.1.0
- Initial release of Hermes Session Manager.
- Features: Batch resume, rename, delete, and new session creation.
- Improved UI with status grouping for running sessions.