Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Auto Open Latest FilesNew to Visual Studio Code? Get it now.
Auto Open Latest Files

Auto Open Latest Files

ntrandev

|
4 installs
| (0) | Free
Automatically opens latest files in VS Code based on configurable rules
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Auto Open Latest Files

Automatically open the newest file from one or more configured folders, directly from VS Code.

Features

  • Open the newest file by target path.
  • Support multiple targets with quick pick selection.
  • Optional file extension filtering — single or comma-separated (e.g. .log, .txt).
  • Optional exclude list for file names, extensions, or folder names.
  • Choose sort criterion: modification time or creation time.
  • Optional recursive folder scanning.
  • Auto-open the newest file on every refresh cycle.
  • Auto-close previously auto-opened files when a newer match is found.
  • Sidebar views:
    • Latest Files: quickly open, reveal, and copy paths.
    • Configuration: manage target rows from a webview UI.

Requirements

  • VS Code 1.90.0 or newer.

Extension Settings

Targets (vscode-auto-open-latest-files.targets)

An array of folder targets to scan for the newest matching file.

Property Type Required Description
id string Yes Unique identifier for this target.
path string Yes Absolute path to the folder to scan.
fileType string No Comma-separated extension filter(s) including dot, e.g. .log, .txt. Omit to match all files.
exclude string[] No File names, extensions, or folder names to exclude (e.g. .DS_Store, node_modules).
sortBy string No modificationTime (default) or creationTime.
searchSubdirectories boolean No Recursively scan nested subdirectories. Default: false.

Example:

{
  "vscode-auto-open-latest-files.targets": [
    {
      "id": "app-logs",
      "path": "/absolute/path/to/logs",
      "fileType": ".log",
      "exclude": [".DS_Store"],
      "sortBy": "modificationTime",
      "searchSubdirectories": true
    }
  ]
}

Other Settings

Setting Type Default Description
vscode-auto-open-latest-files.refreshInterval number 60 How often (in seconds) the Latest Files sidebar rescans. Minimum: 5.
vscode-auto-open-latest-files.autoOpen boolean false Automatically open the newest file for each target on every refresh cycle.
vscode-auto-open-latest-files.autoClose boolean false Automatically close previously auto-opened files when a newer match is found. Requires autoOpen.

Commands

Command Title
vscode-auto-open-latest-files.openLatestFile Open Latest File
vscode-auto-open-latest-files.refreshTargets Refresh

Context menu commands available in the Latest Files tree:

Command Title
vscode-auto-open-latest-files.openLatestFileInEditor Open
vscode-auto-open-latest-files.revealLatestFileInExplorer Reveal in File Explorer
vscode-auto-open-latest-files.copyLatestFilePath Copy Path
vscode-auto-open-latest-files.copyLatestFileRelativePath Copy Relative Path

How It Works

  1. Configure one or more targets in settings (or the Configuration sidebar view).
  2. Run Open Latest File from the Command Palette.
  3. If multiple targets exist, pick one from the quick pick list.
  4. The extension scans files, selects the newest match, and opens it in the editor.
  5. Optionally enable autoOpen to have the newest file opened automatically on each refresh.

Known Limitations

  • Target paths must be absolute paths.
  • When no files match a target, a warning notification is shown.

License

MIT.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft