@rex_koh/subagent-budget-guard 0.2.0 → 0.3.0
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.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +3 -9
- package/lib/guard.js +1 -4
- package/lib/verifier.js +2 -7
- package/package.json +2 -6
- package/skills/init/SKILL.md +3 -1
- package/skills/doctor/SKILL.md +0 -20
- package/skills/report/SKILL.md +0 -20
- package/skills/setup/SKILL.md +0 -44
- package/skills/status/SKILL.md +0 -18
- package/skills/verify/SKILL.md +0 -22
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "agent-guard",
|
|
3
3
|
"displayName": "Agent 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.
|
|
5
|
+
"version": "0.3.0",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "ClaudeSubAgentSuppressor"
|
|
8
8
|
},
|
package/README.md
CHANGED
|
@@ -10,16 +10,9 @@ Recommended Claude Code install:
|
|
|
10
10
|
/plugin marketplace add rexkoh425/ClaudeSubAgentSuppressor
|
|
11
11
|
/plugin install agent-guard@subagent-budget-tools
|
|
12
12
|
/agent-guard:init
|
|
13
|
-
/agent-guard:doctor
|
|
14
13
|
```
|
|
15
14
|
|
|
16
|
-
After `/agent-guard:init`, fully exit and reopen Claude Code
|
|
17
|
-
|
|
18
|
-
Useful after install:
|
|
19
|
-
|
|
20
|
-
```text
|
|
21
|
-
/agent-guard:status
|
|
22
|
-
```
|
|
15
|
+
After `/agent-guard:init`, fully exit and reopen Claude Code so the statusLine bridge from `settings.json` is active. Some Claude Code builds do not provide an in-session plugin reload command.
|
|
23
16
|
|
|
24
17
|
## NPM Package
|
|
25
18
|
|
|
@@ -30,6 +23,7 @@ Claude Code plugin discovery is marketplace-based, so npm is mainly useful as a
|
|
|
30
23
|
```bash
|
|
31
24
|
npm install -g @rex_koh/subagent-budget-guard
|
|
32
25
|
agent-guard doctor --offline
|
|
26
|
+
agent-guard status
|
|
33
27
|
```
|
|
34
28
|
|
|
35
29
|
Maintainer publish command:
|
|
@@ -57,7 +51,7 @@ enforcement_enabled=true
|
|
|
57
51
|
|
|
58
52
|
For existing installs, setup also removes obsolete `max_subagents_per_session` and `max_agent_team_tasks_per_session` options from this plugin's Claude settings.
|
|
59
53
|
|
|
60
|
-
The setup skill can
|
|
54
|
+
The setup skill can ask for custom values. For direct terminal setup, use:
|
|
61
55
|
|
|
62
56
|
```bash
|
|
63
57
|
agent-guard init
|
package/lib/guard.js
CHANGED
|
@@ -676,10 +676,7 @@ export async function handleUserPromptSubmit(input, env = process.env) {
|
|
|
676
676
|
const sessionId = input?.session_id || 'unknown-session';
|
|
677
677
|
const config = loadConfig(env);
|
|
678
678
|
const state = await readState(sessionId, env);
|
|
679
|
-
const
|
|
680
|
-
includeWarning: false
|
|
681
|
-
});
|
|
682
|
-
const reason = tokenBudgetReason?.reason || fiveHourBudgetDecision(state, config);
|
|
679
|
+
const reason = fiveHourBudgetDecision(state, config);
|
|
683
680
|
|
|
684
681
|
if (!reason) {
|
|
685
682
|
return { exitCode: 0, stdout: null, stderr: '' };
|
package/lib/verifier.js
CHANGED
|
@@ -111,7 +111,7 @@ export async function runOfflineVerification({
|
|
|
111
111
|
entry.source?.package === '@rex_koh/subagent-budget-guard',
|
|
112
112
|
'marketplace npm package mismatch'
|
|
113
113
|
);
|
|
114
|
-
assert(entry.source?.version === '0.
|
|
114
|
+
assert(entry.source?.version === '0.3.0', 'marketplace npm version mismatch');
|
|
115
115
|
return marketplacePath;
|
|
116
116
|
});
|
|
117
117
|
} else {
|
|
@@ -175,12 +175,7 @@ export async function runOfflineVerification({
|
|
|
175
175
|
'bin/verify.js',
|
|
176
176
|
'lib/guard.js',
|
|
177
177
|
'lib/verifier.js',
|
|
178
|
-
'skills/init/SKILL.md'
|
|
179
|
-
'skills/status/SKILL.md',
|
|
180
|
-
'skills/doctor/SKILL.md',
|
|
181
|
-
'skills/setup/SKILL.md',
|
|
182
|
-
'skills/report/SKILL.md',
|
|
183
|
-
'skills/verify/SKILL.md'
|
|
178
|
+
'skills/init/SKILL.md'
|
|
184
179
|
];
|
|
185
180
|
for (const script of scripts) {
|
|
186
181
|
assert(await pathExists(path.join(root, script)), `missing ${script}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rex_koh/subagent-budget-guard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
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",
|
|
@@ -32,11 +32,7 @@
|
|
|
32
32
|
"LICENSE"
|
|
33
33
|
],
|
|
34
34
|
"bin": {
|
|
35
|
-
"agent-guard": "bin/agent-guard.js"
|
|
36
|
-
"ag": "bin/agent-guard.js",
|
|
37
|
-
"subagent-budget-guard-report": "bin/report.js",
|
|
38
|
-
"subagent-budget-guard-setup": "bin/setup.js",
|
|
39
|
-
"subagent-budget-guard-verify": "bin/verify.js"
|
|
35
|
+
"agent-guard": "bin/agent-guard.js"
|
|
40
36
|
},
|
|
41
37
|
"publishConfig": {
|
|
42
38
|
"access": "public"
|
package/skills/init/SKILL.md
CHANGED
|
@@ -35,7 +35,9 @@ node "${CLAUDE_PLUGIN_ROOT}/bin/agent-guard.js" init \
|
|
|
35
35
|
--config enforcement_enabled=<true-or-false>
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
Then tell the user to fully exit and reopen Claude Code, interact once so the statusLine bridge receives fresh session JSON
|
|
38
|
+
Then tell the user to fully exit and reopen Claude Code, then interact once so the statusLine bridge receives fresh session JSON.
|
|
39
|
+
|
|
40
|
+
For optional terminal verification, run:
|
|
39
41
|
|
|
40
42
|
```bash
|
|
41
43
|
node "${CLAUDE_PLUGIN_ROOT}/bin/agent-guard.js" doctor --live
|
package/skills/doctor/SKILL.md
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Verify Agent Guard installation and offline behavior.
|
|
3
|
-
disable-model-invocation: true
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Doctor Agent Guard
|
|
7
|
-
|
|
8
|
-
For default offline verification, run:
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
node "${CLAUDE_PLUGIN_ROOT}/bin/agent-guard.js" doctor --offline
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
For live local installation checks, run:
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
node "${CLAUDE_PLUGIN_ROOT}/bin/agent-guard.js" doctor --live
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
The live verifier does not submit Claude prompts. It checks local plugin shape, `claude plugin validate` when available, plugin listing shape, and statusLine bridge setup.
|
package/skills/report/SKILL.md
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Compatibility alias for /agent-guard:status.
|
|
3
|
-
disable-model-invocation: true
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Report Agent Guard Usage
|
|
7
|
-
|
|
8
|
-
Prefer `/agent-guard:status`.
|
|
9
|
-
|
|
10
|
-
Run this command:
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
node "${CLAUDE_PLUGIN_ROOT}/bin/agent-guard.js" status
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
If the user asks for machine-readable output, run:
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
node "${CLAUDE_PLUGIN_ROOT}/bin/agent-guard.js" status --json
|
|
20
|
-
```
|
package/skills/setup/SKILL.md
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Compatibility alias for /agent-guard:init.
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Setup Agent Guard
|
|
6
|
-
|
|
7
|
-
Prefer `/agent-guard:init`.
|
|
8
|
-
|
|
9
|
-
Ask the user whether to use the recommended defaults or customize the values. If they choose defaults, run:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
node "${CLAUDE_PLUGIN_ROOT}/bin/agent-guard.js" init --defaults
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
If they choose custom values, ask for each value below. The value in parentheses is the default; accept a blank answer as the default.
|
|
16
|
-
|
|
17
|
-
```text
|
|
18
|
-
max_concurrent_subagents=1
|
|
19
|
-
max_subagent_tokens_per_session=100000
|
|
20
|
-
subagent_token_warning_threshold_percent=95
|
|
21
|
-
session_five_hour_budget_percent=25
|
|
22
|
-
absolute_five_hour_ceiling_percent=95
|
|
23
|
-
enforcement_enabled=true
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Then run setup with the chosen values:
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
node "${CLAUDE_PLUGIN_ROOT}/bin/agent-guard.js" init \
|
|
30
|
-
--config max_concurrent_subagents=<value> \
|
|
31
|
-
--config max_subagent_tokens_per_session=<value> \
|
|
32
|
-
--config subagent_token_warning_threshold_percent=<value> \
|
|
33
|
-
--config session_five_hour_budget_percent=<value> \
|
|
34
|
-
--config absolute_five_hour_ceiling_percent=<value> \
|
|
35
|
-
--config enforcement_enabled=<true-or-false>
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Then tell the user to fully exit and reopen Claude Code, interact once so the statusLine bridge receives fresh session JSON, and run:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
node "${CLAUDE_PLUGIN_ROOT}/bin/agent-guard.js" doctor --live
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
The live verifier does not submit Claude prompts. It checks local plugin shape, Claude plugin validation when `claude` is on `PATH`, and whether the statusLine bridge is configured.
|
package/skills/status/SKILL.md
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Show the current Agent Guard report.
|
|
3
|
-
disable-model-invocation: true
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Status Agent Guard
|
|
7
|
-
|
|
8
|
-
Run:
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
node "${CLAUDE_PLUGIN_ROOT}/bin/agent-guard.js" status
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
If the user asks for machine-readable output, run:
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
node "${CLAUDE_PLUGIN_ROOT}/bin/agent-guard.js" status --json
|
|
18
|
-
```
|
package/skills/verify/SKILL.md
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Compatibility alias for /agent-guard:doctor.
|
|
3
|
-
disable-model-invocation: true
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Verify Agent Guard
|
|
7
|
-
|
|
8
|
-
Prefer `/agent-guard:doctor`.
|
|
9
|
-
|
|
10
|
-
For default offline verification, run:
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
node "${CLAUDE_PLUGIN_ROOT}/bin/agent-guard.js" doctor --offline
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
For live local installation checks, run:
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
node "${CLAUDE_PLUGIN_ROOT}/bin/agent-guard.js" doctor --live
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
The live verifier does not submit Claude prompts. It checks local plugin shape, `claude plugin validate` when available, plugin listing shape, and statusLine bridge setup.
|