Returns the path to the settings.json file where hooks are configured
for a given coding agent and scope. The path is not expanded (i.e., ~
is not resolved to the home directory). Use fs::path_expand() if you
need an absolute path.
Usage
settings_path(agent = NULL, scope = c("project", "local", "global"))Arguments
- agent
One of
"claude_code"(or its alias"claude"),"openclaw","codex","cursor","gemini_cli","github_copilot"(or its alias"copilot"), or"posit_ai"(or its alias"posit"). IfNULL(the default), the agent is resolved in order: (1) theWF_AGENTenvironment variable, (2) a scan of the current working directory for a recognised agent config folder (.claude,.cursor, etc.), and (3) a final fallback to"claude_code". SetWF_AGENTin your.Renviron(e.g. withusethis::edit_r_environ()) to avoid passingagentevery time.- scope
One of:
"project":.{agent}/settings.jsonin the current directory."local":.{agent}/settings.local.json(gitignored, for personal overrides)."global":~/.{agent}/settings.json.
