Cache management
Over time, Junie CLI accumulates old versions, downloaded update archives, and logs. Use the junie cache command to see how much disk space they take and remove the ones you no longer need. Junie CLI also prunes old data automatically.
Saved sessions are your data, not cache. Junie CLI never deletes them unless you explicitly ask for it with --sessions.
Check disk usage
This command doesn't delete anything. It lists the cache items Junie CLI manages, grouped into categories, and shows which items are kept and why:
Versions: installed Junie CLI builds and their unpacked bundled skills and agents.
Updates: downloaded update archives.
Logs: Junie CLI process logs and LLM streaming logs.
Clean up the cache
Preview what will be removed:
junie cache clean --dry-runThe output lists cleanup candidates and the estimated amount of disk space you can reclaim.
Remove the candidates:
junie cache cleanThe output lists the removed items, any errors, and the total amount of reclaimed disk space.
Option | Description |
|---|---|
| Show what would be removed without deleting anything. |
| Also remove old finished saved sessions. See Delete old sessions. |
| Show help for the command. |
Sizes are shown in binary units: KiB, MiB, GiB (1 KiB = 1,024 bytes). The reclaimed size can differ slightly from the change in free disk space reported by your operating system.
What gets removed
Junie CLI removes only data that it recognizes and that is safe to delete:
Old versions: Junie CLI keeps the three latest versions by default, plus the current, running, and recently used (within the last 14 days) versions, and versions required by a pending update.
Update archives: archives older than 7 days by default that are not needed by a pending update.
Logs: logs older than 30 days by default that do not belong to a running Junie CLI process.
You can change these limits in the settings file.
Junie CLI never removes your settings, credentials, projects, custom models, your own skills and agents, project skills, or unknown files.
Delete old sessions
To also remove saved sessions, add the --sessions option. Preview the result first:
Then delete the sessions:
Junie CLI deletes only sessions that finished (completed, failed, or were canceled) and haven't been updated for more than 90 days (configurable with cacheSessionDays). Running, unfinished, and recent sessions are always kept. Deleting a session removes its history, events, and terminal output. This data cannot be recovered, and the session cannot be resumed.
Automatic pruning
In interactive and ACP sessions, Junie CLI periodically removes old versions, update archives, and logs in the background, at most once every 24 hours. Automatic pruning follows the same rules as junie cache clean and never deletes saved sessions.
Automatic pruning works only for Junie CLI installed with the install script and with auto-updates enabled. It does not run in headless mode.
Configure cleanup
Cache settings are stored in the global settings file ~/.junie/settings.json (or $JUNIE_HOME/settings.json if the JUNIE_HOME environment variable is set). They are not read from the project config.json file.
Setting | Default | Description |
|---|---|---|
|
| Enables automatic pruning. Manual |
|
| Number of the latest versions to keep. Must be greater than |
|
| Logs older than this number of days can be removed. |
|
| Update archives older than this number of days can be removed. |
|
| Finished sessions not updated for this number of days can be removed with |
Add the settings you want to change to your existing settings file, for example:
Values can be JSON booleans and numbers or the same values as strings, for example 30 or "30". Day limits must be integers greater than or equal to 0. If a value is invalid, junie cache and junie cache clean exit with an error, and automatic pruning is skipped.
Troubleshooting
Cleanup is skipped because another cleanup is running: only one cache cleanup can run at a time. Wait and run the command again.
Some items were not removed: run
junie cacheto see the remaining items and the reasons they are kept.Cleanup reports errors: a failed deletion can leave partially removed directories. Check the error messages and run
junie cache cleanagain.Built-in skills and agents disappeared in a long-running session: cleanup started by another Junie CLI process may have removed the bundled assets of an old version. Restart Junie CLI.