Skip to content

Comments

feat: Add PAI_SKIP_WORK_CREATION env var for headless sessions#718

Open
MarvinDontPanic wants to merge 1 commit intodanielmiessler:mainfrom
MarvinDontPanic:feat/skip-work-creation
Open

feat: Add PAI_SKIP_WORK_CREATION env var for headless sessions#718
MarvinDontPanic wants to merge 1 commit intodanielmiessler:mainfrom
MarvinDontPanic:feat/skip-work-creation

Conversation

@MarvinDontPanic
Copy link

Summary

Adds a PAI_SKIP_WORK_CREATION=1 environment variable check to AutoWorkCreation.hook.ts that lets automated sessions skip WORK directory creation entirely.

Motivation: When running PAI sessions from cron jobs, CI pipelines, or background workers, each invocation creates a MEMORY/WORK/ directory with META.yaml and PRD stubs that never get used — the session's own logging (cron logs, CI artifacts) is the record-of-truth. Over time this creates significant directory clutter.

Usage: Set PAI_SKIP_WORK_CREATION=1 in the environment before launching claude -p. The hook exits cleanly before creating any WORK artifacts.

Test plan

  • Run a session with PAI_SKIP_WORK_CREATION=1 — confirm no WORK directory created
  • Run a session without the env var — confirm normal WORK directory creation unchanged

🤖 Generated with Claude Code

Allow automated sessions (cron jobs, CI pipelines, background workers)
to opt out of WORK directory creation by setting PAI_SKIP_WORK_CREATION=1.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant