claude-warden 1.8.3 → 2.0.1
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/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +2 -2
- package/README.md +47 -3
- package/config/warden.default.yaml +28 -1
- package/dist/codex-export.cjs +20234 -0
- package/dist/index.cjs +162 -10
- package/package.json +2 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
3
|
-
"version": "
|
|
2
|
+
"name": "warden",
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Smart command safety filter for Claude Code — parses shell pipelines and evaluates per-command safety rules to auto-approve safe commands and block dangerous ones",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "banyudu"
|
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ Two commands inside Claude Code:
|
|
|
48
48
|
|
|
49
49
|
```
|
|
50
50
|
/plugin marketplace add banyudu/claude-warden
|
|
51
|
-
/plugin install
|
|
51
|
+
/plugin install warden@claude-warden
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
That's it. Restart Claude Code and Warden is active.
|
|
@@ -68,6 +68,27 @@ cd claude-warden && npm install && npm run build
|
|
|
68
68
|
claude --plugin-dir ./claude-warden
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
+
## Codex CLI (experimental)
|
|
72
|
+
|
|
73
|
+
Codex currently uses `execpolicy` (`.rules` files) for command approvals. Warden can export your effective command-level decisions to a Codex rules file:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pnpm run build
|
|
77
|
+
pnpm run codex:export-rules
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
This writes `.codex/rules/warden.rules` in the current project by default.
|
|
81
|
+
|
|
82
|
+
- Use `--cwd <dir>` to choose which workspace config to load.
|
|
83
|
+
- Use `--out <path>` to choose an output path.
|
|
84
|
+
- Use `--stdout` to print the generated rules.
|
|
85
|
+
|
|
86
|
+
Example:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
node dist/codex-export.cjs --cwd . --out .codex/rules/warden.rules
|
|
90
|
+
```
|
|
91
|
+
|
|
71
92
|
## Configure
|
|
72
93
|
|
|
73
94
|
Warden works out of the box with sensible defaults. To customize, create a config file:
|
|
@@ -133,14 +154,37 @@ rules:
|
|
|
133
154
|
description: Read-only docker commands
|
|
134
155
|
```
|
|
135
156
|
|
|
136
|
-
##
|
|
157
|
+
## YOLO mode
|
|
158
|
+
|
|
159
|
+
Need to temporarily bypass all permission prompts? YOLO mode auto-allows all commands for a limited time or the full session — while still blocking always-deny commands (like `sudo`, `shutdown`) for safety.
|
|
160
|
+
|
|
161
|
+
### Activate via slash command
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
/warden:yolo session # Full session, no expiry
|
|
165
|
+
/warden:yolo 5m # 5 minutes
|
|
166
|
+
/warden:yolo 15m # 15 minutes
|
|
167
|
+
/warden:yolo off # Turn off immediately
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Running `/warden:yolo` with no arguments shows a menu of duration options.
|
|
171
|
+
|
|
172
|
+
### How it works
|
|
173
|
+
|
|
174
|
+
YOLO mode is **session-scoped** — it only affects the current Claude Code session. The hook intercepts special activation commands and stores state in a temp file keyed by session ID. When a command is evaluated during YOLO mode, the hook skips normal rule evaluation and auto-allows (except always-deny commands). Expired YOLO states are cleaned up automatically.
|
|
175
|
+
|
|
176
|
+
### Discovery
|
|
177
|
+
|
|
178
|
+
When Warden prompts you for permission (`ask` decision), the system message includes a tip about YOLO mode so you can discover it when you need it most.
|
|
179
|
+
|
|
180
|
+
## Feedback and `/warden:allow`
|
|
137
181
|
|
|
138
182
|
When Warden blocks or flags a command, it includes a system message explaining:
|
|
139
183
|
|
|
140
184
|
1. **Why** the command was blocked/flagged (per-command reasons)
|
|
141
185
|
2. **How to allow it** — a ready-to-use YAML snippet for your config
|
|
142
186
|
|
|
143
|
-
Use the `/
|
|
187
|
+
Use the `/warden:allow` slash command to apply the suggested config change. It will ask which scope (project or user) to use.
|
|
144
188
|
|
|
145
189
|
## Built-in defaults
|
|
146
190
|
|
|
@@ -86,9 +86,36 @@ notifyOnDeny: true
|
|
|
86
86
|
|
|
87
87
|
# Command-specific rules (override built-in rules by command name).
|
|
88
88
|
# The first scope (project > user > default) with a rule for a given command wins.
|
|
89
|
+
#
|
|
90
|
+
# IMPORTANT: Rules are matched by the command being executed, not by arguments.
|
|
91
|
+
# For example, when Claude runs `python -c "import foo"`, warden looks up rules
|
|
92
|
+
# for command: "python" — NOT "bash" or "sh". A common mistake is writing rules
|
|
93
|
+
# for "bash" with argPatterns matching "python"; this won't work because warden
|
|
94
|
+
# sees the command as "python".
|
|
95
|
+
#
|
|
89
96
|
# rules:
|
|
97
|
+
# # Allow all python commands
|
|
98
|
+
# - command: python
|
|
99
|
+
# default: allow
|
|
100
|
+
#
|
|
101
|
+
# # Allow python -c but ask for other python usage
|
|
102
|
+
# - command: python
|
|
103
|
+
# default: ask
|
|
104
|
+
# argPatterns:
|
|
105
|
+
# - match:
|
|
106
|
+
# anyArgMatches: ['^-c$']
|
|
107
|
+
# decision: allow
|
|
108
|
+
# description: Allow python -c inline scripts
|
|
109
|
+
#
|
|
110
|
+
# # Allow all node.js execution
|
|
111
|
+
# - command: node
|
|
112
|
+
# default: allow
|
|
113
|
+
#
|
|
114
|
+
# # Trust all npx in this project
|
|
90
115
|
# - command: npx
|
|
91
|
-
# default: allow
|
|
116
|
+
# default: allow
|
|
117
|
+
#
|
|
118
|
+
# # Docker with selective allow
|
|
92
119
|
# - command: docker
|
|
93
120
|
# default: ask
|
|
94
121
|
# argPatterns:
|