Claude Code Plugin

TangleGuard for Claude Code

A plugin that keeps your AI agent inside your architecture. Its skills tell the agent when and how to ask the native Rust CLI about layers, packages, dependencies, and rule violations instead of grepping files and guessing. Its guardrail hook checks every change when the agent finishes and sends new violations back before they reach you.

Lower token usage
Deterministic & fast
Runs locally

When the agent reaches for it

Before adding a dependency

Check whether a new dependency between modules is allowed — and whether it would create a cycle — before wiring it up.

Before a structural change

Moving code between layers, splitting or merging packages, renaming modules — see the real structure first.

For architectural decisions

Consult the actual layers, allowed dependency rules, and package graph before committing to a design.

To orient in a new codebase

Get the big picture in a single call instead of reading dozens of files to infer how things fit together.

Install

Run these inside Claude Code:

/plugin marketplace add TangleGuard/claude-code-plugin
/plugin install tangleguard@tangleguard

Requires the TangleGuard CLI. The installation guide covers it, the Claude desktop app, and other agents.

What's inside

Four skills and a guardrail hook, all powered by the TangleGuard CLI. Output is markdown — ready to drop straight into the agent's reasoning — with --format json available for structured parsing. The full instructions live on GitHub.

architecture — know the structure, don't guess it

The big picture in one call: layers, packages with LOC, and the dependency graph. Before touching a specific block, context delivers its full briefing — layer, applicable rules, actual incoming/outgoing edges, and the blast radius of everything that transitively depends on it. explain-dependency shows the exact imports (file:line) behind any arrow.

validate — check before and after the change

Preflight every import before it is written: check-import returns one ALLOWED/DENIED verdict combining the dependency-rule check and the cycle check, so violations never enter the codebase. After the change, validate confirms the architecture is still clean, with file:line evidence for anything that broke.

untangle — break cycles with evidence

A guided refactor for circular dependencies: TangleGuard ranks the fewest edges to cut, inlines the import statements behind each cut, and the agent works through them — preflighting every new import so the fix doesn't create the next violation.

assign-layers — migrate toward a target architecture

Pick a target architecture (layered, hexagonal, clean, or your own) and the agent assigns every component to the layer where it belongs by role — the resulting violations become your migration backlog: each one a concrete file:line refactoring site on the way to the architecture you chose. You confirm the assignment before anything is written, and refine it visually in the desktop app.

guardrail hook — nothing slips through when the agent finishes

Skills only work when the agent remembers to use them; the hook doesn't need it to. When the agent finishes a task, the plugin runs validate --since HEAD and hands every rule violation or cycle the change introduced back to the agent, with file:line evidence, so it fixes them before you see the result. Pre-existing issues stay quiet, and a clean change produces no output. How it works

The skills are just instructions and the hook is a small shell script — all analysis is done by the native Rust CLI, locally, and your code never leaves your machine. Prefer real-time, in-editor context? Try the MCP server instead.

Native Rust scanner
Runs locally
GitHub

Keep your agent inside your architecture

Set up the CLI and the plugin in a couple of minutes — from the Claude Code terminal, the Claude desktop app, or any agent that reads Agent Skills.

Installation guide