Skip to content

[FEATURE]:Add /refresh or /sync command to rescan new files during TUI session #46417

Closed as duplicate

Description

@wangxiaolong-1

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

Is your feature request related to a problem? Please describe.

When using OpenCode in TUI (terminal) mode, the file index is built once at startup and will not auto‑update during the active session.

If new files are created outside OpenCode (via native terminal, VS Code or other editors) while a conversation is ongoing, these newly‑created files will not show up in the @‑triggered file autocompletion list.

Users are forced to either manually input full file paths in prompts, or fully restart the TUI session to trigger a fresh project directory scan.

Describe the solution you'd like

Add a new TUI built‑in command such as /refresh or /sync to manually trigger project filesystem rescan and refresh the in‑session file index.

Expected behaviors for this command:

  • Rebuild file autocompletion list for @ file mentions
  • Refresh working context so the AI can recognize newly‑created files without restarting the whole TUI session

Describe alternatives you've considered

Two existing workarounds, both have obvious drawbacks:

  1. Restart TUI session: Exit with /exit and relaunch OpenCode. Works reliably but disruptive, especially for long‑running conversations or ongoing background tasks.
  2. Manually pass full file path: Write complete file path in prompt (e.g. Please check the file I just created at src/utils/helper.ts). The AI may read the target file, yet the autocompletion list still stays stale.

Additional context

  • OpenCode currently uses a startup‑time snapshot‑based file index.
  • There is an experimental env flag OPENCODE_EXPERIMENTAL_HOT_RELOAD, but it targets configs, skills and commands, not filesystem file rescanning for TUI.
  • Similar community requests for /reload / /sync command have been raised before; this capability is still unimplemented as of now.

Use case example

  1. Launch OpenCode TUI session.
  2. Within an active conversation, create a new file externally: src/utils/api-client.ts.
  3. Try referencing this file via @ — it is missing from autocomplete suggestions.
  4. Run /refresh (new command) → file index gets updated, new file appears in the @ completion list.

Platform

  • OpenCode version: 1.18.25
  • OS: Windows
  • Installation method: npm
  • Related community note: Community users confirmed /refresh command does not exist inside TUI; session restart remains the only stable workaround.

Activity

  1. neriousy commented on Oct 20, 2026

    @neriousy
    Member

    Thanks for the request. We're tracking this same file-index refresh capability, including a TUI command, in #40392, so I'm closing this as a duplicate. Please follow that issue for updates.

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