Pressing Ctrl+Shift+B on Windows or Linux, or Shift+Cmd+B on macOS, runs your VS Code default build task. You select one build task for the workspace, then the shortcut runs it without opening the task picker.
This article assumes you already have a tasks.json file with at least one task defined.
What a default build task does
A default build task is the task that runs when you use the build shortcut or choose Terminal > Run Build Task.
Without a default, the shortcut shows a picker of available build tasks. You have to choose one every time. With one default, the shortcut runs it immediately.
The default build task is workspace-specific. Each project can have its own. If you open a different folder, its own default build task applies.
Set a default build task from the Command Palette
The fastest way does not require editing JSON. Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run Tasks: Configure Default Build Task.
VS Code shows the available build tasks for the workspace. These can include detected tasks contributed by VS Code or extensions and custom tasks from tasks.json.
Select one from the list. VS Code opens (or updates) your tasks.json and adds the build group to that task:
{
"label": "TypeScript build",
"type": "shell",
"command": "tsc",
"group": {
"kind": "build",
"isDefault": true
}
}Now press Ctrl+Shift+B on Windows or Linux, or Shift+Cmd+B on macOS. The task runs immediately. Its terminal output or generated build artifact confirms that the selected build command ran.
This workflow follows the current official VS Code Tasks guide.
Set a default build task manually in tasks.json
If you prefer to write the configuration yourself, open .vscode/tasks.json in your workspace. If that file does not exist yet, create a task with the tasks.json guide first. Find the task you want to promote, then add the group block:
{
"label": "Project build",
"type": "shell",
"command": "npm run build",
"group": {
"kind": "build",
"isDefault": true
}
}The kind must be build. The isDefault flag must be true. Both are required.
If another task already has isDefault: true, change it to false or remove isDefault from that task. VS Code opens a picker when more than one build task is marked as default.
Save the file. VS Code picks up the change immediately. Press Ctrl+Shift+B to confirm the right task runs.
Choose a good default build task
Your default build task should be the command you run most often during development. Good candidates:
- TypeScript compilation:
tscortsc --watchfor live recompilation. - A build script:
npm run buildormake. - A linter that blocks on errors:
npm run lintso you catch problems before they reach a pull request. - A project build script:
npm run buildwhen the script already contains the checks required by your project.
Do not set a watch-mode task as the default unless you want it to remain active. Watch tasks do not finish on their own, so stop one with Tasks: Terminate Task when you no longer need it.
Run a non-default build task
Open the Command Palette and run Tasks: Run Task, then select the task by its label. This is the reliable way to run a different task without changing the default.
For another one-keystroke action, add a custom keybinding for workbench.action.tasks.runTask with the exact task label as its argument.
Change the default build task
Run Tasks: Configure Default Build Task again and pick a different task. Then inspect tasks.json and make sure only the intended task has isDefault: true.
You can also move the group object manually. Save the file and use the build shortcut to confirm that the new task runs.
Troubleshooting
Ctrl+Shift+B shows a picker instead of running
Either no task is marked as default or more than one build task has isDefault: true. Run Tasks: Configure Default Build Task, then inspect tasks.json and keep isDefault: true on the one task the shortcut should run.
The task runs but says "command not found"
The task command is not on the task environment's PATH or depends on an interactive shell startup file. Try the same command in the integrated terminal first. Prefer a project script or add the executable to the normal PATH, then open a new VS Code window and rerun the task.
Two tasks show the build group in tasks.json
Keep isDefault: true on the task you want the shortcut to run directly. Other tasks can remain in the build group without isDefault and can be started with Tasks: Run Task.
Once your build task runs reliably, learn how problem matchers turn compiler and linter output into clickable errors in the Problems panel.
Rune AI
Key Insights
- Run Tasks: Configure Default Build Task from the Command Palette to choose an available build task.
- In tasks.json, add group: { kind: "build", isDefault: true } to make a task the default build task.
- Press Ctrl+Shift+B on Windows or Linux, or Shift+Cmd+B on macOS, to run it.
- If multiple build tasks are marked as default, VS Code opens a picker instead of choosing one.
- Run a non-default task with Tasks: Run Task or bind it to a custom shortcut.
Frequently Asked Questions
Can I have more than one default build task?
What is the difference between a build task and a test task?
Can I set a default build task without editing tasks.json?
Conclusion
A VS Code default build task turns the Run Build Task shortcut into a direct action. Set group.kind to build and isDefault to true, keep one task as the default, and verify that its expected build output appears when you use the shortcut.
More in this topic
How to Use VS Code with WSL 2 on Windows
Run VS Code connected to Windows Subsystem for Linux so you can develop in a full Linux environment with native tools, terminals, and debugging, all from Windows.
20 Best VS Code Extensions for Web Developers in 2026
Twenty carefully chosen VS Code extensions every web developer should know. Covers formatting, linting, frameworks, debugging, Git, and developer experience.
How to Install, Disable, Update, and Uninstall VS Code Extensions
Learn how to install, disable, update, and uninstall VS Code extensions from the Marketplace and the command line. Step-by-step instructions for every action.