---
title: "overlane rules check"
description: "Report drift between the rules source and each agent's file; exits 6 on drift, for CI"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.overlane.app/llms.txt
> Use this file to discover all available pages before exploring further.

# overlane rules check

{/* Generated by apps/docs/scripts/generate.mjs (CLI pages from the command registry in packages/cli). Do not edit; run `pnpm --filter @overlane/docs gen`. */}

Compares .overlane/rules.md with AGENTS.md, CLAUDE.md, the Cursor rule, GEMINI.md and the Gemini settings, and changes nothing. A target is in sync, missing, unmanaged (no managed region yet), stale (the source changed), edited (a hand edit inside the region, with the first differing line) or damaged. Exit 0 when everything is in sync or the project has no rules source; exit 6 on any drift. Run it in CI and see it in overlane doctor.

## Usage

```sh
overlane rules check
```

## Examples

```sh
overlane rules check
overlane rules check --json
```

## Behavior

- Effect: `read` (changes nothing).
- Needs credentials: no. Uses the network: no.
- Supports `--dry-run`: no. Accepts `--force`: no.
- Machine-readable description: `overlane schema rules check`.

## Result

With `--json` (the default when stdout is not a terminal) the command prints this JSON Schema's shape on stdout.

```json
{
  "type": "object",
  "properties": {
    "configured": {
      "type": "boolean"
    },
    "revision": {
      "type": [
        "string",
        "null"
      ]
    },
    "sourceProblem": {
      "type": [
        "string",
        "null"
      ]
    },
    "drifted": {
      "type": "boolean"
    },
    "targets": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "agents-md",
              "claude-md",
              "cursor",
              "gemini-md",
              "gemini-settings"
            ]
          },
          "path": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "in_sync",
              "missing",
              "unmanaged",
              "stale",
              "edited",
              "damaged"
            ]
          },
          "detail": {
            "type": "string"
          },
          "syncable": {
            "type": "boolean"
          },
          "firstDifference": {
            "type": "object",
            "properties": {
              "line": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "found": {
                "type": "string"
              },
              "expected": {
                "type": "string"
              }
            },
            "required": [
              "line",
              "found",
              "expected"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "path",
          "state",
          "detail",
          "syncable"
        ],
        "additionalProperties": false
      }
    },
    "nextCommand": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "configured",
    "revision",
    "sourceProblem",
    "drifted",
    "targets",
    "nextCommand"
  ],
  "additionalProperties": false
}
```

See [exit codes](/cli/#exit-codes) for the status the process returns.

Source: https://docs.overlane.app/cli/rules-check/index.mdx
