AI Coding Tools Filling Up Your System Drive? Cache Governance and Migration in Practice

    AI coding tools silently consume system drive space through state directories you rarely open: semantic indexes, session and inference traces, logs, and crash dumps. This guide shows how to audit that local state, classify it into rebuildable versus non-rebuildable data, and relocate it to a data volume using directory junctions or symlinks. It includes a six-step migration procedure with copy-first verification and rollback, a list of common pitfalls (permissions, drive letter drift, spaces in paths, backup tools following links), long-term governance practices such as retention limits and quota alerts, and an acceptance checklist.

    1. Symptoms: The System Drive Is Exhausted Without Warning

    After a development machine has been in use for a while, a very typical and easily misdiagnosed class of failure appears. AI coding tools still launch normally, but you cannot create a new session; indexing tasks fail repeatedly; the logs fill up with write errors; the compiler cache directory cannot be created; and the system starts reporting low disk space. Checking the system drive properties usually shows only a few hundred megabytes free — sometimes 0 bytes.

    What makes this confusing is that users typically keep repositories, datasets, and assets on a large data drive, so the system drive feels clean. What actually consumes the space is the set of implicit state directories that are never actively opened: created automatically by the tools, growing automatically, and almost never reported to the user.

    2. Root Cause: Local State Consists of Four Data Categories

    Take a mainstream AI coding tool (the IDE-integrated kind) as an example. Its on-disk local data falls roughly into four categories, and each has a completely different governance priority:

    1. Program and plugin directories — the editor itself, language services, and extension packages. Typically hundreds of MB to several GB, growing with the number of plugins. This is relocatable data.
    2. Model and index caches — code semantic indexes, vectorized indexes, cached local fragments. These grow roughly linearly with the number of projects and are fully rebuildable: delete them and re-index.
    3. Sessions and inference traces — context snapshots for every turn of conversation, intermediate reasoning records, tool call logs. Extremely high write frequency, small per record but enormous in aggregate, and with almost no cleanup by default. A classic “silent growth source.”
    4. Logs and crash dumps — diagnostic logs, error stack traces, crash dump files. A single file can reach hundreds of MB, retained on a rolling daily basis. A long-overlooked hidden heavyweight.

    Key takeaway: categories 1 and 2 are rebuildable and relocatable; categories 3 and 4 are truncatable and archivable. Drawing that distinction is the prerequisite for any governance strategy — deleting indiscriminately breaks the environment, while migrating blindly just moves the problem to a new drive.

    3. Start with a Space Audit: Turn “It Feels Full” Into a List

    Quantify before taking any migration action. The commands below are illustrative; syntax differs between desktop operating systems and must be adapted per platform:

    1. # Size each first-level subdirectory and sort descending
    2. du -h --max-depth=1 ~/ 2>/dev/null | sort -hr | head -20
    3. # Find individual files larger than 500MB (logs and dumps often hide here)
    4. find ~/ -type f -size +500M -exec ls -lh {} \;
    5. # Count files and total bytes under a directory, for post-migration verification
    6. echo "count=$(find <dir> -type f | wc -l) size=$(du -sb <dir> | cut -f1)"

    The audit output should become a table: directory path / size / rebuildable? / relocatable? / action. In practice, AI coding tool directories often account for 30%–60% of a user profile on an actively used development machine, and more than half of that is rebuildable index and log data.

    4. Core Principle: Decouple the Logical Path From the Physical Location

    The essence of migration is not “moving files away” but making sure that when a tool accesses its original path, the operating system transparently redirects it to the real location on the data drive. There are three common mechanisms:

    • Directory junction: works for directories only, can cross local volumes, is completely transparent to ordinary applications, and has the lowest creation overhead. Suitable for migrating the vast majority of cache directories.
    • Symbolic link (symlink): supports both files and directories, flexible to configure, but usually requires elevated privileges to create, and some older programs resolve the real path before accessing it, which defeats the redirection.
    • Hard link: limited to files within the same volume; used for deduplication rather than relocation.

    Illustrative code:

    1. # Illustrative: create a directory junction so that <original path> is logically
    2. # accessible while the data physically resides at <target path>
    3. link /J "<original path>" "<target path>"
    4. # Illustrative: query where a path actually points, for post-migration verification
    5. link-info "<original path>"

    As long as the link is correct, the tool, its plugins, and language services need no configuration changes at all — perceptually, the files are still in place.

    5. Migration in Six Steps

    Step 0 — Pre-checks: free space on the target volume must be ≥ the data to be migrated × 1.2 (headroom for copying and verification). The target volume should be a fixed internal disk or a stable mount point, not removable media. Avoid drive letters that can drift; use a mount point or volume identifier if necessary.

    Step 1 — Quiesce writes: fully exit the editor and confirm that associated background processes (language services, indexing processes, auto-update processes) have ended. Illustrative:

    1. # Illustrative: list and terminate processes that clearly belong to the tool
    2. tasklist | findstr /I "editor"
    3. taskkill /F /IM "editor.exe"

    Only terminate processes whose ownership you can identify with certainty. Do not use broad fuzzy matching to force-kill in bulk, or you may take down a running build, container, or other development service, leaving a far messier state inconsistency.

    Step 2 — Copy first, don’t move:

    1. # Illustrative: use the OS mirror-copy capability, preserving attributes,
    2. # retrying failures, and writing a log
    3. mirror-copy --recursive --retry 2 --log migrate.log "<source>" "<target>"

    Copying instead of moving is the safety cornerstone of the whole procedure: if any step fails, the source data is still in place.

    Step 3 — Verify:

    1. # Illustrative: generate a checksum manifest for each side and compare
    2. hash-list <source> > src.sha
    3. hash-list <target> > dst.sha
    4. diff src.sha dst.sha # no output means it passed

    Check at least three things: file count, total bytes, and sampled content hashes. Index and cache data can be relaxed to count and byte comparison; configuration and session data should get full hash verification.

    Step 4 — Create the link: once verification passes, rename and keep the source directory rather than deleting it, then create the link pointing at the target. After confirming everything works for a few days, delete the backup copy.

    Step 5 — Validate: cold-start the tool and confirm in order that you can create a new session, that indexes rebuild correctly, that writes really land on the data drive, and that free space on the system drive has been released.

    Step 6 — Roll back: delete the link → copy or move the directory back to its original path → restart and validate. This is the highest-risk step in the whole process: when deleting the link you must delete the link itself, because a delete command with recursive semantics can follow the link and wipe the real data on the data drive along with it. Always confirm the link’s actual target before rolling back.

    6. Common Pitfalls

    • Insufficient privileges: creating symlinks often requires administrator rights or developer mode; junctions have a lower bar, so prefer them.
    • Drive letter drift: after an external drive is unplugged and reconnected, the drive letter changes and the link breaks immediately, showing up as the tool failing to start with a “path does not exist” error.
    • Spaces or non-ASCII characters in paths: scripts that fail to quote paths correctly are the number one cause of migration failure — always wrap parameters in double quotes.
    • Backup/sync tools following links: they may repeatedly copy the data drive’s contents back to the system drive, inflating usage instead. Configure them to not follow links.
    • Pointing at a network location: indexing programs are extremely sensitive to high-frequency small-file I/O over network shares, and the stutter costs far more than the local space saved.
    • Sandboxed runtime environments: some sandboxes do not resolve links. In that case, change the tool’s own cache path settings directly rather than creating links.

    7. Long-Term Governance Matters More Than “Moving House”

    1. Configuration first, links as fallback: where the tool exposes cache directory, workspace directory, or log directory settings, point them at the data drive directly. Links are the alternative for when configuration cannot be changed.
    2. Tiered placement: keep only the operating system and the tool binaries on the system drive; put index caches, model caches, and logs on the data drive; put large build artifacts on a separate volume.
    3. Retention policies: set rolling limits for logs and inference records (by size or by day, keeping 7–14 days); archive and compress historical sessions monthly before moving them out.
    4. Quotas and alerts: set an alert threshold of 10%–15% free space on the system drive, and periodically check and report via a monitoring/alerting service or a local scheduled task — instead of discovering the problem at 0 bytes.
    5. Remote and cloud development: with cloud development environments (cloud hosts, or container platforms with cloud disk or object storage mounts — general capabilities offered by cloud platforms such as Baidu AI Cloud), caches and sessions can sit directly on the mounted volume, which significantly reduces pressure on the local system drive. Cloud environments still need storage lifecycle policies, though, or you have simply moved the space problem from local to remote.

    8. A Realistic View of “One-Click Migration” Tools

    What these graphical tools essentially do is script the six steps above and hard-code the error-prone points. Their value lies in lowering the barrier to entry, not in introducing any new low-level capability. Before adopting one, check four things:

    • Whether the permissions it requests exceed what is necessary (does it have to run as administrator, and what system-level changes does it make while running);
    • Whether it follows the “copy, then verify, then delete” order;
    • Whether it offers a rollback path that has been actually tested, not just a button in the UI;
    • Whether it keeps a complete operation log, so that a failure can be traced to a specific directory and point in time.

    No packaged tool replaces a manual backup taken before migration: at minimum, bundle up user configuration, keybindings, and session history separately.

    9. Acceptance Checklist

    • Free space on the target volume ≥ (free space on the system drive before migration + the volume of migrated data);
    • The link’s actual target has been confirmed correct;
    • Cold start, new session, index rebuild, and plugin loading all work;
    • After one week, system drive usage has not visibly crept back up (indicating no growth source was missed);
    • The rollback procedure has been rehearsed once, end to end, in a test directory.

    Conclusion

    When AI coding tools fill up the system drive, the surface problem is space; the real problem is a lack of governance over local state. The correct order of operations is: quantify with an audit → decide by category → copy and verify → redirect with links → keep monitoring. Give rebuildable data to the data drive, give non-rebuildable data to backups, and give long-term growth to retention policies and alerting — that is how you avoid repeating the same rescue operation every few months.