Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"hooks": [
{
"type": "command",
"command": "python -m deepwork.hooks.rules_check"
"command": "deepwork hook rules_check"
}
]
}
Expand All @@ -166,7 +166,7 @@
"hooks": [
{
"type": "command",
"command": "python -m deepwork.hooks.rules_check"
"command": "deepwork hook rules_check"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion doc/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ The hooks are installed to `.claude/settings.json` during `deepwork sync`:
{
"hooks": {
"Stop": [
{"matcher": "", "hooks": [{"type": "command", "command": "python -m deepwork.hooks.rules_check"}]}
{"matcher": "", "hooks": [{"type": "command", "command": "deepwork hook rules_check"}]}
]
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/deepwork/core/hooks_syncer.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ def get_command(self, project_path: Path) -> str:
Command string to execute
"""
if self.module:
# Python module - run directly with python -m
return f"python -m {self.module}"
# Python module - use deepwork hook CLI for portability
# Extract hook name from module path (e.g., "deepwork.hooks.rules_check" -> "rules_check")
hook_name = self.module.rsplit(".", 1)[-1]
return f"deepwork hook {hook_name}"
elif self.script:
# Script path is: .deepwork/jobs/{job_name}/hooks/{script}
script_path = self.job_dir / "hooks" / self.script
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_hooks_syncer.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_get_command_for_module(self, temp_dir: Path) -> None:
)

cmd = entry.get_command(temp_dir)
assert cmd == "python -m deepwork.hooks.rules_check"
assert cmd == "deepwork hook rules_check"


class TestJobHooks:
Expand Down