Why don't my project folders stay open each time I start Atom?

Atom’s logic when starting up is consistent and designed that way, but many people have found it counter-intuitive. This FAQ post seeks to explain what the tree view is, why Atom behaves the way it does, and how to work with its built-in behavior instead of being frustrated by it.

The tree view

Much of the confusion has stemmed from the way the tree view appears to be a list of folders for projects. This is not its intended role; instead, it is a list of folders for the current project. When Atom is opened with a specific file or directory as the target, the tree view will show that target and not any of the things that were open before. It seems like it forgets what you had open, but that’s not the case; instead, it was never designed to remember.

Atom’s opening behavior

When you start Atom, it first checks to see whether or not you opened it with a target (that is, you right-clicked on a file or directory and selected “Open with Atom” from the context menu, or you started Atom from the command line with a file or directory as an argument). If there is no target, it looks at the file .atom/storage/application.json to see which directories it should open. This is how the tree view appears to remember what you had open last time. You can go check your application.json file right now; if you closed and reopened Atom right now, those are the paths that would be opened.

Important: application.json gets overwritten all the time. It is not a reliable way to store your project folders, because it’s easy to scrap the information on accident. See below for how to take control of that.

OS X Users: Keep in mind that Mac has always had a quirk of behavior where it’s possible to close all windows of a program without the main process of that program closing. If you have Atom open but with no windows, and you open a new window, it will behave as if you’re just opening a new window. Atom has to be completely closed in order to recall the contents of application.json.

Per-path storage

By now you might be a bit confused. application.json only lists paths, but Atom remembers what tabs you had open as well as unsaved files. Atom uses IndexedDB to store this information and it knows where to look based on the project paths. For a concrete example of this, open Atom with a single project folder, open some tabs, close Atom, open Atom with the target as another folder, close Atom again, and open Atom once more with the original target. Your tabs and all of your information will be right there.

How to be the boss of Atom

For simple, one-folder projects, it’s easy enough to implement a variety of solutions. You can use your file manager to organize your projects and right-click on them to open with Atom. You can place shortcuts on your desktop. You can use a command line and give easy-to-remember paths to each of them. This gets a little less simple if you have projects with multiple folders on different parts of your hard drive. There are a variety of community packages for project management that make it easy to name and categorize your projects, then tell Atom to reopen precisely the directories you’re working with (which, in turn, will make the per-path storage foolproof).