Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .claude/hookify.block-traversal-file-path.local.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: block-traversal-file-path
enabled: true
event: file
action: block
tool_matcher: Read|Write|Edit|MultiEdit
conditions:
- field: file_path
operator: contains
pattern: ".."
---

**Path traversal rejected**

The file_path contains `..` which is not allowed. Use an absolute path instead.

Example: `/mnt/mtwo/programs/claude-code/src/file.ts` not `../src/file.ts`
17 changes: 17 additions & 0 deletions .claude/hookify.block-traversal-notebook-path.local.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: block-traversal-notebook-path
enabled: true
event: file
action: block
tool_matcher: NotebookEdit
conditions:
- field: notebook_path
operator: contains
pattern: ".."
---

**Path traversal rejected**

The notebook_path contains `..` which is not allowed. Use an absolute path instead.

Example: `/mnt/mtwo/programs/project/notebook.ipynb` not `../notebook.ipynb`
17 changes: 17 additions & 0 deletions .claude/hookify.block-traversal-path.local.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: block-traversal-path
enabled: true
event: file
action: block
tool_matcher: Glob|Grep
conditions:
- field: path
operator: contains
pattern: ".."
---

**Path traversal rejected**

The path contains `..` which is not allowed. Use an absolute path instead.

Example: `/mnt/mtwo/programs/project/src` not `../src`
17 changes: 17 additions & 0 deletions .claude/hookify.require-absolute-file-path.local.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: require-absolute-file-path
enabled: true
event: file
action: block
tool_matcher: Read|Write|Edit|MultiEdit
conditions:
- field: file_path
operator: regex_match
pattern: ^[^/]
---

**Relative path rejected**

All file_path values must be absolute (start with `/`).

Use the full path like `/mnt/mtwo/programs/project/file.txt`
17 changes: 17 additions & 0 deletions .claude/hookify.require-absolute-notebook-path.local.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: require-absolute-notebook-path
enabled: true
event: file
action: block
tool_matcher: NotebookEdit
conditions:
- field: notebook_path
operator: regex_match
pattern: ^[^/]
---

**Relative path rejected**

All notebook_path values must be absolute (start with `/`).

Use the full path like `/mnt/mtwo/programs/project/notebook.ipynb`
17 changes: 17 additions & 0 deletions .claude/hookify.require-absolute-path.local.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: require-absolute-path
enabled: true
event: file
action: block
tool_matcher: Glob|Grep
conditions:
- field: path
operator: regex_match
pattern: ^[^/]
---

**Relative path rejected**

All path values must be absolute (start with `/`).

Use the full path like `/mnt/mtwo/programs/project/src`
Loading