Skip to content

SkillCustomization PREFERENCES.md not automatically applied in background agents — is this by design or misconfiguration? #1363

@rolpro

Description

@rolpro

PAI Version: 5.0.0 | Algorithm v6.3.0
Platform: Linux (Ubuntu 24.04, kernel 6.8.0)
Claude Code version: claude-sonnet-4-6

Problem

When a background agent (spawned via Agent(..., run_in_background: true)) calls Skill("Knowledge", "ingest ..."), the ## Customization section in skills/Knowledge/SKILL.md instructs:

"Before executing, check for user customizations at: ~/.claude/PAI/USER/SKILLCUSTOMIZATIONS/Knowledge/"

This instruction is never followed in practice. Background agents treat their spawn prompt as the primary directive. The SKILL.md content — including the Customization section — is lower priority and gets skipped.

The result: PAI/USER/SKILLCUSTOMIZATIONS/Knowledge/PREFERENCES.md is silently ignored every time an INBOX background agent runs.

Setup

  • PAI installed at ~/.claude/ on Linux (no launchd, Pulse started manually)
  • settings.json has a PreToolUse hook with matcher=Skillhttp://localhost:31337/hooks/skill-guard
  • PAI/PULSE/modules/hooks.tshandleSkillGuard() currently only does blocklist checking — no customization injection

Questions

  1. Is the skill-guard hook supposed to inject SKILLCUSTOMIZATIONS/<Skill>/PREFERENCES.md as additionalContext and it is just not implemented yet in my version?
  2. Or is the expectation that each spawn prompt manually includes an instruction to read PREFERENCES.md?
  3. Is there a Linux-specific setup step I am missing (e.g. Pulse needs to run as a daemon so the hook fires reliably)?

What I tried

  • Confirmed PREFERENCES.md exists and has content
  • Confirmed the skill-guard HTTP hook fires (Pulse running, returns 200 pass-through)
  • Confirmed handleSkillGuard() in hooks.ts has no customization loading logic
  • Workaround added to CLAUDE.md Inbox-Pflicht rule: spawn prompt now explicitly includes instruction to read PREFERENCES.md

Proposed fix (implemented locally, not update-safe)

Extended handleSkillGuard() to async, reads SKILLCUSTOMIZATIONS/<skill>/PREFERENCES.md via case-insensitive dir scan, injects content as additionalContext in the hook response. Works when Pulse is running.

Would this be something to upstream into the public PAI repo?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions