Skip to content

Configuration Schemas

claudelint validates Claude Code configuration files against a set of schemas derived from the official Claude Code documentation. This page documents every schema claudelint enforces, including valid fields, types, constraints, and cross-field validations.

For the authoritative specification, always refer to the official docs linked in each section below.

Valid Values Reference

These constant sets are used across multiple schemas. claudelint flags any value not in these lists.

Tool Names

Valid values for allowed-tools, disallowed-tools, tools, and disallowedTools fields.

ToolDescription
BashShell command execution
ReadFile reading
WriteFile creation
EditFile editing
GlobFile pattern matching
GrepContent search
TaskSubagent task delegation
WebFetchURL content fetching
WebSearchWeb search
LSPLanguage Server Protocol
AskUserQuestionInteractive user prompts
EnterPlanModePlan mode entry
ExitPlanModePlan mode exit
SkillSkill invocation
TaskCreateTask list creation
TaskUpdateTask list updates
TaskGetTask retrieval
TaskListTask listing
TaskOutputTask output retrieval
TaskStopTask cancellation
NotebookEditJupyter notebook editing

TIP

Custom MCP tool names (e.g., mcp__server__tool) are also accepted. claudelint only warns on unrecognized built-in tool names.

Model Names

Valid values for model fields in skill and agent frontmatter.

ValueDescription
sonnetClaude Sonnet
opusClaude Opus
haikuClaude Haiku
inheritInherit from parent context

Note: The model field in settings.json accepts arbitrary strings (full model IDs, ARNs, aliases) and is not restricted to this enum.

Hook Events

Valid event keys for hooks configuration. All names are PascalCase.

EventDescription
PreToolUseBefore a tool is executed
PostToolUseAfter a tool executes successfully
PostToolUseFailureAfter a tool execution fails
PermissionRequestWhen a permission prompt would appear
UserPromptSubmitWhen the user submits a prompt
NotificationWhen a notification is generated
StopWhen the agent stops
SubagentStartWhen a subagent starts
SubagentStopWhen a subagent stops
PreCompactBefore context compaction
SetupDuring initial setup
SessionStartWhen a session begins
SessionEndWhen a session ends
TeammateIdleWhen a teammate agent is idle
TaskCompletedWhen a task completes

Hook Types

Valid values for the type field in hook handlers.

TypeDescription
commandExecutes a shell command
promptSends a prompt to Claude
agentDelegates to a named agent

Context Modes

Valid values for the context field in skill frontmatter.

ModeDescription
forkRun in a forked subagent (requires agent field)
inlineRun inline in the current context
autoLet Claude Code decide

MCP Transport Types

Valid values for the type field in MCP server configuration.

TypeDescription
stdioLocal subprocess (default when command is present)
sseServer-Sent Events (deprecated)
httpHTTP endpoint
websocketWebSocket connection

SKILL.md Frontmatter

FieldTypeRequiredConstraints
namestringyesLowercase with hyphens, max 64 chars, no XML tags, no reserved words (anthropic, claude)
descriptionstringyesMin 10 chars, no XML tags, third-person voice
argument-hintstringnoHint text for skill arguments
disable-model-invocationbooleannoPrevent model from invoking this skill
user-invocablebooleannoWhether users can invoke directly via /skill-name
versionstringnoSemantic version (e.g., 1.0.0)
modelstringnosonnet, opus, haiku, or inherit
contextstringnofork, inline, or auto
agentstringnoAgent name (required when context: fork)
allowed-toolsstring[]noList of tool names to allow
disallowed-toolsstring[]noList of tool names to disallow
tagsstring[]noCategorization tags
dependenciesstring[]noRequired skill dependencies
hooksobjectnoHooks configuration
licensestringnoLicense identifier
compatibilitystringnoCompatibility notes, max 500 chars
metadataobjectnoArbitrary key-value metadata

Cross-field validations:

  • When context is fork, the agent field is required
  • allowed-tools and disallowed-tools are mutually exclusive

