You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
hook claude: a relative CLAUDE_CONFIG_DIR is resolved against the hook's cwd, so deny rules are lost after the agent cds #4676
rtk hook claude reads the user's permission rules from $CLAUDE_CONFIG_DIR/settings.json. When CLAUDE_CONFIG_DIR is relative (.claude-work, or a literal ~/.claude that no shell expanded), rtk resolves it against the hook process's working directory. Claude Code resolves it against the directory it was launched from. The two agree until the agent cds: Claude Code then starts each PreToolUse hook in the new directory, rtk looks for settings.json there, finds none, and rewrites commands that the user's deny rules cover.
Reproduced with Claude Code 2.1.304 against a mock API, with rtk built from develop 6c1af5f. Setup: CLAUDE_CONFIG_DIR='~/.claude', launched from proj/, with {"permissions":{"deny":["Bash(git status)"]}} and rtk hook claude as the PreToolUse hook, both in proj/~/.claude/settings.json.
Bash calls
payload cwd / hook pwd
CLAUDE_PROJECT_DIR
rtk hook
Claude Code result for git status
git status
proj
proj
no output
Permission to use Bash with command git status has been denied.
cd sub, then git status
proj/sub
proj
updatedInput: rtk git status
This command requires approval
Claude Code itself keeps using proj/~/.claude after the cd: it creates no proj/sub/~. The deny becomes a prompt for rtk git status, which an interactive user can accept.
CLAUDE_PROJECT_DIR is the launch directory, not the git root: launched from repo/sub, it is repo/sub. That makes it the base Claude Code uses for a relative CLAUDE_CONFIG_DIR. Resolving a relative value against it in the hook path, and against the process's directory elsewhere, would make rtk read the same file as Claude Code. An absolute or unset CLAUDE_CONFIG_DIR is not affected.
Context: #4247 (closed) asked to expand or reject such values. Claude Code accepts them as given, so rtk has to resolve them the way Claude Code does.
Activity
rtk-wshm-sync-bot commentedon Oct 20, 2026
🔍 Automated Triage
bughighSummary
Relative CLAUDE_CONFIG_DIR is resolved against the hook's cwd instead of CLAUDE_PROJECT_DIR, so deny rules silently become prompts after an agent
cds.📁 Relevant files
src/hook/claude.rssrc/permissions/loader.rsSuggested Actions
cd submust still find proj/.claude/settings.jsonrtk hook checkignores pipeline rules: it reports a rewrite for commands the hook denies or passes through #4629, which also involve hook path/cwd resolution after worktree/cd changesTriaged automatically by wshm · This is an automated analysis, not a human review.