Rules / Configuration

config-json-invalid

Agent config file is not valid JSON.

error by default Configuration Inline suppression allowed

Source: Claude Code docs: Settings (code.claude.com), read 14 October 2026.

On GitHub: the rule doc and the tests.

All rules73

What it catches#

Agent config file is not valid JSON.

A .claude/settings.json or .mcp.json that is not valid JSON (a trailing comma, a comment, a missing quote), or whose top level is not an object. .cursor/mcp.json, .vscode/mcp.json and .gemini/settings.json are read the way their tools read them, so comments and trailing commas are allowed there; other syntax errors are still reported. Needs --include config; .claude/settings.local.json is checked only with --include config-local.

Why it matters#

Claude Code skips a settings file it cannot parse, and MCP clients drop the servers in it, so the permissions and servers are not what the author thinks.

Bad example#

{
  "permissions": {
    "deny": ["Read(./.env)"],
  }
}

The trailing comma after the array makes the file invalid. Claude Code ignores a settings file it cannot parse, so the deny rule that looks present is not in force.

Good example#

{
  "permissions": {
    "deny": ["Read(./.env)"]
  }
}

How to fix#

Fix the syntax the message points at. JSON has no comments and no trailing commas. node -e 'JSON.parse(require("fs").readFileSync(".claude/settings.json","utf8"))' confirms the file parses.

Suppress or configure#

For one finding, put a comment on the line above it. The reason after -- is optional but worth writing:

<!-- asitis-disable-next-line config-json-invalid -- why this one is fine -->

For a whole file:

<!-- asitis-disable-file config-json-invalid -- why this file is an exception -->

For every file, turn it off or change its severity in .asitisrc.json:

{ "rules": { "config-json-invalid": "off" } }

A .asitisrc.json overrides entry limits a change to some paths, and a baseline (asitis lint --format json --write-baseline) accepts today's findings so only new ones fail the build.

Source#

Claude Code docs: Settings, read on 14 October 2026.

Related guides

Run the rule

This page is generated from the plugin's rule registry. Edit it on GitHub. False positive? Open an issue with the line it fired on.