anomalyco / anomalyco/opencode
[FEATURE]:Add /refresh or /sync command to rescan new files during TUI session
@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:
- Restart TUI session: Exit with
/exitand relaunch OpenCode. Works reliably but disruptive, especially for long‑running conversations or ongoing background tasks. - 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//synccommand have been raised before; this capability is still unimplemented as of now.
Use case example
- Launch OpenCode TUI session.
- Within an active conversation, create a new file externally:
src/utils/api-client.ts. - Try referencing this file via
@— it is missing from autocomplete suggestions. - 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
/refreshcommand does not exist inside TUI; session restart remains the only stable workaround.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.