# How to Integrate the Code-Reviewer Agent into a Claude Code Development Workflow

> Learn to integrate the automatic code-reviewer agent into your Claude Code workflow. Enhance security and quality by blocking critical changes before commits.

- Repository: [Affaan Mustafa/everything-claude-code](https://github.com/affaan-m/everything-claude-code)
- Tags: how-to-guide
- Published: 2026-03-20

---

**The code-reviewer agent in the everything-claude-code (ECC) ecosystem automatically inspects every file change for security flaws and quality defects, blocking commits that contain CRITICAL or HIGH severity issues until they are resolved.**

The `everything-claude-code` repository by `affaan-m` provides a framework for automating software development tasks within Claude Code. Learning how to integrate the code-reviewer agent into a development workflow with Claude Code ensures that every modification is validated against security and quality standards before it reaches the codebase.

## Architecture of the Code-Reviewer Agent

### Agent Definition and Tools

The behavior of the code-reviewer is defined in [`agents/code-reviewer.md`](https://github.com/affaan-m/everything-claude-code/blob/main/agents/code-reviewer.md). This file specifies the four core tools the agent employs: **Read**, **Grep**, **Glob**, and **Bash**. These tools enable the agent to inspect file contents, search for patterns across the codebase, and execute shell commands to gather context for its analysis.

### Automatic Triggering via Hooks

ECC implements an agent orchestration system described in [`AGENTS.md`](https://github.com/affaan-m/everything-claude-code/blob/main/AGENTS.md). The hook system automatically invokes the code-reviewer agent immediately following any file write or edit operation. This automatic triggering ensures that developers receive instant feedback without needing to remember to initiate a review manually.

## How the Review Process Works

### Diff Analysis and Checklist Evaluation

When activated, the code-reviewer executes `git diff --staged` (or `git diff` if nothing is staged) to collect the full set of changes. The agent parses this diff and applies a comprehensive checklist that includes:

- Scanning for hardcoded secrets and API keys
- Detecting SQL injection patterns
- Identifying overly large functions
- Flagging missing error handling

The specific logic for these checks is documented in the review checklist section of [`agents/code-reviewer.md`](https://github.com/affaan-m/everything-claude-code/blob/main/agents/code-reviewer.md).

### Severity-Based Blocking Logic

The [`commands/code-review.md`](https://github.com/affaan-m/everything-claude-code/blob/main/commands/code-review.md) file implements the decision logic that governs whether a commit may proceed. If the agent detects any **CRITICAL** or **HIGH** severity issues, the commit is automatically blocked. The developer must resolve these issues and re-run the review before the Claude Code toolchain allows the `git commit` operation to proceed.

## Integrating the Code-Reviewer into Your Workflow

### Manual Invocation with Slash Commands

Developers can trigger the code-reviewer on demand using the `/code-review` slash command within Claude Code. This command executes the review logic defined in [`commands/code-review.md`](https://github.com/affaan-m/everything-claude-code/blob/main/commands/code-review.md) and returns a formatted report grouped by severity, including file paths, line numbers, and suggested fixes.

Example output:

```text
[CRITICAL] Hardcoded API key in source
File: src/api/client.ts:42
Issue: API key "sk-abc…" exposed in code.
Fix: Move to environment variable and update .gitignore

```

### Automatic Review After File Edits

The most seamless integration relies on ECC's hook system. When you edit a file such as [`src/utils/formatDate.ts`](https://github.com/affaan-m/everything-claude-code/blob/main/src/utils/formatDate.ts), the system automatically:

1. Detects the file change
2. Invokes the code-reviewer agent
3. Returns feedback directly in the Claude Code chat window

If the agent reports a **HIGH** severity issue, such as a function exceeding 50 lines, you can refactor the code immediately. Upon saving, the agent re-evaluates the changes and clears the block once the issue is resolved.

### Orchestrated Multi-Agent Pipelines

For complex features, integrate the code-reviewer into a multi-agent pipeline using the `/orchestrate` command defined in [`commands/orchestrate.md`](https://github.com/affaan-m/everything-claude-code/blob/main/commands/orchestrate.md). This enables sequential or parallel execution of multiple ECC agents.

Example workflow:

```text
/orchestrate
  - planner
  - tdd-guide
  - code-reviewer
  - security-reviewer

```

In this pipeline, the code-reviewer acts as a quality gate between implementation and deep security analysis, ensuring that basic defects are eliminated before expensive security scans run.

### Customizing the Review Checklist

Advanced teams can extend the code-reviewer's capabilities by modifying [`agents/code-reviewer.md`](https://github.com/affaan-m/everything-claude-code/blob/main/agents/code-reviewer.md). The checklist section supports custom rules, such as prohibiting specific function calls or enforcing internal naming conventions.

After editing the agent definition, commit the changes to your repository. The updated rules automatically apply to all subsequent reviews, allowing the code-reviewer to evolve alongside your project's standards.

## Summary

Integrating the code-reviewer agent into a Claude Code development workflow provides automated, immediate feedback on every code change. Key takeaways include:

- The agent is defined in [`agents/code-reviewer.md`](https://github.com/affaan-m/everything-claude-code/blob/main/agents/code-reviewer.md) and triggered automatically via ECC's hook system after every file edit.
- Reviews analyze `git diff` output against a security and quality checklist, blocking commits that contain **CRITICAL** or **HIGH** severity issues.
- Developers can manually invoke reviews with `/code-review`, automate them via hooks, or orchestrate them in multi-agent pipelines with `/orchestrate`.
- The review checklist in [`agents/code-reviewer.md`](https://github.com/affaan-m/everything-claude-code/blob/main/agents/code-reviewer.md) is fully customizable to enforce project-specific standards.

## Frequently Asked Questions

### What triggers the code-reviewer agent automatically?

The ECC hook system monitors file write and edit operations within Claude Code. After any file modification, the system automatically invokes the code-reviewer agent as described in [`AGENTS.md`](https://github.com/affaan-m/everything-claude-code/blob/main/AGENTS.md), ensuring immediate feedback without manual commands.

### How does the code-reviewer block commits with critical issues?

The [`commands/code-review.md`](https://github.com/affaan-m/everything-claude-code/blob/main/commands/code-review.md) file implements a gating policy that examines the agent's output. If the review report contains any findings marked as **CRITICAL** or **HIGH** severity, the command returns a failure status that prevents the Claude Code toolchain from completing the `git commit` operation.

### Can I run the code-reviewer alongside other ECC agents?

Yes. Use the `/orchestrate` command defined in [`commands/orchestrate.md`](https://github.com/affaan-m/everything-claude-code/blob/main/commands/orchestrate.md) to chain agents sequentially or run them in parallel. A typical integration runs the *planner*, *tdd-guide*, *code-reviewer*, and *security-reviewer* in sequence to create a comprehensive development pipeline.

### Where can I customize the review rules for my project?

The review checklist and agent behavior are defined in [`agents/code-reviewer.md`](https://github.com/affaan-m/everything-claude-code/blob/main/agents/code-reviewer.md). You can edit this file to add project-specific rules, such as banning specific imports or enforcing naming conventions. Once committed, these changes automatically apply to all future reviews in the repository.