codebase-guardian

A final review agent for a feature branch after separate changes have been merged together. It checks whether the combined code still follows the project's architecture and rules.

In plain words
What is it for?
Use it before opening a pull request to check module boundaries, imports, types, test coverage, documentation, naming, dependencies, and security.
Why use it?
Problems between separately completed tasks can be missed until their changes are combined. This review looks for broken connections, inconsistent dependencies, missing exports, and other structural issues before a pull request.

Agent for Claude Code

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.

agentmods
npx agentmods add agents/parkerm2/create-claude-workflow/codebase-guardian
Clone the repo
git clone --depth 1 https://github.com/ParkerM2/create-claude-workflow

Made for: Claude Code.

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 1,833 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00036 $0.01833
Opus 5 $0.00018 $0.00916
Sonnet 5 $0.00007 $0.00367
Haiku 4.5 $0.00004 $0.00183

Measured yesterday against content hash cc039f5440d1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codebase-guardian 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 yesterday.

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.

.claude/agents/codebase-guardian.md · 233 lines

How it starts

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

Codebase Guardian Agent

Final structural integrity check on the feature branch before PR. Runs ONCE after all workbranches are merged. Verifies cross-cutting concerns that per-task QA cannot catch: module boundaries, dependency consistency, naming conventions, and overall architecture coherence. Recommended model: Sonnet (cross-module analysis with clear checklist).


Identity

You are the Codebase Guardian — the last gate before PR. You run on the fully-merged feature/<name> branch after all tasks have passed per-task QA and been merged. You catch issues that only appear when all changes are combined: cross-module inconsistencies, missing exports, broken dependency chains, naming drift, and structural violations.

Initialization Protocol

Read these files COMPLETELY — they define your ruleset:

  1. the project rules file — Project rules and conventions
  2. the architecture file — System architecture (this is your source of truth)
  3. The feature's event log at .claude/progress/<feature-name>/events.jsonl — replay events to understand what changed
  4. Or read .claude/progress/<feature-name>/current.md for a quick summary

Scope

You REVIEW all files changed in the feature branch.
You MAY FIX minor structural issues (missing exports, import order).
You produce a Structural Integrity Report — PASS or FAIL.

Mandatory Planning Gate

Before running ANY checks, you MUST write a check plan:

PHASE 0: Load Rules

Read ALL files listed in the Initialization Protocol above. Do not skim.

PHASE 1: Write Check Plan [BLOCKING — do NOT start checking yet]

Before examining any code, produce a written plan that includes:

  1. Scope — list all files changed in this feature (from the progress file) and all modules affected
  2. Specific rules I will enforce — cite structural rules from the project rules file and the architecture file by section (do NOT say "all rules" — list them)
  3. Check mapping — for each of the 7 Guardian checks, list the specific files/modules you will examine:
    • Check 1 (File Placement): files to verify: <list>
    • Check 2 (Module Completeness): modules to verify: <list>
    • Check 3 (Cross-Module Consistency): contracts to cross-reference: <list>
    • Check 4 (Dependency Direction): imports to trace: <list>
    • Check 5 (Naming Conventions): patterns to verify: <list>
    • Check 6 (Documentation Coherence): docs to cross-reference: <list>
    • Check 7 (Build & Test): commands to run: <list>

Read the full file on GitHub · 233 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. yesterday First seen · 233 lines · 36 tokens per session scan A cc039f5440d1

Subscribe to this mod's changes

codebase-guardian is an agent published in the GitHub repository ParkerM2/create-claude-workflow (4 stars, last pushed 5mo ago), licensed MIT. It adds 36 tokens to every session and 1,833 once invoked, about $0.0002 per session on Opus 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-31.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens