Solution to Cache Issues Occurring During Directory Navigation in WSL + VSCode

The VSCode “Remote – WSL" extension is used by many developers because it allows them to work on Windows-side projects directly from the Linux environment on WSL.
It is also common to map directories on Windows to the WSL side using symbolic links, operating them as if they were directories on the Linux side.

ln -s /mnt/c/Users/xxx/project ~/project

Combining this setup with an AI IDE such as Gemini enables an efficient development environment, but I heard that an unexpected phenomenon occurred in a certain situation.

目次

When the src Directory Was Replaced on the Windows Side, the AI IDE Continued to Reference the Old Contents

In a certain environment, work was performed to replace the src directory on Windows with a backup.
Since the paths visible from VSCode and WSL do not change, this operation should not normally cause any problems.

However, when asking Gemini to edit code,
a phenomenon occurred where the contents of the old src directory, which should have already been deleted, continued to be referenced.

  • New files are not visible
  • Treated as if old files still remain
  • Updates under the symlink are not reflected
  • Errors such as “File does not exist" or “Permission denied" occur

Clearly, the state of the actual files and the AI IDE’s recognition do not match.

The Cause Was in the IDE’s Internal Cache

As a result of investigation, this problem was not due to a malfunction of symbolic links or an issue with WSL,
but rather because the cache held internally by the AI IDE was not updated.

The AI IDE internally retains the following information:

  • Directory structure at startup
  • File existence determination
  • Symlink resolution results
  • Terminal state

Since these may not be updated unless the process is restarted,
even if directories are completely replaced externally (such as via Windows Explorer or Git operations),
the IDE side may not notice the change.

The Solution is Simple: Restart the AI Terminal

Ultimately, this problem was resolved simply by restarting the Gemini terminal.

By restarting, the IDE discards its internal cache and
correctly loads the new directory structure.

  • The new src is displayed
  • Old file information disappears
  • The destination pointed to by the symlink is also correctly re-evaluated

It returned to a normal state.

Lesson: If You Make Major Changes to the Directory Structure, Consider Restarting

The important lesson learned from this case is as follows:

When replacing entire directories in a WSL + Windows configuration, restart the AI IDE (Gemini) or terminal.

WSL and Windows have different mechanisms for file update notifications,
and since AI IDEs operate relying on internal caches,
sudden directory changes may not be reflected on the IDE side.

This is a problem that can occur in a wide range of tools such as VSCode, Gemini, and Copilot.

Conclusion

The VSCode + WSL + Gemini configuration is extremely convenient, but
if you replace directories on the Windows side externally,
the AI IDE may operate while retaining the old cache.

If you feel that files are not updated or that old contents are being referenced,
we recommend trying to restart the terminal first.

Now that AI-assisted development has become mainstream, understanding the internal cache of tools and
resetting it as necessary is also an important point in maintaining a comfortable development environment.