code-council
Multi-agent code review. Several LLM reviewers read your code, each from its own angle, and a judge merges what they found into one prioritised report. It has two modes:
- Review: paste code (a function, a file, several files) and get improvement suggestions based on established best practices.
- Compare: paste an old and a new version and find out what got better, what got worse, and what new problems the change introduced.
It runs as a CLI or a local web UI. It only gives suggestions and never changes your code.
Sibling project: spec-council does the same for specifications. code-council is for code only.
flowchart LR
A[Code<br/>or old + new version] --> R1[Correctness]
A --> R2[Security]
A --> R3[Maintainability]
A --> R4[Performance]
R1 & R2 & R3 & R4 --> J[Judge<br/>merges, de-duplicates, ranks]
J --> V[Fact-check<br/>flags questionable suggestions]
V --> O[Report<br/>fix first · disagreements · nice to have]
Why several reviewers
One model asked to "review this code" tends to give a generic, evenly weighted list. Reviewers with narrow roles go deeper in their own area, and they sometimes disagree, for example security against simplicity or performance against readability. The judge shows those conflicts openly instead of hiding them in an average. You can also mix providers, so one model's blind spots get caught by another.
Features
- Configurable reviewers. Each one is defined in TOML: name, role in plain words, provider and model. Add, remove or rewrite roles freely.
- Several providers. Anthropic, OpenAI, Gemini and local models through Ollama, mixed in one council, called over plain HTTP. No SDKs and no runtime dependencies.
- Structured findings. Every finding has a severity, a location (line or symbol), the issue, a suggestion and an optional fix snippet. Findings are sorted by severity.
- Fact-check pass. An optional AI verifier flags questionable findings without deleting the original suggestions. It can be wrong; human review is required.
- Diff mode. Findings are labelled
improved,regressed,neworunchanged, and the run ends with a verdict: better, worse, mixed or same. - Parallel reviewers. Reviewers run concurrently up to the configured parallelism limit.
- Fault tolerant. If one reviewer fails (bad key, timeout), the rest still report and the error is shown.
- Local web UI. Paste code, read the report, download it as Markdown. API keys stay on the server side.
- Offline mode. A mock provider runs the whole flow without API keys, for demos and tests.
Quick start
For the published package, use pip install code-council. Clone the repository for example configurations and development:
git clone https://github.com/cofson/code-council
cd code-council
pip install -e .
# Offline demo, no API keys (placeholder output)
code-council serve --config examples/agents.mock.toml
# open http://127.0.0.1:8765
Free options
Local with Ollama. Free, no API key, and the code never leaves your machine:
# install Ollama from https://ollama.com, then:
ollama pull qwen2.5-coder:32b # ~20 GB, needs ~24 GB VRAM; use :14b or :7b on smaller GPUs
code-council serve --config examples/agents.ollama.toml
Gemini free tier. Get a free key at aistudio.google.com:
export GEMINI_API_KEY=...
code-council serve --config examples/agents.gemini-free.toml
Both configs run reviewers one after another, which suits a single GPU and free-tier rate limits.
Paid APIs
With real models:
export ANTHROPIC_API_KEY=...
export OPENAI_API_KEY=...
export GEMINI_API_KEY=...
code-council serve --config examples/agents.toml
# or from the command line
code-council review src/app.py src/db.py --config examples/agents.toml
code-council diff examples/orders_old.py examples/orders_new.py --config examples/agents.toml
CLI runs write runs/<timestamp>/report.md and report.json.
The examples/orders_*.py pair is a small refactor to try diff mode on. The old version builds SQL by string concatenation and the new one uses a parameterised query.
A real run in compare mode: three reviewers, a judge and a fact-check pass on Qwen2.5-Coder 32B through Ollama, on a MacBook, at no cost. Full-page screenshot.
Real output, unedited, across three iterations:
- First run. All three reviewers flagged the SQL injection as critical and the verdict was right. But the judge listed already-fixed issues as things to fix, and no reviewer noticed that
apply_discountstill doesn't validate its input. - After rewriting the diff-mode judge prompt. The report now separates What improved from Still to fix, and the
apply_discountcheck is caught. Two weak suggestions remained: renaming the SELECT columns is not useful, and the tip to usewith sqlite3.connect(...)instead ofclosing(...)is wrong, because a sqlite3 connection used as a context manager commits or rolls back but does not close. These led to the fact-check pass and stricter reviewer rules (no renaming of things defined outside the code, no fix unless it is known to be correct). The reports are kept unedited as a record of the problems these changes address. - With stricter reviewers and the fact-check pass. Both wrong suggestions are gone, and "Still to fix" holds only the one real remaining issue:
apply_discountdoesn't reject negative prices or percentages over 100. The verdict, better, is correct.
Treat the report as a reviewer's opinion, not a guarantee. Larger models and mixed providers catch more.
Automated GitHub PR reviews
After merging the workflow into your default branch, configure repository Actions secrets ANTHROPIC_API_KEY, OPENAI_API_KEY and GEMINI_API_KEY for the example mixed-provider council. The workflow skips reviews if any key is missing. It reviews non-draft same-repository PRs on open, update or reopen and updates one bot comment. Forks are skipped. It checks out only the trusted base revision, never the PR head, and sends selected patch text to the configured external providers. Review only code you are authorized to disclose. The report is advisory, patch-only, and limited to 15 supported files and 30,000 characters; skipped files are counted. API usage may incur costs. The first review can run only after the workflow is merged.
Config
[run]
parallel = 4
[[reviewers]]
name = "Correctness"
role = "Find bugs, wrong logic, unhandled edge cases, error handling gaps and race conditions."
provider = "anthropic"
model = "claude-sonnet-4-5"
[[reviewers]]
name = "Security"
role = "Find security issues. Think like an attacker."
provider = "openai"
model = "gpt-4o"
[judge]
provider = "anthropic"
model = "claude-sonnet-4-5"
Model names change often. Use the ones your accounts have access to.
Limits
- Context, not repository. The reviewers see only the code you paste. They can't follow imports or run the code, so a finding about something defined elsewhere may be wrong. The input limit is 120,000 characters per run.
- LLM findings are suggestions. They can be wrong or miss things. Treat the report as a reviewer's opinion, not a verdict, and keep your tests and human review.
- Cost. Each run normally makes one call per reviewer, one for the judge and an optional fact-check call; fallback attempts can add calls.
- Testing. The test suite covers the full flow, the CLI and the web API offline with the mock provider, and the Ollama provider against a fake server. Real runs so far: local Qwen2.5-Coder 32B via Ollama (reports above). The manual live-validation workflow also exercises Ollama on a CPU runner with Qwen2.5-Coder 1.5B. Cloud providers are not covered by that live test. The 7B benchmark on five synthetic cases identified all four expected issues on manual inspection (75% keyword recall), with no findings on the single clean control. This is not a general accuracy estimate.
Development
pip install -e ".[dev]"
pytest -q
How this was built
Directed by Filip Dimitrijević (scope, priorities, review) and built with AI assistance (Claude).
License
Additional capabilities and maturity
- Fallback providers
- Project policy
- Advanced PR review (raw AI findings are not verified)
- Cost estimates (not billing totals)
- Local history
- MCP server (optional dependency)
- VS Code extension (development host)
- Docker
- Benchmarks
- Release readiness
AI suggestions require human review. Configured remote providers receive submitted source code. Do not submit secrets or code you are not authorized to share.
Metadata
Release files for code-council 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| code_council-1.0.0.tar.gz | 38.8 kB | With provenance | Details for code_council-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| code_council-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for code_council-1.0.0-py3-none-any.whl |
Total release size: 72.5 kB
Release files / code_council-1.0.0.tar.gz
| Download URL | code_council-1.0.0.tar.gz |
|---|---|
| Size | 38.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5844dbd5b8fc8ad2a038eb449a990a04ee670319df3a09ae9cad16a0ebf829c3
|
|
BLAKE2b-256 checksum How to use checksums |
0c208d51406f6a95e6920de4f1295945526ce7a7fda6a8e5d767c530fcf920c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logRelease files / code_council-1.0.0-py3-none-any.whl
| Download URL | code_council-1.0.0-py3-none-any.whl |
|---|---|
| Size | 33.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f4d6fa670eeddadb91faa96a5bc46d499f56e5563b916bbecc97f245be2e1d0f
|
|
BLAKE2b-256 checksum How to use checksums |
8a0aff0df1bacbbcfa499e9882733762afac305055b5a451d1934ef834dfa31f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logSecurity for code-council 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for code_council-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.