Cursor Subagent Toggle controls whether Cursor can create subagents by managing hooks by default:
- Local workspace hook config:
.cursor/hooks.json - Local workspace blocker scripts:
.cursor/hooks/block-subagent.shand.cursor/hooks/block-task-tool.sh - Global user hook config:
~/.cursor/hooks.json - Global blocker scripts:
~/.cursor/hooks/block-subagent.shand~/.cursor/hooks/block-task-tool.sh - Optional local workspace managed rule:
.cursor/rules/cursor-subagent-toggle.mdc
The extension shows global and workspace states together in a dedicated sidebar and in the status bar, including support for multi-root workspaces.
- Sidebar cards for global and each workspace folder
- Small toggle switch per scope
- Live final-status summary in the status bar
- Language selector (
English / ํ๊ตญ์ด) - Safe handling for custom or partial managed hooks (
CHECKstate) - One-click
Apply Recommended Configto install the managedpreToolUse(Task)andsubagentStarthook pair - Hooks-only blocking by default, using two managed scripts
- Optional managed project rule injection inside the workspace
Moredialog, labeled recommended off - A workspace checkbox to add only the generated blocker scripts and optional managed project rule path to
.gitignore, labeled recommended on - A separate workspace checkbox to add only
.cursor/hooks.jsonto.gitignore, labeled recommended on
- Toggle
ONmeans subagent creation is allowed in that local scope. - Toggle
OFFmeans the managed blocker is enabled in that local scope. - Workspace
OFFwrites both managed deny hooks and two managed hook scripts. - Workspace
ONremoves only the managed hook entries from.cursor/hooks.json. - The managed project rule is installed only when the workspace rule checkbox is enabled inside the
Moredialog. - Turning the rule checkbox off in
Moredeletes only.cursor/rules/cursor-subagent-toggle.mdcwhen it still matches the extension-managed content. - Existing user-created
.cursor/rules/*.mdcfiles are not modified, merged, or deleted. - The local git ignore checkbox adds only
.cursor/hooks/block-subagent.sh,.cursor/hooks/block-task-tool.sh, and the optional managed rule path to the workspace.gitignore. - The checkbox is checked only when all generated file paths are already ignored by the workspace
.gitignore. - The separate hooks.json checkbox adds only
.cursor/hooks.jsonto the workspace.gitignore. - The hooks.json checkbox is checked only when
.cursor/hooks.jsonis already ignored by the workspace.gitignore. - When the checkbox is turned off, the extension removes only its own managed
.gitignoremarker block and leaves user-defined ignore rules intact. - Global
OFFwrites the global deny hooks only. It installs workspace managed rules only for folders where the optional rule checkbox is enabled inMore. - Global
ONremoves the global deny hooks and removes the managed project rule only from workspace folders that are not locallyOFF. - Effective final state still follows Cursor scope priority: global blocking can override a local workspace.
๐ข ON: No blocking hook is applied.๐ด OFF: Managed blocking hook is applied.๐ก MIXED: Different effective states across folders in multi-root.โช CHECK: Custom or partial managed hooks exist, so safe ON/OFF inference is not possible.๐ ERROR: Invalidhooks.jsonor missing managed script.
The sidebar also shows the optional managed project rule state:
Managed: The extension-managed project rule exists and matches the expected content.Missing: The managed project rule is missing while the optional rule checkbox is enabled inMoreand the effective state is blocked.Modified - protected: The managed project rule file exists but no longer matches the extension content. The extension does not delete modified rule content.
The workspace card also shows whether generated blocker paths and hooks.json are ignored by git. If the exact ignore entries already exist outside extension-managed blocks, they are shown as Already ignored and are not removed by the extension.
Workspace blocker command:
{
"version": 1,
"hooks": {
"preToolUse": [
{
"command": "bash .cursor/hooks/block-task-tool.sh",
"matcher": "Task",
"failClosed": true
}
],
"subagentStart": [
{
"command": "bash .cursor/hooks/block-subagent.sh",
"failClosed": true
}
]
}
}Global blocker command:
{
"version": 1,
"hooks": {
"sessionStart": [
{
"command": "bash ./hooks/inject-ask-context.sh"
}
],
"preToolUse": [
{
"command": "bash ./hooks/block-task-tool.sh",
"matcher": "Task",
"failClosed": true
}
],
"subagentStart": [
{
"command": "bash ./hooks/block-subagent.sh",
"failClosed": true
}
]
}
}Existing non-managed hooks such as sessionStart are preserved when applying or toggling the managed global blocker.
When a workspace needs prompt-context protection and the rule checkbox is enabled in More, the extension creates only this file:
.cursor/rules/cursor-subagent-toggle.mdc
The rule starts with:
# [DO NOT CALL SUBAGENTS]It also states that this rule is a higher-priority safety override for the workspace and that conflicting Cursor rules, project rules, user rules, instructions, or prompts must yield to the no-subagent rule.
When the local git ignore checkbox is enabled, the extension adds only these generated file paths to the workspace .gitignore:
# Cursor Subagent Toggle: managed generated files
.cursor/hooks/block-subagent.sh
.cursor/hooks/block-task-tool.sh
.cursor/rules/cursor-subagent-toggle.mdc
# End Cursor Subagent ToggleOnly this marked block is removed when the checkbox is disabled.
The separate hooks.json checkbox uses its own marker block:
# Cursor Subagent Toggle: hooks config ignore
.cursor/hooks.json
# End Cursor Subagent ToggleCursor Subagent Toggle์ ๊ธฐ๋ณธ์ ์ผ๋ก hooks๋ฅผ ๊ด๋ฆฌํด์ Cursor์ subagent ์์ฑ ํ์ฉ ์ฌ๋ถ๋ฅผ ์ ์ดํฉ๋๋ค.
- ๋ก์ปฌ ์ํฌ์คํ์ด์ค hook ์ค์ :
.cursor/hooks.json - ๋ก์ปฌ ์ํฌ์คํ์ด์ค blocker script:
.cursor/hooks/block-subagent.sh,.cursor/hooks/block-task-tool.sh - ์ ์ญ ์ฌ์ฉ์ hook ์ค์ :
~/.cursor/hooks.json - ์ ์ญ blocker script:
~/.cursor/hooks/block-subagent.sh,~/.cursor/hooks/block-task-tool.sh - ์ ํ ๋ก์ปฌ ์ํฌ์คํ์ด์ค ๊ด๋ฆฌ rule:
.cursor/rules/cursor-subagent-toggle.mdc
ํ์ฅ์ ์ ์ฉ ์ฌ์ด๋๋ฐ์ status bar์์ ์ ์ญ/๋ก์ปฌ ์ํ๋ฅผ ํจ๊ป ๋ณด์ฌ์ฃผ๋ฉฐ, ๋ฉํฐ ๋ฃจํธ ์ํฌ์คํ์ด์ค๋ ์ง์ํฉ๋๋ค.
- ์ ์ญ ์นด๋ + ์ํฌ์คํ์ด์ค ํด๋๋ณ ์นด๋ ์ ๊ณต
- ๋ฒ์๋ณ ์์ ํ ๊ธ ์ค์์น ์ ๊ณต
- status bar์ ์ต์ข ์ํ ์ค์๊ฐ ์์ฝ ํ์
- ์ธ์ด ์ ํ๊ธฐ (
English / ํ๊ตญ์ด) - ์ปค์คํ
๋๋ ์ผ๋ถ managed hook์ ๋ํ ์์ ๋ชจ๋(
CHECK์ํ) Apply Recommended Config๋ฒํผ์ผ๋ก ๊ด๋ฆฌpreToolUse(Task)๋ฐsubagentStarthook pair ์ค์น- ๊ธฐ๋ณธ๊ฐ์ ๋ managed script๋ฅผ ์ฌ์ฉํ๋ hooks-only ์ฐจ๋จ
- subagent ๋นํ์ฑํ ์ ๋ ๊ฐํ prompt-context ์ง์๋ฅผ ์ํ managed project rule์ workspace
๋๋ณด๊ธฐํ์ ์์์ ์ ๊ณตํ๋ฉฐ ๊ถ์ฅ off๋ก ํ์ - ์์ฑ๋ blocker script๋ค๊ณผ ์ ํ managed project rule ๊ฒฝ๋ก๋ง
.gitignore์ ์ถ๊ฐํ๋ workspace ์ฒดํฌ๋ฐ์ค ์ ๊ณต, ๊ถ์ฅ on์ผ๋ก ํ์ .cursor/hooks.jsonํ์ผ๋ง.gitignore์ ์ถ๊ฐํ๋ ๋ณ๋ workspace ์ฒดํฌ๋ฐ์ค ์ ๊ณต, ๊ถ์ฅ on์ผ๋ก ํ์
- ํ ๊ธ
ON: ํด๋น ๋ก์ปฌ ๋ฒ์์์ subagent ์์ฑ ํ์ฉ - ํ ๊ธ
OFF: ํด๋น ๋ก์ปฌ ๋ฒ์์์ managed blocker ํ์ฑํ - ์ํฌ์คํ์ด์ค
OFF: managed deny hook ๋ ๊ฐ์ managed hook script ๋ ๊ฐ๋ฅผ ์์ฑ - ์ํฌ์คํ์ด์ค
ON:.cursor/hooks.json์์ managed hook entry๋ง ์ ๊ฑฐ - managed project rule์
๋๋ณด๊ธฐํ์ ์์ workspace rule ์ฒดํฌ๋ฐ์ค๊ฐ ์ผ์ ธ ์์ ๋๋ง ์ค์น ๋๋ณด๊ธฐ์ rule ์ฒดํฌ๋ฐ์ค๋ฅผ ๋๋ฉด.cursor/rules/cursor-subagent-toggle.mdc๊ฐ extension ๊ด๋ฆฌ ๋ด์ฉ๊ณผ ์ผ์นํ ๋๋ง ์ญ์ - ์ฌ์ฉ์๊ฐ ๋ง๋ ๊ธฐ์กด
.cursor/rules/*.mdcํ์ผ์ ์์ , ๋ณํฉ, ์ญ์ ํ์ง ์์ - ๋ก์ปฌ git ignore ์ฒดํฌ๋ฐ์ค๋ workspace
.gitignore์.cursor/hooks/block-subagent.sh,.cursor/hooks/block-task-tool.sh๋ฐ ์ ํ managed rule ๊ฒฝ๋ก๋ง ์ถ๊ฐ - ์ฒดํฌ๋ฐ์ค๋ ์์ฑ ํ์ผ ๊ฒฝ๋ก๊ฐ ๋ชจ๋ workspace
.gitignore์ ํฌํจ๋์ด ์์ ๋๋ง ์ฒดํฌ๋จ - ๋ณ๋ hooks.json ์ฒดํฌ๋ฐ์ค๋ workspace
.gitignore์.cursor/hooks.jsonํ์ผ๋ง ์ถ๊ฐ - hooks.json ์ฒดํฌ๋ฐ์ค๋
.cursor/hooks.json์ด workspace.gitignore์ ํฌํจ๋์ด ์์ ๋๋ง ์ฒดํฌ๋จ - ์ฒดํฌ๋ฐ์ค๋ฅผ ๋๋ฉด extension์ด ๋ง๋
.gitignoremarker block๋ง ์ ๊ฑฐํ๊ณ , ์ฌ์ฉ์๊ฐ ์ ์ํ ignore rule์ ๊ทธ๋๋ก ๋ - ์ ์ญ
OFF: ์ ์ญ deny hooks๋ง ์ ์ฉ. workspace managed rule์ ํด๋น ํด๋์๋๋ณด๊ธฐ์ ํ rule ์ฒดํฌ๋ฐ์ค๊ฐ ์ผ์ ธ ์์ ๋๋ง ์ค์น - ์ ์ญ
ON: ์ ์ญ deny hooks๋ฅผ ์ ๊ฑฐํ๊ณ , ๋ก์ปฌ์ดOFF๊ฐ ์๋ workspace folder์์๋ง managed project rule ์ญ์ - ์ต์ข ์ํ๋ Cursor ๋ฒ์ ์ฐ์ ์์์ ์ํฅ์ ๋ฐ์ผ๋ฉฐ, ์ ์ญ ์ฐจ๋จ์ด ๋ก์ปฌ ์ํ๋ฅผ overrideํ ์ ์์
๐ข ON: ์ฐจ๋จ hook ์์๐ด OFF: managed ์ฐจ๋จ hook ์ ์ฉ๋จ๐ก MIXED: ๋ฉํฐ ๋ฃจํธ์์ ํด๋๋ณ ์ต์ข ์ํ๊ฐ ๋ค๋ฆโช CHECK: ์ปค์คํ ๋๋ ์ผ๋ถ managed hook์ด ์์ด ON/OFF๋ฅผ ์์ ํ๊ฒ ๋จ์ ํ ์ ์์๐ ERROR:hooks.jsonํ์ฑ ์ค๋ฅ ๋๋ managed ์คํฌ๋ฆฝํธ ๋๋ฝ
์ฌ์ด๋๋ฐ๋ ์ ํ managed project rule ์ํ๋ ํจ๊ป ๋ณด์ฌ์ค๋๋ค.
๊ด๋ฆฌ๋จ: extension์ด ๊ด๋ฆฌํ๋ project rule์ด ์๊ณ ์์ ๋ด์ฉ๊ณผ ์ผ์นํจ์์:๋๋ณด๊ธฐ์ ์ ํ rule ์ฒดํฌ๋ฐ์ค๊ฐ ์ผ์ ธ ์๊ณ ์ต์ข ์ํ๊ฐ ์ฐจ๋จ์ธ๋ฐ managed project rule์ด ์์์์ ๋จ - ๋ณดํธ: managed project rule ํ์ผ์ด ์์ง๋ง extension ๋ด์ฉ๊ณผ ๋ค๋ฆ. extension์ ์์ ๋ rule ๋ด์ฉ์ ์ญ์ ํ์ง ์์
workspace ์นด๋๋ ์์ฑ blocker ๊ฒฝ๋ก๋ค๊ณผ hooks.json์ด git์์ ๋ฌด์๋๋์ง๋ ๋ณด์ฌ์ค๋๋ค. extension์ด ๋ง๋ block ๋ฐ์ ๋์ผํ ignore entry๋ค์ด ์ด๋ฏธ ์์ผ๋ฉด ์ด๋ฏธ ๋ฌด์๋จ์ผ๋ก ํ์ํ๊ณ extension์ด ์ญ์ ํ์ง ์์ต๋๋ค.
์ํฌ์คํ์ด์ค ์ฐจ๋จ command:
{
"version": 1,
"hooks": {
"preToolUse": [
{
"command": "bash .cursor/hooks/block-task-tool.sh",
"matcher": "Task",
"failClosed": true
}
],
"subagentStart": [
{
"command": "bash .cursor/hooks/block-subagent.sh",
"failClosed": true
}
]
}
}์ ์ญ ์ฐจ๋จ command:
{
"version": 1,
"hooks": {
"sessionStart": [
{
"command": "bash ./hooks/inject-ask-context.sh"
}
],
"preToolUse": [
{
"command": "bash ./hooks/block-task-tool.sh",
"matcher": "Task",
"failClosed": true
}
],
"subagentStart": [
{
"command": "bash ./hooks/block-subagent.sh",
"failClosed": true
}
]
}
}sessionStart ๊ฐ์ ๊ธฐ์กด non-managed hook์ ์ ์ญ blocker๋ฅผ ์ ์ฉํ๊ฑฐ๋ ํ ๊ธํด๋ ์ ์ง๋ฉ๋๋ค.
์ํฌ์คํ์ด์ค์ prompt-context ๋ณดํธ๊ฐ ํ์ํ๊ณ ๋๋ณด๊ธฐ์ rule ์ฒดํฌ๋ฐ์ค๊ฐ ์ผ์ ธ ์์ ๋ extension์ ์๋ ํ์ผ ํ๋๋ง ์์ฑํฉ๋๋ค.
.cursor/rules/cursor-subagent-toggle.mdc
rule์ ์๋ ๋ฌธ๊ตฌ๋ก ์์ํฉ๋๋ค.
# [DO NOT CALL SUBAGENTS]๋ํ ์ด rule์ด ์ํฌ์คํ์ด์ค์ higher-priority safety override์ด๋ฉฐ, ์ถฉ๋ํ๋ Cursor rule, project rule, user rule, instruction, prompt๋ณด๋ค no-subagent rule์ ์ฐ์ ํด์ผ ํ๋ค๊ณ ๋ช ์ํฉ๋๋ค.
๋ก์ปฌ git ignore ์ฒดํฌ๋ฐ์ค๊ฐ ํ์ฑํ๋์ด ์์ผ๋ฉด extension์ workspace .gitignore์ ์๋ ์์ฑ ํ์ผ ๊ฒฝ๋ก๋ง ์ถ๊ฐํฉ๋๋ค.
# Cursor Subagent Toggle: managed generated files
.cursor/hooks/block-subagent.sh
.cursor/hooks/block-task-tool.sh
.cursor/rules/cursor-subagent-toggle.mdc
# End Cursor Subagent Toggle์ฒดํฌ๋ฐ์ค๋ฅผ ๋ ๋๋ ์ด marker block๋ง ์ ๊ฑฐํฉ๋๋ค.
๋ณ๋ hooks.json ์ฒดํฌ๋ฐ์ค๋ ์์ฒด marker block์ ์ฌ์ฉํฉ๋๋ค.
# Cursor Subagent Toggle: hooks config ignore
.cursor/hooks.json
# End Cursor Subagent ToggleRun the full local verification before packaging or publishing:
npm run checkThis runs TypeScript compilation and the Vitest unit test suite for the shared hook/gitignore helpers.
This project is UNLICENSED. See LICENSE for the full all-rights-reserved notice.
ํจํค์ง ๋๋ ๋ฐฐํฌ ์ ์๋ ๋ช ๋ น์ผ๋ก ์ ์ฒด ๋ก์ปฌ ๊ฒ์ฆ์ ์คํํ์ธ์.
npm run check์ด ๋ช ๋ น์ TypeScript ์ปดํ์ผ๊ณผ hook/gitignore ๊ณต์ฉ helper์ ๋ํ Vitest ๋จ์ ํ ์คํธ๋ฅผ ์คํํฉ๋๋ค.
์ด ํ๋ก์ ํธ๋ UNLICENSED์
๋๋ค. ์ ์ฒด all-rights-reserved ๊ณ ์ง๋ LICENSE๋ฅผ ํ์ธํ์ธ์.