Old Claude Code and Codex versions: are they safe to delete?
Last checked 21 October 2026
Yes, as long as you keep the version in use. Claude Code keeps versions in ~/.local/share/claude/versions and runs the one ~/.local/bin/claude points to. Codex keeps them in ~/.codex/packages/standalone/releases and runs the one current points to. Your settings and sessions are elsewhere.
Where old versions pile up
Claude Code and Codex both install themselves the same way when you use their standalone installers: each version is stored separately, and a link points to the one you run. An update adds the new version and moves the link. The old one can stay behind.
| Path | What it is | Verdict | What you lose |
|---|---|---|---|
~/.local/share/claude/versions/<version> | An older Claude Code version left by an update | Safe | Nothing, as long as it is not the version you run |
~/.local/bin/claude | The link to the Claude Code version you run | Never delete | The claude command stops working |
~/.codex/packages/standalone/releases/<version> | An older Codex version left by an update | Safe | Nothing, as long as it is not the version you run |
~/.codex/packages/standalone/current | The link to the Codex version you run | Never delete | The codex command stops working |
If you set CODEX_HOME, the Codex folder is inside it instead of ~/.codex.
How much space they take
One Claude Code user measured about 175 MB per version in ~/.local/share/claude/versions/, and over 500 MB after a few updates, and asked for old versions to be removed automatically.
Claude Code's setup documentation explains that the native installer keeps ~/.local/bin/claude as a link into ~/.local/share/claude/versions/, and that if you replace that link with your own launcher, Claude Code keeps every installed version on disk because it cannot tell which one your launcher needs. The same page says Homebrew also keeps old versions after upgrades.
For Codex, the change that introduced the standalone layout describes one folder per release under packages/standalone/releases, with standalone/current pointing to the one in use.
To see them on your own Mac:
ls -l ~/.local/bin/claude
du -sh ~/.local/share/claude/versions/* 2>/dev/null
ls -l ~/.codex/packages/standalone/current
du -sh ~/.codex/packages/standalone/releases/* 2>/dev/nullThe first and third lines show which version each link points to. Nothing above deletes anything.
How to clean it by hand
Quit every running claude and codex session first. A session that is still open may be running an old version.
Claude Code: in ~/.local/share/claude/versions/, delete every version except the one ~/.local/bin/claude points to. If you installed with Homebrew instead, run brew cleanup.
Codex: in ~/.codex/packages/standalone/releases/, delete every folder except the one current points to.
Never delete the version a link points to, and never delete the links themselves: the command would stop working until you reinstall.
What you should never delete
Old versions are only programs. Your settings, sessions and sign-in live elsewhere, in ~/.claude and ~/.codex, and removing a version does not touch them. See what is in ~/.claude and what is in ~/.codex for those folders, and where AI coding agents store data on your Mac for every other agent.
Doing it with Ouste
Ouste finds old Claude Code and Codex versions, keeps the version in use, classifies every item as Safe, Review, Risky or Protected with the sentence that says what you lose, and puts anything you might regret in a 7-day quarantine you can restore in one click. Your settings, memory and sign-in are never touched.
Questions
Can I delete old Claude Code versions?
Yes, every version in ~/.local/share/claude/versions except the one ~/.local/bin/claude points to. Your settings and sessions in ~/.claude are not touched.
How big is each Claude Code version?
One user measured about 175 MB per version, and over 500 MB after a few updates.
Where does Codex keep its old versions?
With the standalone installer, in ~/.codex/packages/standalone/releases, one folder per release. The current link points to the one in use.
Does deleting an old version remove my settings or sessions?
No. Versions are only programs. Settings, sessions and sign-in live in ~/.claude and ~/.codex.