{
  "id": 4356082,
  "title": "How I Built a Virtual Folder Tree from Flat Filenames — No Files Moved, No Symlinks, Just 300 Lines of TypeScript",
  "url": "https://urgent.news/2026/08/30/how-i-built-a-virtual-folder-tree-from-flat-filenames-no-files-moved",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-30T05:38:58.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/473185670/how-i-built-a-virtual-folder-tree-from-flat-filenames-no-files-moved-no-symlinks-just-300-lines-4gil"
  },
  "original_language": "en",
  "account": "My project grew to 340 files in a single directory. All of them were flat and in the root. The AI agent loved this layout, as it eliminated path ambiguity and made files easily reachable with a single read_file call. However, I found it frustrating to scroll through 340 files to find the specific one I needed. My brain didn't rely on grep, so I decided to create a solution.\n\nI developed a VSCode and IntelliJ plugin called Logical Folders. This plugin displays flat files as a virtual directory tree without moving any files or creating symlinks. The hierarchy is purely visual, keeping the files in their original state on disk. The core of the plugin is a function called parsePath. It splits a filename on a separator and keeps the extension attached to the last segment. For example, auth_login_handler.ts becomes [auth, login, handler.ts].\n\nWhen you right-click on auth/login/ and create a new handler.ts file, the plugin reassembles the segments into auth_login_handler.ts and writes the flat file back to disk. The virtual tree is a representation of the flat files, not the actual truth of the disk. To build the virtual tree, VSCode's TreeDataProvider interface requires a getChildren(element?) function. I scanned the entire workspace once, parsed every file path, and inserted them into a tree of LogicalNode objects. This virtual directory tree allows me to navigate the 340 flat files as if they were organized in a hierarchical structure, without actually rearranging the files on my disk.",
  "summary": "I let an AI agent write code in my project for a week. By Friday there were 340 files in one directory. auth_login_handler.ts . auth_login_session.ts . utils_helpers.ts . config_env.ts . All flat. All in the root. The agent loved it. No path ambiguity, no directory hops, no \"which folder was that in?\" 鈥?every file one read_file call away. Flat is the agent's native habitat. I hated it. Scrolling…",
  "key_points": [
    "Developed VSCode and IntelliJ plugin called Logical Folders",
    "Displays flat files as virtual directory tree without moving files",
    "Core function parsePath splits filenames into hierarchical segments"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}