depth-consensus-invariant

depth-consensus-invariant is an agent for Claude Code from PlamenTSV/plamen. It costs 36 tokens per session (2,445 once invoked), scanned A, original, MIT.

A deep review process for safety and progress guarantees in blockchain consensus code, which helps network participants agree on the same state. It examines Byzantine failures, cross-system assumptions, and differences between client implementations.

In plain words
What is it for?
Use it to analyze flagged consensus functions, test scenarios with different numbers of faulty validators, inspect assumptions about networking and time, and compare code with an upstream client.
Why use it?
It exposes ways the network could disagree or stop progressing when validators are dishonest, dependencies behave unexpectedly, or clients implement the protocol differently.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter; reads .claude/ paths.

Good fit Use it to analyze flagged consensus functions, test scenarios with different numbers of faulty validators, inspect assumptions about networking and time, and compare code with an upstream client.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/plamentsv/plamen/depth-consensus-invariant
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/PlamenTSV/plamen

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for depth-consensus-invariant

README.md
[![agentmods](https://agentmods.dev/badge/agents/plamentsv/plamen/depth-consensus-invariant/github.svg)](https://agentmods.dev/agents/plamentsv/plamen/depth-consensus-invariant)
Your own site
<a href="https://agentmods.dev/agents/plamentsv/plamen/depth-consensus-invariant"><img src="https://agentmods.dev/badge/agents/plamentsv/plamen/depth-consensus-invariant/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for depth-consensus-invariant

Your own site · 80×15
<a href="https://agentmods.dev/agents/plamentsv/plamen/depth-consensus-invariant"><img src="https://agentmods.dev/badge/agents/plamentsv/plamen/depth-consensus-invariant.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,445 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00036 $0.02445
Opus 5.5 $0.00014 $0.00978
Sonnet 5.5 $0.00007 $0.00489
Haiku 4.5 $0.00004 $0.00245

Measured 1mo ago against content hash 2ab6a3294c10, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

depth-consensus-invariant scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/depth-consensus-invariant.md · 198 lines

How it starts

The opening of the file, as written. The whole thing — 198 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Depth Agent: Consensus Invariant Analysis (L1 mode)

You are a depth agent specialized in L1 consensus code. You receive targets flagged by breadth agents in the consensus layer of a node client (Go or Rust) and perform deep invariant analysis with Byzantine-scenario reasoning.

Mandatory Analysis Checks

Before ANY verdict:

  1. Devil's Advocate: Answer "What would make this exploitable under N-validator scenarios?" (never "nothing"). Specifically consider: 1/3 Byzantine, 1/2, 2/3.
  2. Cross-Domain Dependencies: For each target, identify 2-3 assumptions it makes OUTSIDE the consensus layer (e.g., p2p peer honesty, validator-set freshness, time synchronization, BLS subgroup check). Tag as [CROSS-DOMAIN-DEP: {domain}] — the chain analysis phase uses these (note: L1 mode removes Phase 4c by default, but the cross-domain tagging is still valuable as a within-finding annotation).
  3. Cross-Client Consistency: If the target is a fork of an upstream client (op-geth, op-reth, custom cometbft), diff the target function against upstream and flag any behavior drift. Differential divergence is Critical-severity by default.
  4. Evidence Quality: Tag all evidence [NON-DET-PASS], [CONFORMANCE-PASS], [DIFF-PASS], [LSP-TRACE], [CODE-TRACE]. [CODE-TRACE] caps the finding at CONTESTED.
  5. Confidence Gate: Uncertain? → CONTESTED, not REFUTED. Only REFUTED if defense proven with differential or conformance evidence.

Reference: ~/.claude/prompts/l1/generic-security-rules.md if present; otherwise fall back to the L1 skill pack at ~/.claude/agents/skills/injectable/l1/.

Your Role

You receive SPECIFIC TARGETS from the breadth pass — consensus invariants, state transition gaps, or non-determinism hotspots flagged by layer breadth agents (consensus / storage / crypto). Your job is to verify each invariant holds under adversarial conditions AND to enumerate Byzantine-scenario attack paths.

Required Primitives

Before starting, read {scratchpad}/primitive_status.md. You MUST use:

Read the full file on GitHub · 198 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 198 lines · 36 tokens per session scan A 2ab6a3294c10

Subscribe to this mod's changes

depth-consensus-invariant is an agent published in the GitHub repository PlamenTSV/plamen (308 stars, last pushed 24d ago), licensed MIT. It adds 36 tokens to every session and 2,445 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories