VS Code is full of features some of us never use, and one such feature I discovered very recently is the task runner. It’s one of those features that quietly changes how you work once you start using it properly. Most people open a terminal, type the same commands every day, rerun scripts manually, switch between windows, and waste time on repetitive setup. Task runner automates all of that directly inside VS Code.
The core idea is simple: you define commands once in a tasks.json file, and VS Code turns them into reusable actions you can run with shortcuts, menus, or automatically during debugging.
Google Antigravity isn’t a VS Code killer; it’s a mental shift I wasn’t ready for in software development
Uncomfortable brilliance of Google Antigravity.
Task runner is meant to save time
And it does that well
The ultimate goal of task runner is to eliminate friction and save time, and it does that well. It transitions your daily dev workflow from manual typing to one-click execution. A task can be something simple, like running npm run dev, or something more advanced, like starting your backend server, frontend server, or Docker containers with a single action. Once you start using the task runner properly, a lot of repetitive terminal work disappears.
The feature helps fix the mess that is the modern development environment. Even a relatively simple project today can involve multiple terminals, package managers, local servers, SSH sessions, or AI tooling. Most devs repeatedly type the same commands every single day. VS Code’s task runner removes that repetition.
You no longer have to leave your code editor to open a terminal, navigate to a directory, and manually trigger a script. You can chain multiple actions, such as compiling code, clearing cache, and launching an application, into a single command. Task configurations are saved as text files (.vscode/tasks.json), which means you can commit them to Git so your entire team runs local builds, tests, or linters in exactly the same way.
Some common use cases for this feature include instantly running a local database migration or spinning up a local container environment with commands like docker-compose up. You can automate code cleanup before a commit by running a linter and bundling assets with npm run build. You can also automatically compile edited source files with custom flags and immediately run the resulting binary without manually repeating the same workflow every time.
Setting task runner up for your workflow
You can also run multiple tasks together
Setting up VS Code Task Runner doesn’t take a lot of time, and the entire system revolves around a single configuration file called tasks.json. Once you understand how that file works, the rest of the feature starts making sense very quickly.
The first thing you need to do is open the project where you want to use the task runner. Tasks are configured per project because different projects have different workflows, commands, and environments. Once your folder is open in VS Code, open the Command Palette, then search for Tasks: Configure Task.
When you select it, VS Code will ask whether you want to create a new tasks.json file. If the project does not already have one, VS Code creates a .vscode folder inside your project and places the configuration file there. That tasks.json file becomes the control center for your workflows. A very basic starter configuration looks like this:
{
"version": "2.0.0",
"tasks": [
{
"label": "Start Dev Server",
"type": "shell",
"command": "npm run dev"
}
]
}
Inside the tasks array, you define individual tasks. The label is simply the name that appears inside VS Code when you run the task. You can call it anything you want. The type determines how the command executes. In most cases, you will use "shell" because it runs commands exactly like your normal terminal would. The command field is the actual terminal command you want VS Code to execute.
Once you save the file, the task becomes available immediately. To run it, open the Command Palette again and search for Tasks: Run Task. VS Code will show a list of every task defined inside your tasks.json file. Select the one you want, and VS Code launches it in the integrated terminal. At this point, you have already automated your first workflow.
The task runner can also combine multiple tasks into a single, larger workflow. VS Code calls these compound tasks. Instead of launching every service manually one by one, you create smaller reusable tasks and then define a master task that runs all of them together. For example, a fullstack project might need a frontend server, backend API, database container, and file watcher running simultaneously. Normally, you would open multiple terminals and start each service separately every single time you work on the project. Compound tasks eliminate that entire setup process.
Visual Studio Code
Visual Studio Code (VS Code) is a code editor developed by Microsoft.
I self-hosted this VS Code fork so that I can access it in my browser, and I'll never go back
Code-Server is perfect for a centralized programming workstation
