AI Coding Tools Filling Up Your C Drive? A Practical Guide to Symlink Migration
AI coding tools can quietly consume tens of gigabytes on your system drive through model caches, plugin directories, and session logs. This article explains why these folders cannot simply be deleted, how symbolic links let you relocate them transparently, the four checks to run before migrating, a reusable step-by-step procedure, common pitfalls, rollback strategy, and longer-term ways to control cache growth.
1. The Symptom: How the System Drive Silently Fills Up
Most developers have seen this happen: you install an AI coding tool, use it happily for a month or so, and everything feels smooth. Then one day a new session fails to start, and you discover the system drive has 0 bytes free. Meanwhile, tens of gigabytes of files sit in your user directory, and you can neither delete them nor move them.
The growth usually happens in three stages:
- Model and index caches: To reduce time-to-first-token latency, the tool stores model weights, code indexes, and embedding results locally.
- Plugin and runtime directories: Plugin binaries, dependency packages, and temporary files created by language service processes keep accumulating.
- Inference and log data: Session context, inference traces, and crash logs grow linearly with each session and are rarely cleaned up automatically.
The key takeaway: these directories should not simply be deleted. Delete the model cache and the next session re-downloads it; delete the index and the project gets rescanned; delete session data and you lose context. The right fix is not deletion, it is relocation.
2. How Symlinks Make the Move Transparent
A symbolic link is a file system pointer. The original path on the system drive still exists, but it now points to the real directory on a larger disk. To the application, nothing has changed: the path is the same and read/write behavior is identical. To the disk, the bytes now live on a different drive.
Illustrative commands (Windows, requires administrator privileges):
:: 1. After closing related processes, move the real directory to the target drivemove "%USERPROFILE%\.example-tool" "D:\cache\.example-tool":: 2. Create a directory symbolic link at the original locationmklink /D "%USERPROFILE%\.example-tool" "D:\cache\.example-tool"
The equivalent on Unix-like systems:
mv ~/.example-tool /mnt/data/cache/.example-toolln -s /mnt/data/cache/.example-tool ~/.example-tool
Two things to watch: directory links need /D (and with ln -s, be aware of the pitfalls around not using -n), while file links do not. Before moving across volumes, confirm the target drive has more free space than the source directory occupies.
3. Four Checks Before You Migrate
- Permissions: Creating a symbolic link is a system-level operation. Normal privileges will fail, so run as administrator.
- Process locks: Even with the UI closed, an AI coding tool usually has multiple language service and runtime processes holding file handles, which causes “file in use” errors during the move. Terminate all related processes first.
- Space check: Leave roughly 1.2x the source directory size free on the target drive so the move does not fill it up midway.
- Path record: Write down the “original path → physical path” mapping before migrating. Both troubleshooting and rollback depend on it.
4. A Reusable Migration Procedure
- Identify: List the candidate directories (model cache, plugin directory, inference data, log directory).
- Clear the field: End all background processes and confirm no handles are open.
- Move: Relocate directories one at a time, so a failure on one does not affect the others.
- Link: Create a symbolic link at each original path.
- Verify: Start the tool, create a new session, open a project, and trigger one full inference to confirm there are no errors.
- Observe: Confirm both the free space on the system drive and the actual physical location of the directories.
For a repeatable setup, write the mapping into a manifest file so you can roll back in bulk:
[{ "logical": "C:\\Users\\me\\.example-tool\\models", "physical": "D:\\cache\\models" },{ "logical": "C:\\Users\\me\\.example-tool\\logs", "physical": "D:\\cache\\logs" }]
5. Common Pitfalls and Rollback
- Linking before moving: You end up with an empty directory plus a link, and the data is gone. The order must always be move first, link second.
- Copying instead of moving: The original directory remains, so no space is actually saved.
- Insufficient permissions: The link creation fails after the directory has already been moved, so the tool reports a missing path on startup and you have to create the link manually.
- Rollback: Delete the symbolic link (this removes only the pointer, not the real data), then move the real directory back to its original path. When deleting, make sure you remove the link rather than recursively deleting the source directory.
6. A More Fundamental Approach
Symlinks are a stopgap. The long-term fix is to control the source: periodically clean up expired sessions and logs, point cache directories at the larger drive during installation, and set retention limits on project-level indexes. If you use a cloud development environment, you can put caches and logs on object storage or a dedicated data disk, decoupling compute from storage so the system drive never becomes the bottleneck.
