Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .claude/settings.global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"permissions": {
"allow": [
"mcp__atlassian__getJiraIssue"
],
"defaultMode": "auto"
},
"worktree": {
"baseRef": "head"
},
"statusLine": {
"type": "command",
"command": "bash ~/.claude/statusline-command.sh"
},
"editorMode": "vim"
}
15 changes: 0 additions & 15 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
{
"permissions": {
"allow": [
"mcp__atlassian__getJiraIssue"
],
"defaultMode": "auto"
},
"worktree": {
"baseRef": "head"
},
"statusLine": {
"type": "command",
"command": "bash ~/.claude/statusline-command.sh"
},
"editorMode": "vim",
"model": "opus",
"hooks": {
"SessionStart": [
{
Expand Down
6 changes: 5 additions & 1 deletion link-agents.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ link_skills_into() {

# --- Claude Code -----------------------------------------------------------
mkdir -p "$HOME/.claude"
ln $LN_OPTS "$SCRIPT_DIR/.claude/settings.json" "$HOME/.claude/settings.json"
# User-scope settings come from settings.global.json. The sibling
# settings.json holds the dotfiles repo's SessionStart bootstrap hook and
# is read only as *project* settings when working in this repo -- linking
# it at user scope would fire that project-relative hook in every project.
ln $LN_OPTS "$SCRIPT_DIR/.claude/settings.global.json" "$HOME/.claude/settings.json"
ln $LN_OPTS "$SCRIPT_DIR/.claude/statusline-command.sh" "$HOME/.claude/statusline-command.sh"
ln $LN_OPTS "$SCRIPT_DIR/.claude/CLAUDE.md" "$HOME/.claude/CLAUDE.md"
link_skills_into "$HOME/.claude/skills"
Expand Down
14 changes: 12 additions & 2 deletions tests/link-agents.bats
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,21 @@ teardown() {
[ -L "$HOME/.claude/statusline-command.sh" ]
[ -L "$HOME/.claude/CLAUDE.md" ]

# Each link should resolve to a real file inside the repo copy.
[ "$(readlink "$HOME/.claude/settings.json")" = "$SANDBOX_REPO/.claude/settings.json" ]
# Each link should resolve to a real file inside the repo copy. The
# user-scope settings come from settings.global.json, NOT the dotfiles
# project settings.json (which carries the repo-only bootstrap hook).
[ "$(readlink "$HOME/.claude/settings.json")" = "$SANDBOX_REPO/.claude/settings.global.json" ]
[ "$(readlink "$HOME/.claude/CLAUDE.md")" = "$SANDBOX_REPO/.claude/CLAUDE.md" ]
}

@test "global settings carry no project-relative hook; project settings do" {
# The user-scope file must not reference \$CLAUDE_PROJECT_DIR, or its
# hooks would fire (and error) in every project. The project file is
# where the SessionStart bootstrap hook belongs.
! grep -q 'CLAUDE_PROJECT_DIR' "$PROJECT_ROOT/.claude/settings.global.json"
grep -q 'session-start.sh' "$PROJECT_ROOT/.claude/settings.json"
}

@test "links every skill folder under .agent/skills/" {
# Add a synthetic skill alongside whatever real skills exist.
mkdir -p "$SANDBOX_REPO/.agent/skills/synthetic-skill"
Expand Down
Loading