Agent Frontmatter

Agent files are flat .md files (e.g., .claude/agents/code-reviewer.md). The file body is the system prompt.

FieldTypeRequiredConstraints
namestringyesLowercase with hyphens, max 64 chars, no XML tags
descriptionstringyesMin 10 chars, no XML tags, third-person voice
modelstringnosonnet, opus, haiku, or inherit
toolsstring[]noList of tool names to allow
disallowedToolsstring[]noList of tool names to disallow
permissionModestringnodefault, acceptEdits, dontAsk, bypassPermissions, plan, or delegate
skillsstring[]noSkills this agent can use
hooksobjectnoHooks configuration
memorystringnouser, project, or local
maxTurnsnumbernoMaximum agent turns (positive integer)
mcpServersstring[]noMCP servers available to the agent
colorstringnoblue, cyan, green, yellow, magenta, red, or pink

Cross-field validations:

  • tools and disallowedTools are mutually exclusive

Hooks Configuration

Hooks use an object-keyed format where each key is a hook event name (PascalCase):

json
{
  "hooks": {
    "SessionStart": [
      {
        "matcher": "optional-pattern",
        "hooks": [
          {
            "type": "command",
            "command": "echo 'Session started'"
          }
        ]
      }
    ]
  }
}

Hook Matcher

Each event maps to an array of matcher objects:

FieldTypeRequiredDescription
matcherstringnoPattern to match against (e.g., tool name for PreToolUse)
hooksobject[]yesArray of hook handlers

Hook Handler

FieldTypeRequiredDescription
typestringyescommand, prompt, or agent
commandstringnoShell command (when type is command)
promptstringnoPrompt text (when type is prompt)
agentstringnoAgent name (when type is agent)
timeoutnumbernoTimeout in milliseconds
statusMessagestringnoStatus message shown during execution
oncebooleannoRun only once per session
modelstringnoModel override for this hook

Standalone hooks.json

The hooks/hooks.json file (plugin root) wraps the hooks object with an optional description:

json
{
  "description": "Project-level hooks",
  "hooks": {
    "PreToolUse": [ ... ]
  }
}
FieldTypeRequiredDescription
descriptionstringnoHuman-readable description
hooksobjectyesHooks configuration (event-keyed object)

MCP Configuration

The .mcp.json file supports two formats:

Wrapped format (project scope):

json
{
  "mcpServers": {
    "server-name": { ... }
  }
}

Flat format (plugin scope):

json
{
  "server-name": { ... }
}

Server Configuration by Transport

stdio (default when command is present):

FieldTypeRequiredDescription
type"stdio"noOptional, inferred from command
commandstringyesCommand to execute
argsstring[]noCommand arguments
envobjectnoEnvironment variables

http:

FieldTypeRequiredDescription
type"http"yesMust be "http"
urlstringyesHTTP endpoint URL
headersobjectnoHTTP headers
envobjectnoEnvironment variables

sse (deprecated):

FieldTypeRequiredDescription
type"sse"yesMust be "sse"
urlstringyesSSE endpoint URL
headersobjectnoHTTP headers
envobjectnoEnvironment variables

websocket:

FieldTypeRequiredDescription
type"websocket"yesMust be "websocket"
urlstringyesWebSocket URL
envobjectnoEnvironment variables

Plugin Manifest

The plugin.json file lives in the .claude-plugin/ directory.

FieldTypeRequiredDescription
namestringyesPlugin name
versionstringnoSemantic version
descriptionstringnoPlugin description
authorobjectnoAuthor info (must be an object, not a string)
homepagestringnoHomepage URL
repositorystringnoRepository URL
licensestringnoLicense identifier
keywordsstring[]noSearch keywords
commandsstring | string[]noPath(s) to command directories
agentsstring | string[]noPath(s) to agent directories
skillsstring | string[]noPath(s) to skill directories
hooksstring | objectnoPath to hooks file or inline hooks config
mcpServersstring | objectnoPath to MCP config or inline server config
outputStylesstring | string[]noPath(s) to output style files
lspServersstring | objectnoPath to LSP config or inline server config

