Skip to content

Human-in-the-loop code review for AI agents.

Notifications You must be signed in to change notification settings

alexmx/codechat

Repository files navigation

CodeChat

Human-in-the-loop code review for AI agents.

Review your AI agent's code changes like a pull request — but locally. CodeChat opens a browser UI where you review the diff, leave inline comments, and submit. The agent reads your comments, makes fixes, and replies — a tight feedback loop that keeps you in control without breaking the agent's flow.

Screenshot 2026-02-22 at 21 41 44

Features

  • Browser-based review UI — Syntax-highlighted diffs with inline commenting, dark/light theme
  • Real-time updates — File changes are pushed to the browser as they happen
  • Session management — Resume any past review session by ID
  • MCP integration — Connect to any AI coding agent as an MCP server
  • Works with any git repo — Reviews all uncommitted changes

Installation

Homebrew

brew install alexmx/tools/codechat

To update:

brew upgrade alexmx/tools/codechat

Mise

mise use --global github:alexmx/codechat

Or in mise.toml for a project-scoped install:

[tools]
"github:alexmx/codechat" = "latest"

Quick Start

  1. Set up the MCP server:

Claude Code (plugin):

/plugin marketplace add alexmx/claude-tools
/plugin install codechat@alexmx-tools

Other agents:

codechat mcp --setup
  1. Ask the agent to review its changes. It calls codechat_review, you see:
Review server running at http://127.0.0.1:52341/abc-123
Session: abc-123
Reviewing 3 file(s)
  1. Review in the browser, leave comments, submit.
  2. The agent gets your comments, makes fixes, calls codechat_reply.
  3. Ask the agent to open the review again if you want another round.

Manage sessions

codechat sessions            # list sessions for this repo
codechat sessions <id>       # print full session JSON
codechat -s <id>             # resume a specific session in the browser

CLI Reference

Usage: codechat [options]
       codechat sessions [<id>]
       codechat mcp [--setup]
Option Description
-s, --session <id> Resume a session
-d, --description <text> Describe the changes
-p, --port <n> Server port (default: random)
-t, --timeout <min> Session timeout (default: 30)
--no-open Don't open the browser
-v, --version Show version
-h, --help Show help
Command Description
codechat Review current uncommitted changes
codechat sessions List sessions for this repo
codechat sessions <id> Print full session JSON
codechat mcp Start MCP server over stdio
codechat mcp --setup Print setup instructions for AI agents

MCP Server

CodeChat exposes two MCP tools designed for the review loop:

codechat_review

Opens the browser UI and blocks until the user submits. Returns a ReviewResult with all comments.

Parameter Type Required Description
repoPath string yes Absolute path to the git repository
sessionId string no Session ID to resume (auto-discovered by default)
description string no Brief description stored with the session

codechat_reply

Records agent replies to review comments. Returns immediately with the updated result.

Parameter Type Required Description
repoPath string yes Absolute path to the git repository
replies array yes Replies addressing comments from the previous round

Each reply in the array:

Field Type Required Description
commentId string yes The comment ID being addressed
body string yes What you did or a clarifying question
resolved boolean no Mark as resolved (default: true). Set to false to ask a follow-up.

License

MIT License - see LICENSE for details.