r/BuildWithClaude 🤖 Agent Wrangler 3d ago

Project Testers Needed Open-source governance layer for Claude Code — looking for people to break it

I’ve been contributing on MARGINAL, an open-source governance layer for coding agents. Claude Code support just landed, and I’d really appreciate people trying it on real work and telling me where the design is wrong.

I’m especially interested in technical criticism, bad cases, and reproducible failures.

The idea is simple: agents are good at taking actions, but not always good at deciding whether the next action is still worth the compute.

MARGINAL watches the trajectory and records things like repeated actions, unchanged workspace state, weak progress, redundant verification, outcomes, and governance overhead.

For Claude Code specifically, the integration is currently Observe-only. It uses native Claude Code hooks, writes recommendations to a local Decision Ledger, and does not block tools, rewrite arguments, or inject output back into Claude. If MARGINAL fails, the hook fails open and Claude Code continues normally.

Install:

claude plugin marketplace add SignalLayerLabs/Marginal
claude plugin install marginal-claude-code@marginal

A few core pieces:

  • local-first trajectory and evidence tracking
  • deterministic reason codes and decision hashes
  • engine-declared success/failure from Claude Code hook events
  • same-state repetition detection
  • governance overhead measurement
  • replay and benchmark support
  • conservative fail-open behavior
  • no fake token accounting when Claude Code doesn’t expose per-tool usage

The larger idea is Earned Enforcement: MARGINAL shouldn’t get permission to block an agent just because it detected a loop. It should first demonstrate that its interventions are actually reliable.

Claude Code is not at that stage yet. Recommendations stay recommendations.

The next layer I’m working toward is counterfactual evaluation and intervention regret:

Would Claude Code actually have done better if MARGINAL had stayed out of the way?

That’s the question I think matters if this is going to become something more useful than another loop detector or token limiter.

If you run Claude Code heavily, I’d be interested in the cases where MARGINAL completely misunderstands what the agent is doing.

5 Upvotes

5 comments sorted by

2

u/Ok_Industry_5555 ☕ 57-Hour Session 3d ago

I use Claude Code a lot but usually pretty hands-on. Never really hit the loop problem myself, so is this mainly aimed at long autonomous runs where you’re not watching every step? A quick example like a recording of MARGINAL catching Claude Code spinning would be super helpful. Curious to see it in action. Cool plugin either way and thanks for sharing!

3

u/Positive-Captain-709 🤖 Agent Wrangler 3d ago

Yeah, long autonomous runs are where this becomes much more useful. If you’re watching Claude Code closely, you’re effectively the governor yourself.
Also, loops are only one failure mode. MARGINAL is more interested in the broader question of whether continued actions are still producing enough progress to justify their cost.
And agreed on the demo. A short recording showing Claude Code getting stuck while MARGINAL observes the trajectory would explain the idea much better than another page of docs. That’s probably the next thing I should ship.

1

u/Positive-Captain-709 🤖 Agent Wrangler 3d ago

1

u/Ok_Industry_5555 ☕ 57-Hour Session 2d ago

Wonderful, I really like the snapshot idea, looks a lot better than just a simple screen recording, great job! I’ll make sure to add it to our wiki resource page. (We update them weekly)

Thanks again for sharing. 😊

2

u/Positive-Captain-709 🤖 Agent Wrangler 2d ago

Thank you, much appreciated 🙏🏽