Plugin Author

The author field must be an object (string format is not supported by Claude Code):

FieldTypeRequiredDescription
namestringyesAuthor name
emailstringnoContact email
urlstringnoAuthor URL

Settings

The settings.json file can be located at:

  • ~/.claude/settings.json (global)
  • .claude/settings.json (project)
  • .claude/settings.local.json (local, gitignored)

claudelint validates the top-level structure and nested objects. Key sections include:

Permissions

FieldTypeDescription
allowstring[]Permission patterns to auto-allow (e.g., "Bash(npm run *)")
denystring[]Permission patterns to always deny
askstring[]Permission patterns to always prompt
defaultModestringacceptEdits, bypassPermissions, default, or plan
disableBypassPermissionsModestringSet to "disable" to prevent bypass
additionalDirectoriesstring[]Extra directories to allow access to

Attribution

FieldTypeDescription
commitstringCommit message template
prstringPR description template

Sandbox

FieldTypeDescription
enabledbooleanEnable sandboxing
autoAllowBashIfSandboxedbooleanAuto-allow bash in sandbox
excludedCommandsstring[]Commands excluded from sandbox
allowUnsandboxedCommandsstring[]Commands allowed outside sandbox
network.allowedHostsstring[]Allowed network hosts
network.allowedPortsnumber[]Allowed network ports
enableWeakerNestedSandboxbooleanAllow weaker nested sandbox
ignoreViolationsbooleanIgnore sandbox violations

LSP Configuration

The .lsp.json file maps server names to their configurations:

json
{
  "typescript": {
    "command": "typescript-language-server",
    "args": ["--stdio"],
    "extensionToLanguage": {
      ".ts": "typescript",
      ".tsx": "typescriptreact"
    }
  }
}
FieldTypeRequiredDescription
commandstringyesCommand to start the server
extensionToLanguageobjectyesMap of file extensions to language IDs
argsstring[]noCommand arguments
transportstringnostdio or socket
envobjectnoEnvironment variables
initializationOptionsobjectnoLSP initialization options
settingsobjectnoLSP server settings
workspaceFolderstringnoOverride workspace folder path
startupTimeoutnumbernoStartup timeout (ms, min 0)
shutdownTimeoutnumbernoShutdown timeout (ms, min 0)
restartOnCrashbooleannoAuto-restart on crash
maxRestartsnumbernoMax restart attempts (min 0)

Output Style Frontmatter

FieldTypeRequiredDescription
namestringnoDisplay name for the style
descriptionstringnoDescription of the style
keep-coding-instructionsbooleannoPreserve coding instructions in output

Rules File Frontmatter

Files in .claude/rules/ can include frontmatter to scope rules to specific paths:

yaml
---
paths:
  - "src/**/*.ts"
  - "lib/**/*.js"
---
FieldTypeRequiredDescription
pathsstring[]noGlob patterns to scope the rule to (min 1 pattern if present)

JSON Schema Files

claudelint maintains JSON Schema files for IDE integration and external tooling. These are available in the schemas/ directory:

SchemaFileDescription
Skill frontmatterskill-frontmatter.schema.jsonSKILL.md YAML frontmatter
Agent frontmatteragent-frontmatter.schema.jsonAgent file YAML frontmatter
Hooks confighooks-config.schema.jsonhooks.json structure
MCP configmcp-config.schema.json.mcp.json structure
Plugin manifestplugin-manifest.schema.jsonplugin.json structure
LSP configlsp-config.schema.json.lsp.json structure
Output styleoutput-style-frontmatter.schema.jsonOUTPUTSTYLE.md frontmatter
Rules frontmatterrules-frontmatter.schema.jsonRules file frontmatter

Running npm run generate:json-schemas produces auto-generated versions (from Zod schemas) in schemas/generated/ locally. Use npm run check:schema-sync to verify they stay in sync with the hand-written schemas above.

See Also