mirror of
https://github.com/anthropics/claude-code.git
synced 2026-05-08 07:52:42 +00:00
Add a new plugin that allows users to approve permission requests while providing guidance to Claude. This addresses the request for an "accept with feedback" option (similar to the existing "reject with feedback" for plans). The plugin includes: - PermissionRequest hook to intercept permission prompts - /accept-feedback command for one-time feedback - /configure-feedback command for persistent rules - Configuration file support for automated feedback rules Users can now provide context like "make sure to add error handling" when approving operations, and Claude receives this as guidance.
2.2 KiB
2.2 KiB
description
| description |
|---|
| Configure persistent feedback rules for accept-with-feedback |
Configure Accept-with-Feedback Rules
You are helping the user configure persistent feedback rules that automatically provide guidance to Claude when certain operations are approved.
Configuration file location
Rules are stored in .claude/accept-feedback.json in either:
- User's home directory (
~/.claude/accept-feedback.json) for global rules - Project directory (
.claude/accept-feedback.json) for project-specific rules
Project rules take precedence over user rules.
Configuration format
{
"rules": [
{
"matcher": "Edit|Write",
"conditions": {
"file_path": ".py"
},
"feedback": "Ensure all Python code follows PEP 8 style guidelines and includes type hints."
},
{
"matcher": "Bash",
"conditions": {
"command": "git"
},
"feedback": "Use conventional commit format for commit messages."
},
{
"matcher": "*",
"feedback": "Please explain your reasoning before making changes."
}
]
}
Rule properties
- matcher: Tool name pattern (e.g., "Edit", "Write|Edit", "*" for all)
- conditions: Optional key-value pairs to match against tool input
- feedback: The guidance message to send to Claude when this rule matches
Instructions
- Ask the user what kind of feedback rules they want to configure
- Help them create appropriate rules based on their needs
- Save the configuration to the appropriate location
Common use cases
- Code style guidance: Provide style guidelines when editing specific file types
- Git workflow: Add commit message format requirements for git operations
- Safety reminders: Add warnings when working with sensitive files
- Project conventions: Enforce project-specific patterns and practices
Example interaction
User: "I want to always remind Claude to add tests when editing Python files"
You would create:
{
"rules": [
{
"matcher": "Edit|Write",
"conditions": {
"file_path": ".py"
},
"feedback": "Remember to add or update tests for any code changes."
}
]
}