AMP Code Review Agent Becomes UI-Agnostic, Composable Subroutine

AMP's code review agent is now fully UI-agnostic and invocable as a composable subroutine from the CLI, chat threads, or editor panels. Developers can add directory-scoped Checks in .agents/checks/ with each rule run as its own agent for focused, automatable reviews.

amp cover

TL;DR

  • UI-agnostic, composable review subroutine: review logic decoupled from any single interface, treated as a portable service.
  • Invocation paths: CLI (amp review), chat/threaded natural-language requests, and editor-extension review panels with parallel runs.
  • .agents/checks for custom rules; user-defined, directory-scoped checks documented at https://ampcode.com/manual#checks.
  • Example performance check (.agents/checks/perf.md): nested loops, repeated array.includes() in loops, sorting inside loops, string concatenation in loops.
  • code_review spawns a separate agent per check: each rule evaluated independently; outputs can feed other commands or the main agent to apply fixes.
  • Directory-scoped checks (root vs nested) for performance, security, migrations, stylistic conventions, or compliance; simplifies integrating automated review into CLI, chat, and editor workflows.

Original source: https://ampcode.com/news/liberating-code-review

AMP code review agent has been reworked into a UI-agnostic, composable subroutine that can be invoked from multiple contexts. The agent no longer assumes a single review interface; it can be called directly from the CLI, from chat-style threads using natural language, or in parallel from an editor extension review panel, which makes the review workflow more adaptable to diverse development setups.

What changed

The core shift is full decoupling from any specific UI. This means review logic is treated as a portable service that other tools and workflows can call into. Key invocation paths described:

  • CLI: run the review agent directly with amp review.
  • Chat/threaded requests: request a review in any thread using natural language (examples include “review the outstanding changes” or “review changes since diverging from main”).
  • Editor extension: launch multiple reviews in parallel from the extension’s review panel.

Because the review capability is composable, the review output can be fed into other commands or into the main agent to automatically apply fixes, enabling tighter automation between discovery and remediation.

Customizing review with Checks

Review behavior can be tailored by adding user-defined rules called Checks, placed under .agents/checks/ directories. Checks are intended as scoped, human-readable invariants or review criteria for specific parts of a repository; they are documented in the manual at https://ampcode.com/manual#checks.

An example performance check (saved as .agents/checks/perf.md) was shown as:


name: performance description: Flags common performance anti-patterns

Look for these patterns:

  • Nested loops over the same collection (O(n²) → O(n) with a Set/Map)
  • Repeated array.includes() in a loop
  • Sorting inside a loop
  • String concatenation in a loop (use array + join)

Report the line, why it matters, and how to fix it.

The system’s code_review tool spawns a separate agent for each check, providing stronger guarantees that each rule will be evaluated rather than relying on a single, overloaded context file.

Scope and examples

Checks are directory-scoped: a root .agents/checks covers the entire repository, while a nested api/.agents/checks applies only to files under api/. Suggested uses for checks include:

  • Performance best practices tailored to a stack
  • Security invariants or common vulnerability patterns
  • Migration reminders for deprecated APIs
  • Stylistic conventions not enforced by linters
  • Compliance requirements for specific code regions

Developer implications

Treating the review agent as a composable subroutine makes it easier to integrate automated review into different parts of the development lifecycle—local CLI runs, conversational threads, or editor-driven flows. The separate-agent-per-check model promotes clearer, more focused reviews and simplifies adding team-specific checks without bloating a single review context.

Original source: https://ampcode.com/news/liberating-code-review

Continue the conversation on Slack

Did this article spark your interest? Join our community of experts and enthusiasts to dive deeper, ask questions, and share your ideas.

Join our community