AI Coding Tools Filling Up Your System Drive? Symbolic Link and Junction Migration in Practice
AI coding assistants are heavy on local data: model and runtime caches, editor extensions, session and inference data, and logs all accumulate under the user profile on the system drive until it runs out of space. This article explains where that disk usage comes from and walks through a practical migration that uses symbolic links and directory junctions to move the data physically onto a larger drive while leaving the original paths untouched. It includes Windows PowerShell/cmd commands with Linux/macOS equivalents, a five-step workflow (find the large directories, close the processes, move the data, create the link, verify), rollback steps, permission and volume caveats, and longer-term practices such as scheduled cleanup, capacity monitoring, data tiering, and capacity planning.
1. The Symptom: Why the System Drive Slowly Chokes
Many developers have been through this. A machine with decent specs, and one day the C: drive turns red. Free space shrinks visibly, and eventually the system starts reporting low disk space — sometimes to the point where not even a new session can be created — while the drive creeps toward zero bytes. Once you investigate, the space hog usually isn’t the code you wrote, but the mountains of data that AI coding tools accumulate locally.
The problem is common because AI-assisted development is inherently local-heavy: model inference, context caching, and code indexing all read and write to disk constantly. Whether a tool is good or not is a separate question; its continuous consumption of disk space is a fact.
2. Root Cause: Where the Disk Usage Comes From
Before fixing the problem, understand how the usage builds up. Local disk growth comes from four categories of data:
- Model and runtime caches: locally hosted inference engines, language model weights, dependency runtimes, and similar artifacts. A single directory can easily reach several GB, and old copies keep accumulating as versions are updated.
- Plugin and extension directories: editor-style tools typically keep extensions in one central directory, and the plugins themselves plus their individual caches keep growing.
- Inference and session data: conversation history, context snapshots, intermediate inference results, code indexes, and other “process data” generated at high frequency. The longer you use the tool, the more of it settles on disk.
- Logs and temporary files: run logs, crash dumps, temporary build artifacts. Individually small, but they accumulate into something substantial if never cleaned up.
The key point is that almost all of this data lands under the user profile on the system drive (for example %LOCALAPPDATA% and %APPDATA% on Windows), and the system drive is usually the tightest of them all. At the same time, a good portion of it is data you must keep — deleting it directly can stop the tool from starting or wipe out your history, so a blunt cleanup is not an option.
3. The Core Idea: Redirect the Data with Symbolic Links
The essence of the problem is that the data physically lives on the system drive, while the user-profile layout is hard-wired into the tools. To satisfy both contradictory requirements — “physically moved away” and “path unchanged” — symbolic links are the widely accepted best solution.
A symbolic link is a special filesystem object that holds no data of its own; it only points to another location. To an application, accessing the link path is completely transparent: the tool believes its files are still on C:, while the actual reads and writes happen on a larger D: or G: drive.
Three commonly used “link” technologies need to be told apart:
- Symbolic link: points to a target path and can cross volumes, but requires higher privileges. Good for relocating a directory as a whole.
- Directory junction: works on local volumes only, can be created without administrator rights, and has excellent compatibility — the least troublesome choice for migrating directories.
- Hard link: can only point to the same data within the same volume and cannot cross disks, so it does not fit this scenario.
For the goal of “moving a C: directory over to D:”, symbolic links and directory junctions are the right choices.
4. Walkthrough: The Standard Migration Flow
Below is a reusable procedure, Windows first, with Linux/macOS equivalents.
Step 1: Locate the real space hogs
Find the largest directories first instead of migrating blindly. Under Windows PowerShell you can measure them like this:
# Measure the size of each subdirectory under the user profile, top 20Get-ChildItem -Path $env:LOCALAPPDATA -Directory -Recurse -ErrorAction SilentlyContinue |ForEach-Object {$size = (Get-ChildItem $_.FullName -File -Recurse -ErrorAction SilentlyContinue |Measure-Object -Property Length -Sum).Sum[PSCustomObject]@{ Path = $_.FullName; SizeMB = [math]::Round($size/1MB, 2) }} |Sort-Object SizeMB -Descending |Select-Object -First 20
On Linux/macOS it is more direct:
# Find the largest first-level subdirectories under the user profile# GNU (Linux):du -h --max-depth=1 ~ 2>/dev/null | sort -rh | head -n 20# On BSD (macOS), replace --max-depth=1 with -d 1
Step 2: Shut down the processes holding the files
Before moving anything, the related programs must be fully exited. Otherwise locked files will make the migration fail or leave you with a half-copied directory. In practice, even after the UI is closed, a number of child processes (runtime processes of various kinds) may linger in the background and hold file handles.
- The safe approach is to confirm in Task Manager /
topthat all processes have exited. - If a batch of stubborn background processes remains, you can terminate them by command (be sure to verify the process name so you don’t kill system processes):
# Example: stop matching background processes (replace the name with your actual case)Get-Process | Where-Object { $_.ProcessName -like '*your-tool*' } | Stop-Process -Force
Step 3: Move the physical data
Move the large directory you identified as a whole to the target disk. Move rather than copy, so no duplicate set of data is left behind eating space:
# Move the original directory to the matching location on D:move "$env:LOCALAPPDATA\YourTool\Cache" "D:\Cache\YourTool\Cache"
Step 4: Create the link in the original location
Once the data has been moved, create a link at the original path pointing to the new location. Open Command Prompt as administrator:
:: Directory symbolic link (requires admin, can cross volumes)mklink /D "C:\Users\You\AppData\Local\YourTool\Cache" "D:\Cache\YourTool\Cache":: Or: directory junction (no admin required, local volumes only, best compatibility)mklink /J "C:\Users\You\AppData\Local\YourTool\Cache" "D:\Cache\YourTool\Cache"
The corresponding command on Linux/macOS:
ln -s /mnt/data/Cache/YourTool/Cache ~/original/location/Cache
Step 5: Verify
Restart the tool, open a few sessions normally, and trigger an index or inference to confirm everything works. At the same time, inspect the original path with dir (Windows) or ls -l (Linux). If it is shown as <SYMLINKD> / <JUNCTION> or carries an -> arrow, the link is in effect.
5. Safety Net: Always Keep a Way Back
Any operation that moves data should preserve a rollback path. During the migration:
- Take a small-scope backup beforehand, and at minimum keep a second copy of critical data such as session history.
- Record the mapping between original and target paths, which makes later troubleshooting easier.
- Rollback method: deleting the link does not delete the target data, so you only need to remove the link and move the data back.
:: Delete the symbolic link/junction (only the link is removed, real data untouched)rmdir "C:\Users\You\AppData\Local\YourTool\Cache":: Move the data back to its original locationmove "D:\Cache\YourTool\Cache" "C:\Users\You\AppData\Local\YourTool\Cache"
It is worth stressing that when rmdir acts on a link, what gets deleted is the link itself — it does not recursively delete the real files inside the target directory. That is the foundation of a safe rollback. Even so, confirm the target data is intact before rolling back.
6. Permissions and Things to Watch
- Privilege requirements: creating a symbolic link is a system-level operation and generally needs administrator rights (junctions are more permissive, but it is still best to work in a controlled environment).
- Don’t migrate the whole user profile: relocate only the large, safely movable subdirectories (caches, logs, plugins, indexes), and leave critical system directories alone.
- Re-verify after upgrades or reinstalls: a tool upgrade may recreate directories or overwrite links, so check that the links are still in place.
- Know your volume types: junctions do not work across network volumes or filesystems, so prefer symbolic links for cross-disk migration.
7. Next Level: More Systematic Space Governance
Symbolic links are a quick fix that treats the symptom. Over the long run they should be paired with a systematic approach:
- Clean logs and temporary files regularly, folding log rotation and temporary artifacts into routine maintenance.
- Use monitoring and capacity alerts to track disk levels and get warned before hitting a threshold, instead of finding out at zero bytes.
- Tier the data: for large data that can live externally, prefer general-purpose cloud storage categories such as object storage and file storage; for logs that need to be searched and analyzed, hand them to a log service so that only hot data stays local.
- Capacity planning: leave enough headroom on the developer machine’s system drive, or configure cache directories to default to a separate data disk.
These practices do not conflict with the migration approach; together they move you from emergency firefighting to long-term control.
8. Summary
When AI coding tools fill up the system drive, the root cause is their local-heavy data model, and caches, plugins, inference data, and logs all have to be kept. Rather than deleting data or reinstalling, use symbolic links / junctions to move the physical storage onto a larger disk so the paths look unchanged while the data has actually moved. Master the standard chain — locate the large directories, stop the processes, move the data, create the link, verify, keep a rollback — and add regular cleanup plus capacity monitoring, and the system drive can breathe freely again, leaving your attention on the code that actually matters.
