By default, VS Code Auto Save is off, so files remain unsaved until you press Ctrl+S on Windows or Linux, or Cmd+S on macOS. A dot on the editor tab and a badge in the Explorer indicate unsaved changes.
Auto save removes the need to save manually. Your changes are written to disk automatically, either after a delay or when you move focus away from the editor.
Enable auto save from the menu
The fastest way to turn on auto save:
Click File > Auto Save in the top menu bar.
A checkmark appears next to the menu item. VS Code now saves files one second after you stop typing. Click the same menu item again to turn it off.
This toggle uses the afterDelay mode with the default 1000 millisecond delay.
Choose a save mode
Auto Save has four modes controlled by the Files: Auto Save setting. The current modes are documented in VS Code's official Save and Auto Save guide.
| Value | Behavior |
|---|---|
| off | Files are never saved automatically (default) |
| afterDelay | Save after a configurable delay from the last edit |
| onFocusChange | Save when the editor loses focus (you click another tab, panel, or application) |
| onWindowChange | Save only when the VS Code window loses focus |
To change the mode, open your settings and search for "auto save". Select the dropdown and pick a mode.
Or set it directly in your settings.json file:
{
"files.autoSave": "onFocusChange"
}Configure the delay
If you use afterDelay mode, you can change how long VS Code waits before saving. The default is 1000 milliseconds (1 second).
{
"files.autoSaveDelay": 500
}This example saves 500 milliseconds after you stop typing. Set the value in milliseconds. Lower values save sooner but write to disk more often.
Set auto save per language
You can enable or disable auto save for specific file types without changing the global setting. This is useful when you want auto save for most files but not for a few types.
In your settings.json file, add a language-specific override:
{
"[markdown]": {
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 2000
}
}This enables auto save with a 2-second delay for Markdown files only. Other file types follow your global setting.
To disable auto save for a specific language:
{
"[latex]": {
"files.autoSave": "off"
}
}Verify auto save is working
After enabling auto save, make a change in any file and wait for the configured delay (or click away if using onFocusChange). The dot on the tab should disappear. The file is now saved.
Auto save and Hot Exit
Hot Exit backs up unsaved changes so VS Code can restore them after you close the application or a window. It still matters with Auto Save because a close or interruption can happen before the configured save trigger runs, and some unsaved editors may not yet have a file on disk.
Leave Hot Exit at its default unless you have a specific recovery requirement. It does not replace a normal backup or version-control workflow.
What to try if it does not work
If auto save does not trigger as expected:
- Check that
files.autoSaveis not set tooffin your workspace settings. Workspace settings override user settings. Open the Settings editor and look at the Workspace tab for a conflicting value. - If you use
afterDelaymode, make surefiles.autoSaveDelayis set to a reasonable value. A delay of 10000 (10 seconds) might make it seem like nothing is happening. - For
onFocusChangemode, you must click outside the editor, not just stop typing. Click the Explorer, the terminal, or another editor tab. - If you have language-specific overrides, confirm the override is not blocking auto save for the file type you are editing.
Next steps
Now that your files are saving automatically, enable format on save to keep your code formatted without extra work. If you only want auto save for certain projects, learn when to use workspace settings instead of user settings.
Rune AI
Key Insights
- Toggle Auto Save from File > Auto Save for the fastest setup.
- The files.autoSave values are off, afterDelay, onFocusChange, and onWindowChange.
- Choose the mode based on when you want changes written to disk.
- Use files.autoSaveDelay to control the delay in milliseconds for afterDelay.
- Language-specific overrides can change Auto Save behavior for individual file types.
Frequently Asked Questions
Which auto save mode should I choose?
Does auto save replace Hot Exit?
Can I disable auto save for one specific file type?
Conclusion
Auto save removes the need to press Ctrl+S after every change. Use the File menu toggle for one-click enable and disable. Use settings.json when you need fine control over timing or language-specific behavior.
More in this topic
How to Use VS Code with WSL 2 on Windows
Run VS Code connected to Windows Subsystem for Linux so you can develop in a full Linux environment with native tools, terminals, and debugging, all from Windows.
20 Best VS Code Extensions for Web Developers in 2026
Twenty carefully chosen VS Code extensions every web developer should know. Covers formatting, linting, frameworks, debugging, Git, and developer experience.
How to Install, Disable, Update, and Uninstall VS Code Extensions
Learn how to install, disable, update, and uninstall VS Code extensions from the Marketplace and the command line. Step-by-step instructions for every action.