ChatGPTClaudeGrok / X / CursorGemini

How much disk dsh uses, and what is safe to delete

Install & Get StartedPublished 2026-11-02Author: DeepSeek Plugin Market
dsh installdisk usagecache cleanupnode_modulesmaintenance
Caches, per-profile dependency trees, and forgotten second installs outweigh the program. Measure each location first, then delete from safest to riskiest.

The dsh program itself is small; the space goes to caches, per-profile dependency trees, and the second install you forgot about. Measure each location before deciding what to delete.

Measure dsh space before deleting

Deleting without numbers usually takes sessions and credentials with it.

  1. List every possible location;
  2. Measure each one;
  3. Label each as deletable, rebuildable, or untouchable;
  4. Delete from the safest class first;
  5. Re-test startup after each deletion.

Use one ruler for all of them. Run du -sh <path> everywhere so units are comparable and the biggest consumer is obvious.

Where dsh space goes and how to measure it

Five locations cover almost everything.

LocationHow to find itTypical size
npx cacheThe _npx directory under the npm cacheMedium, grows per version
npm download cachenpm config get cacheLarge, shared by all packages
Global node_modulesnpm root -gMedium
Profile dependency trees$DSH_HOME/profiles/*/node_modulesLarge, scales with profiles
Desktop runtimeThe OS application directoryLarge, separate from the CLI

Desktop and CLI are two separate footprints. If both exist, you have two runtimes on disk; do not count them as one install.

Locations mean nothing without numbers. Run these in order and write the numbers down:

  1. npm config get cache for the cache root, then du -sh on it;
  2. du -sh on the _npx subdirectory;
  3. du -sh "$(npm root -g)";
  4. du -sh "${DSH_HOME:-$HOME/.dsh}";
  5. du -sh "${DSH_HOME:-$HOME/.dsh}"/profiles/*.

The last line is the one to watch. Each profile keeps an independent dependency tree, so three or four profiles often outweigh everything else.

Deletable dsh space and the safe cleanup order

The criterion is not size but recoverability.

ContentDeletableEffect
npx cacheYesNext npx run downloads again
npm download cacheYesSlower re-downloads
Old global installYesConfirm PATH afterwards
Log directoryYesStartup diagnostics history is lost
One profile's dependenciesWith careThat profile must be rebuilt
Sessions and credentialsNoHistory and login state are lost

The last row is the red line. Clearing logs is fine, rebuilding a profile is fine, deleting DSH_HOME as if it were a cache is not.

Once the boundary is clear, order does the rest. From "re-downloadable" to "unrecoverable":

  1. Clear the npx runtime copies;
  2. Run npm cache verify, then clean if still needed;
  3. Remove old startup diagnosis logs, keeping the most recent;
  4. Uninstall global packages you no longer use;
  5. Remove dependency directories of abandoned profiles.

Start once after each step. The first start after a cache clean is slower by design; that is refilling, not breakage.

Prefer npm cache verify over a forced wipe. It validates integrity and reclaims unused entries, which is enough in most cases.

Duplicate dsh installs and verifying the cleanup

Duplicates usually come from different install methods, not repeated installs.

  1. which -a dsh lists every executable path;
  2. Run <path> --version for each;
  3. Compare with npm root -g to identify global installs;
  4. Check other Node versions' prefixes for a third copy;
  5. Keep the one you actually use and uninstall the rest.

Uninstall instead of deleting files. Manually removing a directory leaves stale bin links that report "command exists but fails".

Keep exactly one primary install. For a temporary different version, use npx with a pinned version rather than a permanent second global install.

Then verify the result. The standard is "what should be there is there, and the numbers dropped":

  1. dsh --version still prints;
  2. dsh web starts and the page opens;
  3. Historical sessions still list;
  4. A model call succeeds, proving credentials survived;
  5. Measure total size again and compare with the earlier number; without that comparison you cannot tell whether cleanup worked or merely moved things.

Keeping dsh usage under control

Prevent growth rather than scheduling spring cleanings: one primary install, one profile per purpose with unused ones deleted, logs kept by age, and a cache clean after upgrades. The most overlooked variable is profile count — every extra profile adds a full dependency tree.

dsh next steps

Measure, delete, then re-test. To avoid duplicates during a move, read migrating an old install. For recovery after a bad install, read rolling back a dsh install. For the smallest setup, read minimal dsh install. For a custom data directory, read custom DSH_HOME.

Sources: dsh CLI README, npm docs: npm cache, DeepSeek Harness docs

ChatGPTClaudeGrok / X / CursorGemini

FAQ

If I delete the npx cache, will my installed dsh stop working?

No, your dsh install keeps working: a global install is unaffected, and the next npx run simply downloads again. The npx cache exists to speed up repeated runs, so the worst case is a slower first start, and DSH_HOME is not touched.

DSH_HOME is large. Can I delete the whole directory and start over?

Deleting the whole dsh data directory is not advisable, because besides plugin dependencies it holds sessions, credentials, and settings, so deleting it clears history and login state together. To reduce size, delete logs or rebuild one profile rather than the root.

Why has disk usage doubled when dsh --version shows only one version?

dsh --version only reports the copy your PATH resolves, so other copies can still sit in the npx cache, an old global directory, or another Node version's prefix. Compare which -a dsh with npm root -g to see what is really on disk.

Startup got slower after cleanup. Should I restore the cache?

No, you do not need to restore the cache for dsh: the first run refills it and later runs return to normal. If slowness persists, the cause is network or mirror configuration rather than the cleared cache.

Related Terms

npx cache
The npx cache is a local copy of packages npx has executed, kept under the npm cache directory to avoid repeated downloads.— npm docs
global node_modules
The global node_modules is npm's system-level dependency tree, whose path `npm root -g` reports and from which the dsh command usually resolves.— npm docs
profile dependency tree
A profile dependency tree is the plugin dependency set inside one profile at $DSH_HOME/profiles/<name>/node_modules, never shared between profiles.— dsh CLI README
DSH_HOME
DSH_HOME is the data root for DeepSeek Harness, defaulting to ~/.dsh, holding profiles, settings, sessions, logs, and credentials.— DeepSeek Harness docs

Sources