spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / plugins / accept-with-feedback / commands / accept-feedback.md
63 lines · 1.9 KBPreviewCodeRaw
1---
2description: Set feedback to provide when accepting the next permission request
3argument_name: feedback
4---
5
6# Accept with Feedback
7
8You are helping the user set feedback that will be automatically provided to Claude when the next permission request is approved.
9
10## What the user wants
11
12The user wants to approve an upcoming operation but also provide guidance or feedback to Claude. This feedback will:
131. Automatically approve the next permission request
142. Send the feedback message to Claude as guidance
15
16## Instructions
17
181. Parse the user's feedback from the argument: `$ARGUMENTS`
19
202. If feedback was provided, save it for the next permission request:
21 - Create/update the file `~/.claude/pending-accept-feedback.json`
22 - Store the feedback with the current session ID
23
243. Confirm to the user that their feedback has been queued
25
26## Saving the feedback
27
28Use this Python code to save the pending feedback:
29
30```python
31import json
32import os
33from pathlib import Path
34
35feedback = """$ARGUMENTS"""
36session_id = os.environ.get("CLAUDE_SESSION_ID", "default")
37
38pending_file = Path.home() / ".claude" / "pending-accept-feedback.json"
39pending_file.parent.mkdir(parents=True, exist_ok=True)
40
41try:
42 existing = json.loads(pending_file.read_text()) if pending_file.exists() else {}
43except:
44 existing = {}
45
46existing[session_id] = {
47 "message": feedback,
48 "one_time": True
49}
50
51pending_file.write_text(json.dumps(existing, indent=2))
52print(f"Feedback queued for next permission request.")
53```
54
55## Example usage
56
57User runs: `/accept-feedback Make sure to add error handling`
58
59Then when Claude asks for permission to edit a file, the operation is automatically approved and Claude receives the guidance: "Make sure to add error handling"
60
61## Response
62
63After saving, confirm: "Your feedback has been queued. The next permission request will be automatically approved, and Claude will receive your guidance."