How to choose whether a Claude Code skill runs in the background with the background setting
Add context: fork to a Claude Code skill's frontmatter and the skill runs in its own subagent, in the background by default. You keep working, and its result lands in the conversation when it finishes. When you need the result in the same turn, add background: false.
---
name: release-check
description: Run the pre-release checklist
context: fork
background: false
---
The background field only applies with context: fork, and it defaults to true. Set it to false when:
- The skill needs a tool outside the narrower tool set that background subagents get. With
falseit keeps the full tool set. - The skill edits files. A backgrounded skill's edits happen outside your session's checkpoints, so
/rewindwon't restore them; revert those with git. - Your next step depends directly on the skill's result.
Claude Code also waits for the result without the setting in non-interactive -p runs and the Agent SDK, when CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1 is set, and when you invoke the same skill while an earlier run is still going.
Since 2.1.337, released December 4, Desktop, cloud and Remote Control sessions show a "Run in background" option on a running skill (except on third-party providers). A skill with background: false stays in the conversation.
Sources
Get notified when a new tip lands
Tip alerts only go out in the app. Install it and turn notifications on.