feat: add Notification hook for profile startup scripts - #3
Closed
julianleopold with Copilot wants to merge 4 commits into
Closed
feat: add Notification hook for profile startup scripts#3julianleopold with Copilot wants to merge 4 commits into
julianleopold with Copilot wants to merge 4 commits into
Conversation
Agent-Logs-Url: https://github.com/julianleopold/claude-profiles/sessions/b0da4803-44f8-4260-bab9-c64055017499 Co-authored-by: julianleopold <91874354+julianleopold@users.noreply.github.com>
Add profile scripts feature that loads profile-specific shell scripts via a Notification hook. Scripts stored in ~/.claude-profiles/scripts/<name>.sh are executed when the hook fires, with output injected as context. - New src/core/scripts.ts with script management (create, run, fallback) - Notification hook handler alongside existing UserPromptSubmit hook - Updated uninstallHooks to clean up both hook types - 12 new tests for profile script functionality - Updated README.md with Profile Scripts documentation Agent-Logs-Url: https://github.com/julianleopold/claude-profiles/sessions/b0da4803-44f8-4260-bab9-c64055017499 Co-authored-by: julianleopold <91874354+julianleopold@users.noreply.github.com>
…n, remove unused import Agent-Logs-Url: https://github.com/julianleopold/claude-profiles/sessions/b0da4803-44f8-4260-bab9-c64055017499 Co-authored-by: julianleopold <91874354+julianleopold@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add notification start hook for profile-specific settings
feat: add Notification hook for profile startup scripts
Mar 29, 2026
Owner
|
Closing this PR after review. While the idea of profile-specific startup scripts is interesting, this doesn't add meaningful value over what the profile system already provides:
If this capability is needed in the future, it should be designed as a proper startup-only hook with shared logic rather than duplicated inline scripts. Thanks for the contribution idea, but this isn't the right fit for the project. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a Notification hook that executes profile-specific shell scripts (
~/.claude-profiles/scripts/<name>.sh), injecting their output as context. Falls back todefault.shwhen no profile-specific script exists.src/core/scripts.ts— script path resolution, execution withexecFileSync(no shell injection), template creation, fallback logicsrc/hooks/install.ts— Notification hook handler registered alongside existing UserPromptSubmit hook; both install/uninstall are idempotentsrc/postinstall.ts— updated to reflect both hook typesREADME.md— Profile Scripts section, updated directory tree, install notesThe
CLAUDE_PROFILEenv var is set to the active profile name when the script runs.Why
Profiles currently only swap static config files. This extends them to support arbitrary per-profile initialization — environment info, tool checks, project context — via shell scripts that feed output back as Claude context.
Testing
How this was tested:
npm test) — 12 new tests intests/core/scripts.test.ts(51 total)npm run build)Original prompt
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.