summaryrefslogtreecommitdiff
path: root/plugins/security-guidance/hooks/_base.py
diff options
context:
space:
mode:
authorMohamed Hegazy <8000722+mhegazy@users.noreply.github.com>2026-10-20 13:27:28 -0700
committerGitHub <noreply@github.com>2026-10-20 13:27:28 -0700
commit7bcf8f3757d158e023b98c151d8091cbf130db91 (patch)
tree39c6290b24268c366c2506cc66fb9a230b0185cd /plugins/security-guidance/hooks/_base.py
parent62bb122f3052d547bdc4e5e2d0e4029fdcb2e8e5 (diff)
parent1eee6df1f032b8719fecdd987273d908d168f467 (diff)
Merge pull request #6812 from anthropics/mhegazy/sg-bootstrap-spawn-cwd
security-guidance: run SDK bootstrap subprocesses from the state dir
Diffstat (limited to 'plugins/security-guidance/hooks/_base.py')
-rw-r--r--plugins/security-guidance/hooks/_base.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/security-guidance/hooks/_base.py b/plugins/security-guidance/hooks/_base.py
index 1daa6642..eecae8b5 100644
--- a/plugins/security-guidance/hooks/_base.py
+++ b/plugins/security-guidance/hooks/_base.py
@@ -33,11 +33,12 @@ def state_dir():
"""
explicit = os.environ.get("SECURITY_WARNINGS_STATE_DIR")
if explicit:
- return os.path.expanduser(explicit)
- cc_config = os.environ.get("CLAUDE_CONFIG_DIR")
- if cc_config:
- return os.path.expanduser(os.path.join(cc_config, "security"))
- return os.path.expanduser("~/.claude/security")
+ d = explicit
+ elif os.environ.get("CLAUDE_CONFIG_DIR"):
+ d = os.path.join(os.environ["CLAUDE_CONFIG_DIR"], "security")
+ else:
+ d = "~/.claude/security"
+ return os.path.abspath(os.path.expanduser(d))
# Debug log file. Lives under the plugin state dir (default ~/.claude/security/)