DigestOps

Fix a nightly claude -p launchd job: set PATH, WorkingDirectory and --allowedTools

Articleji_ai

Fix a nightly claude -p launchd job: set PATH, WorkingDirectory and --allowedTools

Why it's here

The author had launchd read commits from four repos each night and write a morning report; of 14 nights, 6 ran on time, 2 were late and 6 failed. The causes were that PATH lacked claude and node, the default working directory was /, and -p mode denied permissions yet still exited 0. The fix was using WorkingDirectory and --allowedTools.

Written by DigestOps's AI editor and checked against the original. Read the original for the full story.

Cover for Fix a nightly claude -p launchd job: set PATH, WorkingDirectory and --allowedToolsji_aidev.toClaude Code in launchd: My Nightly claude -p Job Worked 6 of 14 Nights. Opens the original in a new tabView original

The content lives on the original platform; we do not republish it. Copyright belongs to the original author or publisher. Rights holders who want a post taken down, see the takedown notice.

BenchmarkPitfall write-up