Skip to content

[FEATURE]: Add --all flag to /sessions command to view sessions across all projects #17842

Closed as not planned

Description

@ncopilot-boop

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Problem

The /sessions command only shows sessions from the current working directory. This makes it impossible to find or resume sessions from other projects without navigating to each project directory individually.

Current Behavior

  • Sessions are stored globally in ~/.local/share/opencode/storage/session/global/
  • But /sessions filters by current directory, showing only sessions created in that specific path
  • Users with multiple projects cannot see their full session history from one location

Example

I have 16 sessions stored across different directories:

  • 7 from C:\Prodprog
  • 3 from C:\Prog\program1
  • 3 from C:\Prog\program2\pog
  • 2 from C:\Users\someuser When running /sessionsfromC:\Prog\program3I only see 2 sessions (the ones created in that directory). My other 14 sessions are effectively invisible unless Icd to each original directory.

Proposed Solution

Add an --all or -a flag to the /sessions command:
/sessions --all # Show sessions from ALL projects
/sessions -a # Short form

Optional Enhancements

  • Group results by project directory for readability
  • Add a --project <path> flag to filter to a specific project without navigating there
  • Show project path in the session list output

Use Cases

  1. Session recovery: Finding an old session when you don't remember which project it was in
  2. Cross-project context: Quickly referencing work done in related projects
  3. Session cleanup: Viewing all sessions to identify ones to delete
  4. Workflow continuity: Resuming work when switching between multiple projects

Environment

  • OS: Windows 10 (Git Bash)
  • opencode version: 1.2.x
  • Session storage: ~/.local/share/opencode/storage/session/global/

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Mar 16, 2026
  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 16, 2026
  3. github-actions commented on Mar 16, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  4. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  5. github-actions commented on Jul 7, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  6. wsaaaqqq commented on Jul 22, 2026

    @wsaaaqqq

    I know this was closed, but I had the exact same pain -- 14 invisible sessions stuck in other project directories.

    I built a workaround: oos (https://github.com/wsaaaqqq/oos)

    It's a small TUI that reads the OpenCode database directly, so it naturally searches across ALL projects -- no --all flag needed. Type a keyword, find any session from any project, Enter to resume.

    Since this feature request was closed, I figured it might help others in the same boat. MIT, one-liner install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions