Where Does SageMath Store Data and Settings?
SageMath keeps user state in ~/.sage with logs, history, and installed packages beside the versioned tree.
Last updated
SageMath stores per user state in .sage inside your home directory. Command history, temporary files, and installed optional packages land there under versioned folders. The DOT_SAGE variable moves the whole tree elsewhere.
Worksheets themselves save wherever you put them, not inside .sage. Clearing the folder resets preferences and history while leaving notebooks intact. Version upgrades create fresh subfolders rather than migrating old ones.
Where SageMath stores this, by platform
~/.sage
History, temp files, and optional packages per Sage version. Override with DOT_SAGE for shared installs. Notebooks live at their save paths, not here.
Frequently asked questions
How do I reset SageMath settings?
Rename .sage with Sage closed and restart to rebuild defaults. Notebooks elsewhere survive untouched. Reinstall optional packages afterward.
Where are my Sage notebooks?
Wherever you saved them, usually .ipynb or .sws files in your documents. The .sage folder holds history and caches only. Search for the notebook extension to locate strays.
Notice an outdated path? Let us know.