Labsco
klitchevo logo

Code Council

โ˜… 9

from klitchevo

Your AI Code Review Council - Get diverse perspectives from multiple AI models in parallel.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredNeeds API keys

Code Council

One AI can miss things. A council of AIs catches more.

View Documentation | npm

Code Council runs your code through multiple AI models simultaneously, then shows you where they agree, where they disagree, and what only one model caught.

Code Council

Example Output


## Consensus Analysis

### Unanimous (All 4 models agree) - High Confidence

**Critical: SQL Injection Vulnerability**
Location: src/api/users.ts:42

The user input is directly interpolated into the SQL query without sanitization.
Use parameterized queries instead.

---

### Majority (3 of 4 models) - Moderate Confidence

**High: Missing Input Validation**
Location: src/api/users.ts:38

The userId parameter is used without validation. Add type checking.

---

### Disagreement - Your Judgment Needed

**Session Token Expiration**
Location: src/api/auth.ts:28

- Kimi K2.5: "Tokens should expire after 24 hours"
- DeepSeek V3.2: "Current 7-day expiration is reasonable for this use case"
- Minimax M2.1: "No issue found"

---

### Single Model Finding - Worth Checking

**Low: Magic Number**
Location: src/utils/pagination.ts:12
Found by: GLM 4.7

The value 20 should be extracted to a named constant.

Why Multiple Models?

Different AI models have different strengths:

  • One model might miss a security issue another catches
  • Unanimous findings are almost certainly real problems
  • Disagreements highlight where you should look closer
  • Single-model findings might be noise, or might be the one model that saw something others missed

Think of it as getting 4 senior engineers to review your code at once.

How Consensus Works

GitHub Actions

Automatically review PRs with multiple AI models. Findings appear as inline comments on the exact lines of code. Code fixes use GitHub's suggestion syntax for one-click apply. Re-runs automatically clean up old comments.

Quick Setup

Generate the workflow file automatically:

npx @klitchevo/code-council setup workflow

This creates .github/workflows/code-council-review.yml with inline PR comments enabled.

Options:

  • --simple - Use markdown format instead of inline comments
  • --force - Overwrite existing workflow file

Manual Setup

Or create the workflow manually:

name: Code Council Review

on:
  pull_request:
    types: [opened, synchronize, ready_for_review, reopened]

jobs:
  review:
    runs-on: ubuntu-latest
    if: github.event.pull_request.draft == false
    permissions:
      contents: read
      pull-requests: write

    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Run Code Council Review
        env:
          OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
        run: |
          npx @klitchevo/code-council review git \
            --review-type diff \
            --format pr-comments \
            > review.json

      - name: Post Review
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews \
            --method POST \
            --input review.json

Add OPENROUTER_API_KEY to your repository secrets (Settings > Secrets > Actions).

Use Cases

ScenarioToolWhat You Get
About to merge a PRreview_git_changesMulti-model review of your diff
Automated PR reviewsCLI review gitMulti-model review in GitHub Actions
Planning a refactorreview_planCatch design issues before coding
Reviewing React componentsreview_frontendAccessibility + performance + UX focus
Securing an API endpointreview_backendSecurity + architecture analysis
Want deeper discussiondiscuss_with_councilMulti-turn conversation with context
Audit entire codebasetps_auditFlow, waste, bottlenecks analysis

Full tool reference: See Tools Reference for all parameters and examples.

Reading the Results

Code Council shows confidence levels for each finding:

LevelMeaningAction
UnanimousAll models agreeHigh confidence - fix this
MajorityMost models agreeLikely valid - investigate
DisagreementModels conflictYour judgment needed
SingleOne model found thisWorth checking

Cost

Default models are chosen for cost-effectiveness (~$0.01-0.05 per review).

Swap in Claude/GPT-4 for higher quality at higher cost (~$0.10-0.30 per review).

See Model Selection Guide for pricing details and optimization tips.