feat: symlink settings.json globally, update bootstrap and readme
This commit is contained in:
@@ -21,25 +21,144 @@
|
||||
"Bash(ls*)"
|
||||
]
|
||||
},
|
||||
"enabledPlugins": {
|
||||
"frontend-design@claude-plugins-official": true,
|
||||
"superpowers@claude-plugins-official": true
|
||||
},
|
||||
"hooks": {
|
||||
"SessionStart": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "/home/artanis/.claude/hooks/peon-ping/peon.sh",
|
||||
"timeout": 10
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "git -C /home/artanis/.cog pull --rebase --autostash 2>/dev/null || true",
|
||||
"statusMessage": "Syncing memory from remote..."
|
||||
"statusMessage": "Syncing Cog memory...",
|
||||
"async": true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"UserPromptSubmit": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "/home/artanis/.claude/hooks/peon-ping/peon.sh",
|
||||
"timeout": 10,
|
||||
"async": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "/home/artanis/.claude/hooks/peon-ping/scripts/hook-handle-use.sh",
|
||||
"timeout": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"Stop": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "/home/artanis/.claude/hooks/peon-ping/peon.sh",
|
||||
"timeout": 10,
|
||||
"async": true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"SessionEnd": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "/home/artanis/.claude/hooks/peon-ping/peon.sh",
|
||||
"timeout": 10,
|
||||
"async": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "cd /home/artanis/.cog && git diff --quiet && git diff --staged --quiet || (git add -A && git commit -m \"chore: sync memory $(date +%Y-%m-%d)\" && git push origin main) 2>/dev/null || true",
|
||||
"statusMessage": "Syncing memory to remote..."
|
||||
"statusMessage": "Saving Cog memory...",
|
||||
"async": true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"Notification": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "/home/artanis/.claude/hooks/peon-ping/peon.sh",
|
||||
"timeout": 10,
|
||||
"async": true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"PermissionRequest": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "/home/artanis/.claude/hooks/peon-ping/peon.sh",
|
||||
"timeout": 10,
|
||||
"async": true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"SubagentStart": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "/home/artanis/.claude/hooks/peon-ping/peon.sh",
|
||||
"timeout": 10,
|
||||
"async": true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"PostToolUseFailure": [
|
||||
{
|
||||
"matcher": "Bash",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "/home/artanis/.claude/hooks/peon-ping/peon.sh",
|
||||
"timeout": 10,
|
||||
"async": true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"PreCompact": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "/home/artanis/.claude/hooks/peon-ping/peon.sh",
|
||||
"timeout": 10,
|
||||
"async": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
40
BOOTSTRAP.md
40
BOOTSTRAP.md
@@ -70,7 +70,31 @@ ln -s /home/artanis/.cog/CLAUDE.md ~/.claude/CLAUDE.md
|
||||
|
||||
---
|
||||
|
||||
## Step 3 — Symlink skills globally
|
||||
## Step 3 — Symlink settings.json globally
|
||||
|
||||
`~/.claude/settings.json` should be a symlink to the Cog settings so hooks and permissions apply in every session.
|
||||
|
||||
Check what's there:
|
||||
|
||||
```bash
|
||||
ls -la ~/.claude/settings.json 2>/dev/null && echo "EXISTS" || echo "NOT FOUND"
|
||||
```
|
||||
|
||||
**If NOT FOUND:** create the symlink:
|
||||
```bash
|
||||
ln -s /home/artanis/.cog/.claude/settings.json ~/.claude/settings.json
|
||||
```
|
||||
|
||||
**If EXISTS and is already a symlink to the right place:** skip.
|
||||
|
||||
**If EXISTS and is a regular file:** replace it:
|
||||
```bash
|
||||
rm ~/.claude/settings.json && ln -s /home/artanis/.cog/.claude/settings.json ~/.claude/settings.json
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Step 4 — Symlink skills globally
|
||||
|
||||
Create the commands directory and symlink all Cog skills into it:
|
||||
|
||||
@@ -93,7 +117,7 @@ done
|
||||
|
||||
---
|
||||
|
||||
## Step 4 — Verify
|
||||
## Step 5 — Verify
|
||||
|
||||
Run a quick sanity check:
|
||||
|
||||
@@ -101,6 +125,9 @@ Run a quick sanity check:
|
||||
# CLAUDE.md symlink resolves correctly
|
||||
readlink ~/.claude/CLAUDE.md
|
||||
|
||||
# settings.json symlink resolves correctly
|
||||
readlink ~/.claude/settings.json
|
||||
|
||||
# Skills are linked
|
||||
ls ~/.claude/commands/ | grep -E "personal|freelance|reflect|evolve"
|
||||
|
||||
@@ -110,19 +137,20 @@ git -C /home/artanis/.cog remote -v
|
||||
```
|
||||
|
||||
Expected:
|
||||
- `readlink` → `/home/artanis/.cog/CLAUDE.md`
|
||||
- First `readlink` → `/home/artanis/.cog/CLAUDE.md`
|
||||
- Second `readlink` → `/home/artanis/.cog/.claude/settings.json`
|
||||
- Skills listed
|
||||
- Repo clean, `origin` points to `https://gitea.bunny-wyvern.ts.net/artanis/Cog-Sync.git`
|
||||
|
||||
---
|
||||
|
||||
## Step 5 — Done
|
||||
## Step 6 — Done
|
||||
|
||||
Tell the user:
|
||||
|
||||
> Cog is set up. CLAUDE.md is active globally. Skills available: `/personal`, `/freelance`, `/reflect`, `/evolve`, `/history`, `/scenario`, `/housekeeping`, `/foresight`, `/explainer`, `/humanizer`.
|
||||
> Cog is set up. CLAUDE.md and settings.json are active globally. Skills available: `/personal`, `/freelance`, `/reflect`, `/evolve`, `/history`, `/scenario`, `/housekeeping`, `/foresight`, `/explainer`, `/humanizer`.
|
||||
>
|
||||
> Memory auto-syncs: pulls from Gitea on session start, pushes on session stop (when working inside `~/.cog`).
|
||||
> Memory auto-syncs in every session: pulls from Gitea on session start, pushes on session end.
|
||||
>
|
||||
> To add domains or reconfigure, open Claude Code in `~/.cog` and run `/setup`.
|
||||
|
||||
|
||||
12
README.md
12
README.md
@@ -54,11 +54,17 @@ memory/cog-meta/self-observations.md merge=union
|
||||
|
||||
If two machines both append observations on the same day, git merges them as a union (keeps both) instead of raising a conflict.
|
||||
|
||||
### Global CLAUDE.md
|
||||
### Global Symlinks
|
||||
|
||||
`~/.claude/CLAUDE.md` is a symlink to `/home/artanis/.cog/CLAUDE.md`. This makes Cog's instructions and memory active in every Claude Code session, regardless of working directory. Skills are similarly symlinked from `~/.cog/.claude/commands/` into `~/.claude/commands/`.
|
||||
Three files are symlinked globally so Cog is active in every Claude Code session regardless of working directory:
|
||||
|
||||
The `CLAUDE.md` includes an explicit base path declaration so memory reads resolve correctly from any working directory:
|
||||
| Symlink | Points to |
|
||||
|---------|-----------|
|
||||
| `~/.claude/CLAUDE.md` | `/home/artanis/.cog/CLAUDE.md` |
|
||||
| `~/.claude/settings.json` | `/home/artanis/.cog/.claude/settings.json` |
|
||||
| `~/.claude/commands/*.md` | `/home/artanis/.cog/.claude/commands/*.md` |
|
||||
|
||||
Symlinking `settings.json` globally is what makes the hooks fire in every session — not just when working inside `~/.cog`. The `CLAUDE.md` includes an explicit base path declaration so memory reads resolve correctly from any working directory:
|
||||
> **Base path**: `/home/artanis/.cog/` — all `memory/` references resolve relative to this directory.
|
||||
|
||||
### Git Remotes
|
||||
|
||||
Reference in New Issue
Block a user