Skip to main content
Integrate CodeAnt AI into Cursor to resolve PR review comments and review local changes — driven by Cursor’s AI agent.

What You Get

A Cursor rule that teaches the AI agent how to use the CodeAnt CLI. Once installed, you can ask Cursor to:
  • Fetch unresolved PR review comments and fix them automatically
  • Review your local code changes and fix all issues found

Prerequisites

  1. Cursor installed (download)
  2. CodeAnt CLI installed and authenticated — follow the CLI setup guide

Installation

mkdir -p .cursor/rules
git clone https://github.com/CodeAnt-AI/skills.git /tmp/codeant-skills
cp /tmp/codeant-skills/cursor/codeant.mdc .cursor/rules/
rm -rf /tmp/codeant-skills
Commit to share with your team:
git add .cursor/rules/codeant.mdc
git commit -m "Add CodeAnt AI Cursor rule"

Option 2: Create Manually

Create .cursor/rules/codeant.mdc — see the full rule content in the skills repository.

Usage

Resolve PR Review Comments

The most powerful workflow — fetch all unresolved CodeAnt review comments on a PR and fix them:
Fix all unresolved CodeAnt comments on PR #42
Or let it auto-detect the PR from your current branch:
Fix all unresolved CodeAnt review comments on the current branch's PR
Cursor will:
  1. Run codeant pr list --source-branch "<branch>" --state open to find the PR (if no number given)
  2. Run codeant pr comments --pr-number <N> --codeant-generated true to fetch comments
  3. Filter to unresolved comments (resolved: false)
  4. For each inline comment:
    • Read the file at the referenced line with surrounding context
    • Check the code still matches what the comment describes
    • Extract any code suggestion from the comment body
    • Validate the suggestion is safe (syntax, scope, no logic breakage)
    • Apply only if safe — skip and explain if not
  5. Flag PR-level comments as needing manual review

Review and Fix Local Changes

Review your local changes and fix all issues found:
Review my changes with CodeAnt and fix any issues
You can specify the scope:
Review only staged files with CodeAnt
Review the last commit with CodeAnt
Review my changes against the develop branch with CodeAnt
Cursor will:
  1. Run codeant review with the appropriate scope flag (--uncommitted, --staged, --last-commit, --base <branch>, etc.)
  2. Parse the findings (each issue has issue_content, relevant_file, start_line, label)
  3. For each issue, read the file with surrounding context
  4. Validate each fix won’t break existing logic before applying
  5. Re-run the review to verify all fixes are clean

Example Workflows

Resolve PR Comments

1. "Fix all unresolved CodeAnt comments on my current PR"
   → Cursor finds PR #42 for your branch
   → Fetches 5 unresolved comments
   → Validates and applies 4 safe fixes
   → Skips 1 that would change a public API — explains why
   → Reports results

2. "Commit the fixes"
   → Cursor commits with a descriptive message
   → On push, CodeAnt marks comments as addressed

Review → Fix → Ship

1. "Implement rate limiting middleware for Express routes"
   → Cursor implements the feature

2. "Review with CodeAnt and fix any issues"
   → Cursor runs: codeant review --uncommitted
   → Finds: 1 Security issue (missing input validation), 2 Code Quality issues
   → Fixes all 3 issues
   → Re-runs review: all clear

3. "Commit and push"

How It Works

The .cursor/rules/codeant.mdc file is a Cursor Rule that is automatically loaded into every AI conversation in your project. It teaches the Cursor agent the two core workflows (resolve PR comments and review local changes), the exact CLI commands and their output formats, and the validation-first approach to applying fixes safely. The rule has alwaysApply: true, so the agent always knows about CodeAnt — you don’t need to explicitly reference it.

Troubleshooting

“codeant: command not found” Ensure the CLI is installed globally and accessible from Cursor’s terminal:
npm install -g codeant-cli
codeant --version
If using nvm, ensure the correct Node version is active in Cursor’s integrated terminal. “Not authenticated” or “Could not detect remote”
codeant login                           # CodeAnt API auth
codeant set-token github <your-token>   # SCM auth for PR features
Agent doesn’t use CodeAnt
  • Verify .cursor/rules/codeant.mdc exists and has alwaysApply: true in frontmatter
  • Restart Cursor after adding the rule
  • Be explicit: “Use CodeAnt to review my changes”