Skip to content

[FEATURE]: Desktop client should provide cache management and cleanup settings #29037

Closed as not planned

Description

@JinkaiNiu

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

opencode generates various cache files under ~/.local/share/opencode/ during normal operation. The tool-output/ directory, which stores raw output from tools like WebFetch (HTML, JS, cookies, etc.), can grow to 20GB+ over time with no automatic cleanup mechanism.

Currently, compaction settings (compaction.prune) only manage in-memory context/token compression and do not affect on-disk cache files. Users must manually rm -rf these directories.

Suggested solution:

Add a cache management page in the Desktop client's Settings/Preferences with:

  1. Cache overview — list cache categories and their current disk usage:

    • tool-output/ — tool output cache (WebFetch, etc.)
    • log/ — log files
    • repos/ — cloned repositories
    • storage/ — session storage data
    • Session/prompt history
  2. Cleanup actions:

    • One-click "Clear" button per category or "Clear All"
    • Auto-cleanup policies (e.g., on exit / by size threshold / by age)
  3. Storage limit — configurable maximum cache size; auto-clean oldest data when exceeded

Benefits:

  • Prevents unbounded disk usage without user awareness
  • Improves desktop client user experience
  • Aligns with common IDE conventions (e.g., VSCode's built-in cache management)

Activity

  1. github-actions commented on May 23, 2026

    @github-actions
    Contributor

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

    If your request covers new ground not addressed in those issues, feel free to clarify the distinction. Otherwise, consider adding a comment or upvote there instead.

  2. JinkaiNiu commented on May 23, 2026

    @JinkaiNiu
    Author

    Thanks for the links. I've reviewed all three related issues and believe this feature request is distinct from each of them:

    vs #25816 (Factory reset, session management, and cache cleanup tools):
    That issue proposes a CLI-level "clear cache" command and factory reset functionality. My request focuses specifically on the Desktop client UI — a visual cache management page in Settings/Preferences that:

    • Shows per-category disk usage (tool-output, log, repos, storage, etc.)
    • Provides one-click cleanup per category, not just a blanket "clear all"
    • Supports auto-cleanup policies (on exit, by size threshold, by age)
    • Enables configurable storage limits with automatic eviction of oldest data
      The tool-output/ directory alone can grow to 20GB+ from WebFetch tool calls with no visibility or cleanup mechanism — this is a concrete UX problem in the Desktop client that a CLI command alone doesn't solve.

    vs #28600 (Centralize persistent state and document all config/cache paths):
    That issue proposes an opencode paths diagnostic command to list where files live. It's about discoverability/documentation, not about cleanup or storage management. The two are complementary but not overlapping.

    vs #24255 (Auto-cleanup of large cached legacy opencode binaries):
    That issue is about cleaning up old opencode versions in Bun's install cache (~/.bun/install/cache/), which is a package manager cache concern, not about opencode's own runtime cache at ~/.local/share/opencode/.

  3. blain3white commented on Jun 9, 2026

    @blain3white

    For a stopgap while native settings are designed: I'm the author of Clean My Agent, which handles cache inspection and cleanup for OpenCode desktop sessions from outside the app.

  4. github-actions commented on Aug 9, 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.

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