Skip to main content

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

CODING & MCP Deep Dive
gstack repository cover showing evidence-carrying PRs and destructive-command guard for Claude Code
gstack repository cover showing evidence-carrying PRs and destructive-command guard for Claude Code Source: github.com
Field Note · The Short Version 4 min read

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

LayerMechanismLatency ImpactAccuracy Risk
Destructive command guardPre-execution bash interceptionMilliseconds per blocked commandLow; pattern matching is deterministic
Directory-scoped editsFilesystem write boundaryNegligibleLow; scoped to target directory
Evidence-carrying PRQA artifacts and review traces in PRMinutes to hours for review cycleMedium; depends on agent trace completeness
Full safety modeCombined command warnings and file freezeSession startup overheadLow; 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

Bash1 line
npx skillfish add johnadonis/claude-code-skills gstack-guard
JSON12 lines
{
  "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.

gstack evidence-carrying PR and destructive-command guard architecture
gstack evidence-carrying PR and destructive-command guard architecture

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?
The guard intercepts high-risk terminal commands such as rm -rf, DROP TABLE, and git force-push before execution, preventing destructive operations against production databases and critical codebases.
Where is the gstack skill documentation located?
The skill deep dives, review modes, and plan-to-QA flow documentation live at gstack/docs/skills.md in the garrytan/gstack repository.
Does gstack replace IAM or network segmentation?
No. The guard intercepts commands issued by Claude Code but does not protect against credentials exfiltration, side-channel data access, or compromise of the agent host itself.

Bibliography & Verification

Primary Sources & References

3 cited sources
  1. [01] github.com garrytan / gstack
  2. [02] github.com main / docs / skills.md
  3. [03] mcpmarket.com tools / skills / gstack-guard

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.

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.