Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

tree-session

Recursively list all subagent sessions spawned from an OpenCode session, including council councillors. Outputs a hierarchical tree with session ID, agent name, and model information.

Usage

tree-session <session-id> [db-path]

The DB path is auto-detected from ~/.local/share/opencode/ (scans for the active .db file with a .db-wal sibling). You can override with a specific path.

Example

$ tree-session ses_16cf8d213ffeDA60nBiaSWpZfe

Testing quality gate with empty councillor output  (orchestrator · deepseek-v4-pro (max))
    ses_16cf8d213ffeDA60nBiaSWpZfe
    └── Find quality gate config (@explorer subagent)
        ses_16cf841eeffecXKoXXMDVMCeTl  (explorer · deepseek-v4-flash (exec))
    └── Council silent (deepseek-v4-flash)
        ses_16cf8a678ffeEQHxtH1HuB22WN  (councillor · deepseek-v4-flash (default))
    └── Council silent (deepseek-v4-flash)
        ses_16cf8adc8ffeBrkhLVsR0C29sg  (councillor · deepseek-v4-flash (default))
    └── Council silent (deepseek-v4-flash)
        ses_16cf8b5ebffeLloxPMGDP8KjC6  (councillor · deepseek-v4-flash (default))
    └── Council silent (deepseek-v4-flash)
        ses_16cf8c38dffepwHXPhGneVZ9jZ  (councillor · deepseek-v4-flash (default))

How It Works

Uses a recursive CTE on the session table, traversing parent_idid to find all descendant sessions across council and subagent hierarchies. Extracts agent name, model ID, and variant from the JSON model column.

Install

curl -sSL https://raw.githubusercontent.com/hardes11/tree-session/main/tree-session.sh -o ~/.local/bin/tree-session
chmod +x ~/.local/bin/tree-session

Requires sqlite3 and bash.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages