anomalyco / anomalyco/opencode

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

Open
#46,417 0 comments 1 reaction 1 assignee View on GitHub

@simonklee is already working on this.

Since Aug 31, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.