Skip to content

Commit 3590482

Browse files
authored
fix: replace legacy rtk init with hook-first rtk init -g (#72)
* fix: replace legacy rtk init with hook-first rtk init -g (#71) Use `rtk init -g --hook-only --auto-patch` everywhere to avoid workspace artifacts (CLAUDE.md, .rtk/) and context token waste. - claude-code: rtk init → rtk init -g --hook-only --auto-patch - devcontainer: add --hook-only flag - ralphex-fe: add --hook-only flag Closes #71 * chore: track .claude/settings.json project config
1 parent 81dcf20 commit 3590482

4 files changed

Lines changed: 28 additions & 7 deletions

File tree

‎.claude/settings.json‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"model": "opus",
3+
"permissions": {
4+
"allow": [
5+
"Bash(bun:*)",
6+
"Bash(npx:*)",
7+
"Bash(git:*)",
8+
"Bash(mise:*)",
9+
"Bash(curl:*)",
10+
"Bash(ls:*)",
11+
"Bash(mkdir:*)",
12+
"Bash(cat:*)",
13+
"Bash(find:*)"
14+
]
15+
},
16+
"attribution": {
17+
"commit": "",
18+
"pr": ""
19+
}
20+
}

‎.devcontainer/init-plugins.sh‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ for plugin in "${PLUGINS[@]}"; do
4444
}
4545
done
4646

47-
# Initialize rtk global hook for Claude Code (auto-rewrite mode)
47+
# Initialize rtk global hook for Claude Code (auto-rewrite mode).
48+
# --hook-only: installs only the PreToolUse rewrite hook, no workspace artifacts.
4849
echo "Initializing rtk (token optimizer)..."
49-
rtk init -g --auto-patch || {
50+
rtk init -g --hook-only --auto-patch || {
5051
echo "Note: rtk init may have already been configured or rtk not available"
5152
}
5253

‎claude-code/.devcontainer/init-plugins.sh‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ if [ "$(uname -m)" = "aarch64" ] && [ -f "$PLAYWRIGHT_MCP_CONFIG" ]; then
4747
fi
4848

4949
# ── rtk init (token-optimized CLI proxy) ────────────────────────────────────
50-
# Configures rtk for the current workspace. Safe to run multiple times.
51-
# rtk is pre-installed in the devcontainer image.
50+
# Global hook-first mode: installs only the PreToolUse rewrite hook to ~/.claude/,
51+
# no workspace artifacts (CLAUDE.md, .rtk/). Safe to run multiple times.
5252
if command -v rtk &>/dev/null; then
53-
rtk init 2>/dev/null || true
53+
rtk init -g --hook-only --auto-patch 2>/dev/null || true
5454
fi
5555

5656
# ── agent-browser skill ─────────────────────────────────────────────────────

‎ralphex-fe/init-docker.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ if [ -d /mnt/claude ]; then
3030

3131
# ── RTK: ensure rewrite hook is configured ─────────────────────────────
3232
# Host mount usually brings the hook, but init idempotently to cover
33-
# standalone usage (no host mount). Runs as app user for correct paths.
33+
# standalone usage (no host mount). --hook-only avoids workspace artifacts.
3434
if command -v rtk >/dev/null 2>&1; then
35-
gosu app rtk init -g --auto-patch 2>/dev/null || true
35+
gosu app rtk init -g --hook-only --auto-patch 2>/dev/null || true
3636
fi
3737
fi
3838

0 commit comments

Comments
 (0)