Skip to content

feat: add --global flag for system-wide hook setup#11

Open
chrismdp wants to merge 1 commit intoJamsusMaximus:mainfrom
chrismdp:feat/global-hooks-setup
Open

feat: add --global flag for system-wide hook setup#11
chrismdp wants to merge 1 commit intoJamsusMaximus:mainfrom
chrismdp:feat/global-hooks-setup

Conversation

@chrismdp
Copy link

@chrismdp chrismdp commented Mar 3, 2026

Summary

  • Add --global flag to codemap-hotel setup command
  • codemap-hotel setup --global writes hooks to ~/.claude/settings.json instead of project-level .claude/settings.local.json
  • Merges hooks into existing global settings, preserving other hooks (e.g. SessionEnd)
  • Removes stale codemap hooks before adding fresh ones (idempotent)
  • Skips Cursor and git hooks in global mode (those are project-specific)

Rationale

For centralised/remote deployments (e.g. a VPS running a single codemap server), you want ALL Claude Code sessions to report activity regardless of which project directory they're in. Project-level hooks require running setup in every project. Global hooks cover everything with one command.

Test plan

  • node bin/setup.js setup --global writes hooks to ~/.claude/settings.json
  • Existing hooks in settings.json (e.g. SessionEnd) are preserved
  • Running twice is idempotent (no duplicate hook entries)
  • node bin/setup.js setup still works for project-level (unchanged)

🤖 Generated with Claude Code

`codemap-hotel setup --global` writes hooks to ~/.claude/settings.json
instead of the project-level settings.local.json. This makes all
Claude Code sessions report activity regardless of which project
they're in, which is needed for remote/centralised deployments.

- Merges hooks into existing global settings (preserves other hooks)
- Removes stale codemap hooks before adding fresh ones
- Skips Cursor and git hooks in global mode (project-specific)

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