@rex_koh/subagent-budget-guard 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  "name": "subagent-budget-guard",
3
3
  "displayName": "Subagent Budget Guard",
4
4
  "description": "Hard-deny subagent launches, record verified subagent usage, and enforce a session budget against Claude Code's 5-hour rate-limit percentage.",
5
- "version": "0.1.1",
5
+ "version": "0.1.2",
6
6
  "author": {
7
7
  "name": "ClaudeSubAgentSuppressor"
8
8
  },
@@ -15,14 +15,6 @@
15
15
  "hooks"
16
16
  ],
17
17
  "userConfig": {
18
- "max_subagents_per_session": {
19
- "type": "number",
20
- "title": "Max subagents per session",
21
- "description": "Maximum normal Agent tool subagents allowed in one Claude Code session. The default 0 blocks all new subagents.",
22
- "default": 0,
23
- "min": 0,
24
- "required": true
25
- },
26
18
  "max_concurrent_subagents": {
27
19
  "type": "number",
28
20
  "title": "Max concurrent subagents",
@@ -31,14 +23,6 @@
31
23
  "min": 0,
32
24
  "required": true
33
25
  },
34
- "max_agent_team_tasks_per_session": {
35
- "type": "number",
36
- "title": "Max agent-team tasks per session",
37
- "description": "Maximum agent-team tasks that may be created in one session. The default 0 suppresses agent-team task creation.",
38
- "default": 0,
39
- "min": 0,
40
- "required": true
41
- },
42
26
  "max_subagent_tokens_per_session": {
43
27
  "type": "number",
44
28
  "title": "Max verified subagent tokens per session",
@@ -68,7 +52,7 @@
68
52
  "enforcement_enabled": {
69
53
  "type": "boolean",
70
54
  "title": "Enable enforcement",
71
- "description": "When true, hooks deny over-budget subagents, agent-team tasks, and prompts. When false, the plugin records usage without blocking.",
55
+ "description": "When true, hooks deny over-budget subagents and prompts. When false, the plugin records usage without blocking.",
72
56
  "default": true,
73
57
  "required": true
74
58
  }
package/README.md CHANGED
@@ -43,4 +43,4 @@ Offline verification:
43
43
  node bin/verify.js --offline
44
44
  ```
45
45
 
46
- The plugin is strict by default: `max_subagents_per_session`, `max_concurrent_subagents`, and `max_agent_team_tasks_per_session` all default to `0`.
46
+ The plugin is strict by default: `max_concurrent_subagents` defaults to `0`, so normal subagent launches are blocked unless raised.
package/lib/guard.js CHANGED
@@ -16,9 +16,7 @@ import path from 'node:path';
16
16
  export const PLUGIN_NAME = 'subagent-budget-guard';
17
17
 
18
18
  export const DEFAULT_CONFIG = Object.freeze({
19
- max_subagents_per_session: 0,
20
19
  max_concurrent_subagents: 0,
21
- max_agent_team_tasks_per_session: 0,
22
20
  max_subagent_tokens_per_session: 0,
23
21
  session_five_hour_budget_percent: 25,
24
22
  absolute_five_hour_ceiling_percent: 95,
@@ -306,14 +304,6 @@ function agentDenyReason(state, config) {
306
304
  const budgetReason = fiveHourBudgetDecision(state, config);
307
305
  if (budgetReason) return budgetReason;
308
306
 
309
- if (config.max_subagents_per_session === 0) {
310
- return 'Subagent launch denied: max_subagents_per_session is 0.';
311
- }
312
-
313
- if (state.subagents.allowed >= config.max_subagents_per_session) {
314
- return `Subagent launch denied: max_subagents_per_session ${config.max_subagents_per_session} already reached.`;
315
- }
316
-
317
307
  if (config.max_concurrent_subagents === 0) {
318
308
  return 'Subagent launch denied: max_concurrent_subagents is 0.';
319
309
  }
@@ -474,14 +464,6 @@ function taskDenyReason(state, config) {
474
464
  const budgetReason = fiveHourBudgetDecision(state, config);
475
465
  if (budgetReason) return budgetReason;
476
466
 
477
- if (config.max_agent_team_tasks_per_session === 0) {
478
- return 'Agent-team task denied: max_agent_team_tasks_per_session is 0.';
479
- }
480
-
481
- if (state.agentTeam.created >= config.max_agent_team_tasks_per_session) {
482
- return `Agent-team task denied: max_agent_team_tasks_per_session ${config.max_agent_team_tasks_per_session} already reached.`;
483
- }
484
-
485
467
  return null;
486
468
  }
487
469
 
@@ -614,9 +596,7 @@ export async function buildReport(sessionId, env = process.env) {
614
596
  state,
615
597
  summary: {
616
598
  verifiedTokenLabel: `${state.subagents.verifiedTokens.toLocaleString('en-US')} verified tokens`,
617
- subagentLaunches: `${state.subagents.allowed}/${config.max_subagents_per_session}`,
618
599
  activeSubagents: `${state.subagents.active}/${config.max_concurrent_subagents}`,
619
- agentTeamTasks: `${state.agentTeam.created}/${config.max_agent_team_tasks_per_session}`,
620
600
  fiveHourBudget:
621
601
  consumed === null
622
602
  ? '5-hour usage unavailable'
package/lib/verifier.js CHANGED
@@ -87,7 +87,7 @@ export async function runOfflineVerification({
87
87
  entry.source?.package === '@rex_koh/subagent-budget-guard',
88
88
  'marketplace npm package mismatch'
89
89
  );
90
- assert(entry.source?.version === '0.1.1', 'marketplace npm version mismatch');
90
+ assert(entry.source?.version === '0.1.2', 'marketplace npm version mismatch');
91
91
  return marketplacePath;
92
92
  });
93
93
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rex_koh/subagent-budget-guard",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Claude Code plugin that blocks subagents by default, records verified subagent usage, and enforces 5-hour usage budgets.",
5
5
  "license": "MIT",
6
6
  "author": "ClaudeSubAgentSuppressor",