Where are Untitled Tabs in VSCode Saved on a Windows System?

Ever wonder how VSCode (Visual Studio Code) maintains those untitled tabs between sessions? They’re stored as files underneath your user’s profile in appdata on Windows based systems as shown in the following example.

Get-ChildItem -Path $env:APPDATA\Code\Backups\*\untitled -Recurse

untitled-tabs-in-vscode1a.jpg

The previous command could be piped to Get-Content to view the contents of all of code in the open untitled tabs of VSCode. You could also use Select-String to find something specific. I can see that three of my open tabs contain ‘mikefrobbins’.

Get-ChildItem -Path $env:APPDATA\Code\Backups\*\untitled -Recurse |
Select-String -SimpleMatch 'mikefrobbins' |
Format-Table

untitled-tabs-in-vscode2a.jpg

Concerned about losing information contained in your untitled tabs? You should probably save them, but you also have the option of backing up all of your untitled tabs using the following PowerShell one-liner.

Get-ChildItem -Path $env:APPDATA\Code\Backups\*\untitled -Recurse |
Compress-Archive -DestinationPath "C:\tmp\vscode-untitled-tabs$(Get-Date -Format FileDate).zip"

untitled-tabs-in-vscode3a.jpg

ยต