tao-shen Claude Opus 4.6 commited on
Commit
3ebdf62
·
1 Parent(s): 2ac3479

fix: enable Claude Code to actually write files (skip permissions + prompt)

Browse files

- Add --dangerouslySkipPermissions flag to claude CLI invocation
- Add explicit instruction in task prompt: "You have FULL permission,
do NOT ask for permission, just make changes directly"
- Fixes the loop where CC would analyze code but never edit files,
repeatedly asking "Shall I proceed?" and exiting with no changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. scripts/conversation-loop.py +3 -2
scripts/conversation-loop.py CHANGED
@@ -366,7 +366,7 @@ def action_claude_code(task):
366
  print(f"[CLAUDE-CODE] Running: {task[:200]}...")
367
  try:
368
  proc = subprocess.Popen(
369
- ["claude", "-p", task, "--output-format", "text"],
370
  cwd=CLAUDE_WORK_DIR,
371
  env=env,
372
  stdout=subprocess.PIPE,
@@ -539,7 +539,8 @@ def format_context(ctx):
539
  def enrich_task_with_context(task_desc, ctx):
540
  """Append auto-gathered context to task description for Claude Code."""
541
  parts = [task_desc]
542
- parts.append(f"\n\n--- AUTO-GATHERED CONTEXT ---")
 
543
  parts.append(f"Space ID: {CHILD_SPACE_ID}")
544
  parts.append(f"Dataset ID: {CHILD_DATASET_ID}")
545
  parts.append(f"Current stage: {child_state['stage']}")
 
366
  print(f"[CLAUDE-CODE] Running: {task[:200]}...")
367
  try:
368
  proc = subprocess.Popen(
369
+ ["claude", "-p", task, "--output-format", "text", "--dangerouslySkipPermissions"],
370
  cwd=CLAUDE_WORK_DIR,
371
  env=env,
372
  stdout=subprocess.PIPE,
 
539
  def enrich_task_with_context(task_desc, ctx):
540
  """Append auto-gathered context to task description for Claude Code."""
541
  parts = [task_desc]
542
+ parts.append(f"\n\nIMPORTANT: You have FULL permission to read and write files. Do NOT ask for permission. Just make the changes directly. Edit files, create files, delete files — whatever is needed. Do NOT output code suggestions — actually write them to the files.")
543
+ parts.append(f"\n--- AUTO-GATHERED CONTEXT ---")
544
  parts.append(f"Space ID: {CHILD_SPACE_ID}")
545
  parts.append(f"Dataset ID: {CHILD_DATASET_ID}")
546
  parts.append(f"Current stage: {child_state['stage']}")