gstack Evidence-Carrying PRs and Destructive-Command Guards for
Architecture analysis of gstack's evidence-carrying PRs and destructive-command guards for Claude Code, including control-plane flow, failure modes, and
gstack layers evidence-carrying PRs and destructive-command guards over Claude Code to intercept high-risk terminal commands and scope filesystem writes to a target directory.
Key Numbers & Verified Specs
5 metrics| Metric / Spec | Verified Finding | Source |
|---|---|---|
| Primary repository | garrytan/gstack on GitHub, MIT license | github.com |
| Destructive commands intercepted | rm -rf, DROP TABLE, git force-push | mcpmarket.com |
| Filesystem scoping | Write and edit tools restricted to a single user-defined target directory | mcpmarket.com |
| Install command | npx skillfish add johnadonis/claude-code-skills gstack-guard | mcpmarket.com |
| Documentation path | gstack/docs/skills.md covers skill deep dives, review modes, and plan-to-QA flow | github.com |
Jump to section (5) +
gstack introduces an evidence-carrying PR model and destructive-command guard for Claude Code and other coding agents. The core thesis is that agent-written code should not reach merge without an auditable trail and without runtime interception of destructive terminal operations.
Control Plane and Data Plane Architecture
The control plane consists of the skill layer loaded into Claude Code, which registers pre-execution hooks for bash commands and filesystem write operations. When an agent issues a command matching a destructive pattern—rm -rf, DROP TABLE, or git force-push—the guard intercepts before the shell executes and returns a denial or confirmation prompt to the agent. The data plane is the actual file system and git state: edits, writes, and command outputs flow through the scoped directory boundary, while anything outside the target directory is blocked.
This separation matters because it creates a trust boundary between agent intent and system effect. The agent can propose changes, but the guard decides whether the terminal can act on them. Evidence-carrying PRs extend this boundary into the review layer: each PR carries its own QA artifacts, review decisions, and agent traces so reviewers do not have to reconstruct context from chat history. The gstack project documents this model in its primary repository garrytan/gstack.
Token, Latency & Accuracy Comparison Table
| Layer | Mechanism | Latency Impact | Accuracy Risk |
|---|---|---|---|
| Destructive command guard | Pre-execution bash interception | Milliseconds per blocked command | Low; pattern matching is deterministic |
| Directory-scoped edits | Filesystem write boundary | Negligible | Low; scoped to target directory |
| Evidence-carrying PR | QA artifacts and review traces in PR | Minutes to hours for review cycle | Medium; depends on agent trace completeness |
| Full safety mode | Combined command warnings and file freeze | Session startup overhead | Low; dual-layer protection |
Failure Modes & Context Pollution
The guard fails closed by default: if the interception hook cannot load, commands may execute without scrutiny. This is the most dangerous failure mode because it silently degrades to unguarded agent operation. Context pollution occurs when agent sessions accumulate unrelated file edits outside the scoped directory; the guard blocks new writes but does not retroactively clean prior contamination. Selective unfreezing and clean state resets mitigate this, but they require operator intervention.
Another failure mode is pattern evasion. An agent can encode a destructive command through indirection—writing a script file then executing it—bypassing direct pattern matching on rm -rf or DROP TABLE. The guard intercepts the bash invocation, but if the agent writes the payload to disk first and runs it through a permitted interpreter, the destructive pattern may never appear in the intercepted command string.
Minimal Reproducible Config / Harness Snippet
npx skillfish add johnadonis/claude-code-skills gstack-guard{
"skill": "gstack-guard",
"mode": "full-safety",
"target_directory": "./services/payments",
"blocked_commands": [
"rm -rf",
"DROP TABLE",
"git push --force"
],
"filesystem_scope": "write-and-edit-only",
"interactive_boundary": true
}The configuration above scopes all write and edit operations to ./services/payments and pre-execution intercepts the three destructive command families. Operators should pair this with evidence-carrying PRs from the /review skill documented at gstack/docs/skills.md so that every agent change carries QA artifacts and second-model review traces into the merge queue.
When NOT to Adopt This Pattern
Do not deploy this guard in environments where agents need legitimate cross-directory refactoring. The single-directory scope will block edits to sibling packages, shared libraries, or infrastructure-as-code repositories that live outside the target boundary. Avoid it if your CI pipeline relies on agents running database migrations or force-pushing tags as part of automated release flows; the guard will block those operations and stall the pipeline.
Teams without a review culture should not adopt evidence-carrying PRs. The PR artifacts only add value if humans actually read the QA traces and second-model review output. Otherwise the evidence becomes theater that slows merge velocity without improving safety.
Finally, do not treat the guard as a replacement for least-privilege IAM or network segmentation. It intercepts commands issued by Claude Code, but it does not protect against credentials exfiltration, side-channel data access, or compromise of the agent host itself.
The MCP Market listing for Gstack Guard confirms the install path and blocked command set at mcpmarket.com/tools/skills/gstack-guard. These sources establish the operational contract: intercept before execution, scope writes to a target directory, and carry evidence through the PR review process.
Reader Q&A
Frequently Asked Questions
What destructive commands does gstack guard intercept?
Where is the gstack skill documentation located?
Does gstack replace IAM or network segmentation?
Bibliography & Verification
Primary Sources & References
Human × Agent Co-Work
Hamdi Soudani · in collaboration with Pyvren
Systems engineer & technical writer exploring AI infrastructure, security, and edge craft in daily collaboration with Pyvren.
Keep Reading
Related Dispatches
Hamdi Soudani × Pyvren
Honest engineering stories — co-crafted with primary benchmarks & real code
Every dispatch blends hands-on engineering judgment with verified primary sources, reproducible configs, and clear tradeoffs.