Feature Request: Add a formal `description` field for comments in `settings.json`
Title: Feature Request: Add a formal description field for comments in settings.json
Body:
Problem:
The settings.json file is powerful, but because JSON doesn't support comments, it's hard to document why a configuration exists. This makes it difficult for teams to maintain complex settings for hooks, permissions, and other features.
Currently, we use unofficial keys like _comment, which works because the parser ignores them, but it's not a standardized or discoverable solution.
Proposed Solution:
I propose adding an official, optional description key that can be added to any object within settings.json.
This pattern already exists within Claude Code. As documented in en/docs/claude-code/slash-commands/index, custom slash commands use a description field in their YAML frontmatter for this exact purpose.
Adopting the same description key for settings.json would create a consistent and predictable developer experience across all configuration files. The Claude Code parser would be updated to recognize and ignore this key, treating it purely as a documentation field.
Example Usage:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Task",
"description": "Validates the JSON output from a sub-agent against our protocol schema.",
"hooks": [
{
"type": "command",
"command": ".claude/hooks/validate_agent_output.sh"
}
]
}
]
},
"permissions": {
"description": "Allowlist essential CI commands but block all network access.",
"allow": ["Bash(npm run test:*)"],
"deny": ["WebFetch"]
}
}
Benefits:
This small change would greatly improve the maintainability and clarity of shared configurations. Most importantly, it would align settings.json with existing configuration patterns in Claude Code, making the entire tool more consistent and intuitive for teams to manage.
This issue has 11 comments on GitHub. Read the full discussion on GitHub ↗