{
  "id": 8335179,
  "title": "5 Pitfalls I Hit Building a Daemon That Auto-Approves Claude Code's Computer Use Dialog",
  "url": "https://urgent.news/2026/09/19/5-pitfalls-i-hit-building-a-daemon-that-auto-approves-claude-codes",
  "topic": "ai",
  "section": "AI",
  "published": "2026-09-19T00:00:05.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/bokuwalily/5-pitfalls-i-hit-building-a-daemon-that-auto-approves-claude-codes-computer-use-dialog-5amk"
  },
  "original_language": "en",
  "account": "This article recounts a developer's struggles while creating a daemon to automatically approve Claude Code's Computer Use approval dialog. The initial attempt using launchd to launch the daemon resulted in nine osascript timeout lines at 22-second intervals, with no keystrokes sent. Moving the daemon to run as a child process of Terminal allowed it to successfully send '\\r' to the dialog within seconds. The issue was that pressing \"Allow for this session\" manually each time failed since Computer Use approval dialog would reappear every time a session boundary was crossed.\n\nThe developer sought to make the approval permanent, but found no settings in settings.json or ~/.claude.json that could achieve this. The approval state lives only in session memory and vanishes when process boundaries are crossed. They also tried bypassing permissions using bypassPermissionsModeAccepted: true in ~/.claude.json, but this only suppresses the dangerous operation confirmation, not the Computer Use approval dialog.\n\nThe final solution involved writing a Python script, cu_dialog_autoallow.py, to poll Terminal tabs every 2 seconds. When the dialog string appears, the script sends '\\r' to approve. To prevent misfires, the script checks which option the cursor is on before sending the Enter key. If the default cursor is on the Deny side, it skips sending Enter to avoid a denial. The script also deduplicates Enter sends per tty with an 8-second window and prevents multiple instances from running simultaneously.\n\nA significant challenge encountered was that launching the daemon as a standalone process under launchd led to silent hangs due to AppleEvent limitations under TCC (Automation) context. The workaround was to launch the daemon as a child process of Terminal, which allowed it to successfully interact with the Computer Use dialog without hanging.",
  "summary": "Last time I wrote about the morning my Wi-Fi was dead for five hours . This post is in the same \"stop babysitting an unattended machine\" vein: a small daemon that presses Enter on Claude Code's Computer Use approval dialog for you . My first attempt, launched from launchd, produced nothing but nine osascript timeout lines at 22-second intervals and never sent a single keystroke. Once I moved it…",
  "key_points": [],
  "editors_take": "The developer's experience highlights the complexities of automating interactions with system dialogs, showing that even with scripting and configuration adjustments, achieving seamless approval can require creative workarounds.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}