Skip to content

Revisit VS Code folder structure for app data, settings, extensions #3884

Open

Description

@Tyriar

Config is stored in ~/.config/Code[ - <quality>]/User. To match platform conventions (lowercase and hyphens for everything) as well as to keep consistency with the cli code[-<quality>] I propose we change the settings directory one of:

If we moved this it would probably require some discovery/migration on first launch of a newer version.


The below is a living document.

Proposed folder structure

Notes:

  • I don't think we should be encouraging the use of admin rights within vscode, instead a permissions elevation dialog would probably be better than allowing a specific place for root user data Use specific user data directories when running as root #5561
  • I want to clean up the whole code vs vscode thing in this change; only official builds should carry the visual studio branding, that should carry over to the config directories consistently as well.
  • The CLI args --user-data-dir and --extensions-dir will need to be adjusted for this, something like --config-dir and --cache-dir would probably be better.

Windows

Old

Settings:                %APPDATA%\Code[ - Variant]\User\settings.json
Keybindings:             %APPDATA%\Code[ - Variant]\User\keybindings.json
Snippets:                %APPDATA%\Code[ - Variant]\User\snippets\
Workspace storage:       %APPDATA%\Code[ - Variant]\User\workspaceStorage\
Chromium user data:      %APPDATA%\Code[ - Variant]\
Extensions:              %USERPROFILE%\.vscode[-variant]\extensions\

New

Settings:                %APPDATA%\Microsoft\[Visual Studio ]Code[ - Variant]\settings.json
Keybindings:             %APPDATA%\Microsoft\[Visual Studio ]Code[ - Variant]\keybindings.json
Snippets:                %APPDATA%\Microsoft\[Visual Studio ]Code[ - Variant]\snippets\
Workspace storage:       %LOCALAPPDATA%\Microsoft\[Visual Studio ]Code[ - Variant]\workspaceStorage\
Chromium user data:      %LOCALAPPDATA%\Microsoft\[Visual Studio ]Code[ - Variant]\userdata\
Extensions:              %LOCALAPPDATA%\Microsoft\[Visual Studio ]Code[ - Variant]\extensions\

Notes:

  • Note that %APPDATA% is roaming and %LOCALAPPDATA% is local, meaning extensions will not be carried across multiple machines until a solution is devised for Persist an extensions manifest file #15442. An extension manifest, eg. %APPDATA%\Microsoft\[Visual Studio ]Code[ - Variant]\extensions.json which automatically installs extensions is my thinking of solving this problem.

Linux

Old

Settings:                $HOME/.config/Code[ - Variant]/User/settings.json
Keybindings:             $HOME/.config/Code[ - Variant]/User/keybindings.json
Snippets:                $HOME/.config/Code[ - Variant]/User/snippets/
Workspace storage:       $HOME/.config/Code[ - Variant]/User/workspaceStorage/
Chromium user data:      $HOME/.config/Code[ - Variant]/
Extensions:              $HOME/.vscode[-variant]/extensions/ (not moving)

New

Settings:                $XDG_CONFIG_HOME/[vs]code[-variant]/settings.json
Keybindings:             $XDG_CONFIG_HOME/[vs]code[-variant]/keybindings.json
Snippets:                $XDG_CONFIG_HOME/[vs]code[-variant]/snippets/
Workspace storage:       $XDG_CACHE_HOME/[vs]code[-variant]/workspaceStorage/
Chromium user data:      $XDG_CACHE_HOME/[vs]code[-variant]/userdata/
Extensions:              $XDG_CACHE_HOME/[vs]code[-variant]/extensions/

Notes:

Mac

Old

Settings:                $HOME/Library/Application Support/Code[ - Variant]/User/settings.json
Keybindings:             $HOME/Library/Application Support/Code[ - Variant]/User/keybindings.json
Snippets:                $HOME/Library/Application Support/Code[ - Variant]/User/snippets/
Workspace storage:       $HOME/Library/Application Support/Code[ - Variant]/User/workspaceStorage/
Chromium user data:      $HOME/Library/Application Support/Code[ - Variant]/
Extensions:              $HOME/.vscode[-variant]/extensions/ (not moving)

New

Settings:                $HOME/Library/Application Support/[Visual Studio ]Code[ - Variant]/settings.json
Keybindings:             $HOME/Library/Application Support/[Visual Studio ]Code[ - Variant]/keybindings.json
Snippets:                $HOME/Library/Application Support/[Visual Studio ]Code[ - Variant]/snippets/
Workspace storage:       $HOME/Library/Application Support/[Visual Studio ]Code[ - Variant]/workspaceStorage/
Chromium user data:      $HOME/Library/Application Support/[Visual Studio ]Code[ - Variant]/userdata/
Extensions:              $HOME/Library/Application Support/[Visual Studio ]Code[ - Variant]/extensions/

