cc-hook: fall back to file-based project override #2

Merged
jones merged 2 commits from fix/project-file-override into main 2026-04-03 12:44:59 +00:00
Collaborator

Env var propagation through Claude Code hook subprocesses is unreliable — CC_TRACKER_PROJECT set on the claude CLI process does not reliably reach cc-hook.

This adds a fallback: if CC_TRACKER_PROJECT is not set, cc-hook reads /tmp/cc-hook-project-override. The companion change in jones/assistant (PR #17) writes this file in sendCLI before spawning claude and removes it after, so webhook-triggered sessions are attributed to forgejo instead of assistant.

Env var propagation through Claude Code hook subprocesses is unreliable — `CC_TRACKER_PROJECT` set on the claude CLI process does not reliably reach cc-hook. This adds a fallback: if `CC_TRACKER_PROJECT` is not set, cc-hook reads `/tmp/cc-hook-project-override`. The companion change in `jones/assistant` (PR #17) writes this file in `sendCLI` before spawning claude and removes it after, so webhook-triggered sessions are attributed to `forgejo` instead of `assistant`.
Claude Code may not propagate parent env vars to hook subprocesses,
so the assistant now writes this file before spawning claude and removes
it after. cc-hook reads it as a fallback when CC_TRACKER_PROJECT is unset.
jones merged commit c8b15008cf into main 2026-04-03 12:44:59 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jones/cc-hook!2
No description provided.