The code review agent starts from a GitHub webhook, grabs some context, clones into a sandbox, generates a git diff, then gives the sandbox to an agent to perform the review. The agent has tools to report feedback and mark files as complete. If it ends the review without all files marked complete, a guard makes it continue. This all happens in a Mastra workflow. A few more things for replying to comments and such, but that's the gist of it