Notes:

Activity

  1. added
    debt
    linux
    on Mar 8, 2016
  2. changed the title [-]Code .config on Linux doesn't follow OS conventions[/-] [+]Revisit VS Code folder structure for app data, settings, extensions[/+] on Mar 9, 2016
  3. bpasero commented on Mar 9, 2016

    @bpasero
    Contributor

    I wonder if we should do this before GA. Besides the summary, I also do not like that we have 2 folders, one for application data and one for extensions. Ideally we have one folder for both.

  4. Tyriar commented on Mar 9, 2016

    @Tyriar
    ContributorAuthor

    It was a little confusing when I was writing my script that automates my config to discover there were 2 config folders. If this is going to be done I vote for ~/.code[-<quality>] so that it matches the executable name.

  5. bpasero commented on Mar 9, 2016

    @bpasero
    Contributor

    I am more worried about the migration than finding a name :)

  6. felixfbecker commented on Mar 10, 2016

    @felixfbecker
    Contributor

    I also don't get why there are two folders. Afaik .vscode only includes one subfolder, extensions. Why not simply put settings in .vscode aswell?

    I also like .vscode more than .code, Visual Studio stuff is also in .vs and it is less ambiguous.

  7. Tyriar commented on Mar 11, 2016

    @Tyriar
    ContributorAuthor

    While fiddling with the config directories it might be worth tackling a portable version at the same time #329

  8. bpasero commented on Mar 11, 2016

    @bpasero
    Contributor

    Not for GA.

  9. bpasero commented on Mar 13, 2016

    @bpasero
    Contributor

    Btw the largest chunk of stuff in app date is created by Chrome itself and is used for local storage, index db, etc. It would be easy to migrate and move our settings out of that folder, I am worried about migrating the rest...

  10. 233 remaining items

  11. OJFord commented on May 31, 2025

    @OJFord

    But note that technical users/developers who use macOS have a tendency to hate it when tools insist on using those directories even if XDG dirs are set in env vars explicitly.

  12. Tronix117 commented on Jul 9, 2025

    @Tronix117

    Kind of agree with macias in #251883, I was managing home backup for my company users and didn't get why those .config directories were this big.

    From around 3 sample users (developers), I got around the same results.

    Here is an example :

    1982M	~/.config
    

    and within :

    1536M	~/.config/Code
    483M	~/.config/chromium
    

    So in .config, Code is using 77% and chromium 24% of the total.

    Within Code :

    287M	~/.config/Code/Cache
    493M	~/.config/Code/CachedExtensionVSIXs
    674M	~/.config/Code/CachedData
    

    From what I can see from those last digits, 95% of the space is used by folders having cache in their name.
    For any cache that can be rebuilt at any time, XDG_CACHE_HOME (usualy ~/.cache) should be used instead.
    If those folders can not be rebuild from scratch, then those are not cached folders and are badly named.

    It's kind of a concern for me from now, because I do not want to backup and use storage for cache that can is non essential to the user.

  13. soymadip commented on Aug 31, 2025

    @soymadip

    will FHS be implemented?

  14. willmruzek commented on Sep 15, 2025

    @willmruzek

    I'm sorry if I'm missing something. The working spec doesn't address the concern/request to manage VS Code settings via dotfiles on MacOS.

    $XDG_CONFIG_HOME for config would be ideal.

    I don't personally care about data/cache locations.

    Is this a MacOS limitation?

    Right now, I have a couple scripts to import/export settings, but it would be great if I could just update my dotfiles without import/export.

  15. XhstormR commented on Nov 21, 2025

    @XhstormR

    As a Mac user, I'd like to be able to control the config file path and change it to
    ~/Library/Application Support/Code/User/settings.json -> ~/.config/Code/User/settings.json

  16. github-account1111 commented on Nov 21, 2025

    @github-account1111

    One thing I find weird is that you nest the Visual Studio Code folder under a Microsoft folder. The big Visual Studio simply installs to C:\Program Files\Microsoft Visual Studio, I think VS Code should do it the same way (don't nest, but prefix).

    Wouldn't it make more sense to do it the other way around? I think Visual Studio is the one that should move its default install location to the Microsoft folder, kind of like so:
    https://github.com/microsoft/winget-pkgs/tree/master/manifests/m/Microsoft/VisualStudio
    https://github.com/microsoft/winget-pkgs/tree/master/manifests/m/Microsoft/VisualStudioCode
    Duplicating every program's developer's name creates unnecessary redundancy and clutters up Program Files folders.

    Thanks @Zoltu, I changed user data folders to be %LOCALAPPDATA% as they are Chromium's data dirs and contain a bunch of files. My Cache directory inside the user data directory is 187mb for example. Workspace storage is just a few small json files. The only problem with this is that local storage will no longer roam, not sure all the implications of this but popups that the user told to not show again will show up again on a new machine.

    Moving Cache (I assume that's referring to %APPDATA%\Code\Cache) to %LOCALAPPDATA% makes sense, but I think moving History (Timeline), workspaceStorage, globalStorage (Recents) would be problematic. Plus the three only take up 100 MB combined for me, and that's after years of usage.

  17. trinitronx commented on Nov 21, 2025

    @trinitronx

    The working spec doesn't address the concern/request to manage VS Code settings via dotfiles on MacOS

    Indeed, this is also a valid concern on any Unix OS (e.g. Linux, *BSD, *nix).

    Also relevant to dotfiles managers:

    Currently there is also a related issue where YAML schema configs are rewritten using static paths, which would need to be solved to avoid VSCode making file changes on it's own accord (outside of a dotfiles manager). One example is atlassian/atlascode#155 but this may also affect other yaml.schemas settings and extensions that use this.

    Expand for yaml.schemas dotfile rewrite example

    When opening & using VSCode, the yaml.schemas config file setting in settings.json is rewritten using an absolute path, which will of course be different across different machines & OS. Therefore, the ${userHome} variable should NOT be expanded and rewritten back to the settings.json config.

    .config/Code/User/settings.json:

    diff --git a/app_modified/.config/Code/User/settings.json b/app_modified/.config/Code/User/settings.json
    index f7c9bb2..d6bf195 100644
    --- a/app_modified/.config/Void/User/settings.json
    +++ b/app_modified/.config/Void/User/settings.json
    @@ -168,7 +169,7 @@
           "editor.formatOnType": true // Enable formatting while typing
         },
         "yaml.schemas": {
    -      "file://${userHome}/.vscode/extensions/atlassian.atlascode-3.8.15-universal/resources/schemas/pipelines-schema.json": "bitbucket-pipelines.yml"
    +      "file:///home/exampleuser/.vscode/extensions/atlassian.atlascode-3.8.15-universal/resources/schemas/pipelines-schema.json": "bitbucket-pipelines.yml"
         },
         "gitlens.graph.dimMergeCommits": true,
         "gitlens.views.repositories.showIncomingActivity": true,

  18. SinMayFly commented on Nov 22, 2025

    @SinMayFly

    As a Mac user, I'd like to be able to control the config file path and change it to ~/Library/Application Support/Code/User/settings.json -> ~/.config/vscode/User/settings.json

    That's exactly what I'm thinking too

  19. XhstormR commented on Dec 8, 2025

    @XhstormR

    As a Mac user, I'd like to be able to control the config file path and change it to ~/Library/Application Support/Code/User/settings.json -> ~/.config/Code/User/settings.json

    Can we achieve this by using the ln -s command to soft link the folder?

  20. Lannakin commented on Dec 29, 2025

    @Lannakin

    Can we achieve this by using the ln -s command to soft link the folder?

    Sure! But this does not solve the issue of it unnecessarily adding more clutter to $HOME.

  21. AnrDaemon commented on Apr 28, 2026

    @AnrDaemon

    To add to the pile of crap that is the current VSCode profile directory, it needs a separation into disposable "cache" directory and important "user profile" directory. An I mean clear separation, where I can tell backup tools "don't archive the entirety this directory" and it "do the right thing".

  22. levonk commented on Aug 10, 2026

    @levonk

    For anyone following this umbrella issue specifically for the ~/.vscode-shared/ path introduced in PR #311317 (April 2026): I've opened a focused sub-issue at #330061 requesting $XDG_STATE_HOME for that specific path.

    Why a separate issue:

    This isn't meant to fragment the XDG compliance effort — #3884 remains the umbrella. But a focused issue for a specific new path is more actionable than a 10-year-old thread with 222 comments.

  23. btardif commented on Aug 26, 2026

    @btardif

    On Windows, the remaining profile-root paths are %USERPROFILE%\.vscode and %USERPROFILE%\.vscode-shared. --extensions-dir can relocate extensions only when every launch path uses the flag, while argv.json remains in .vscode. The newer shared database has an undocumented --shared-data-dir flag but no persistent environment override. This affects Start Menu launches, file associations, Git, and other integrations that do not consistently carry custom CLI flags.

    A supported Windows path policy or documented persistent overrides for the extensions, argv.json, and application-shared state would allow these directories to move under platform-appropriate AppData locations without relying on junctions or modified shortcuts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    debtfeature-requestworkbench-os-integration

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions