Add blocking deepwork installation check to SessionStart hook#132
Merged
Add blocking deepwork installation check to SessionStart hook#132
Conversation
Check that the 'deepwork' command is installed and directly invokable before proceeding with a session. If deepwork is not available, display a blocking error (exit code 2) with clear instructions: - Error message explains that deepwork must be directly invokable - Warns against using wrappers like 'uv run deepwork' - Provides installation options (pipx, pip install --user, nix develop) This check runs before the Claude Code version check since hooks cannot function without deepwork being available. https://claude.ai/code/session_01LaPvwtJqYWx4yQArYpkCnH
Change the deepwork installation check from `deepwork --version` to `deepwork rules clear_queue`. This serves double utility: 1. Verifies the deepwork command is installed and directly invokable 2. Clears any stale rules from the queue, ensuring a clean session start https://claude.ai/code/session_014UavMC2aJxUh1uwhhJqz7S Co-authored-by: Claude <noreply@anthropic.com>
* feat: Add deepwork CLI and jobs folder permissions to installer Add required permissions to Claude Code settings.json during sync: - Bash(deepwork:*) for all deepwork CLI commands - Read/Edit/Write for .deepwork/jobs/** for job definitions https://claude.ai/code/session_01NJKQitsNTE3HUcPuDBM7iM * refactor: Simplify permissions to full .deepwork/** access Instead of separate permissions for tmp and jobs subdirectories, grant full Read/Edit/Write access to the entire .deepwork directory. https://claude.ai/code/session_01NJKQitsNTE3HUcPuDBM7iM --------- Co-authored-by: Claude <noreply@anthropic.com>
When deepwork is installed with restrictive permissions (e.g., read-only), shutil.copytree/copy preserve those permissions on copied files. This causes issues when users later try to modify or delete the copied files. Added fix_permissions() utility that ensures user-writable permissions (u+rw for files, u+rwx for directories) while preserving executable bits. Applied to all file copy operations in install.py and fs.py copy_dir(). https://claude.ai/code/session_01QpLzkbcggStMKFCmTcE4Bs Co-authored-by: Claude <noreply@anthropic.com>
The sync_permissions tests were checking for old permission patterns (.deepwork/tmp/**) but the implementation was changed to use broader patterns (.deepwork/**) and deepwork CLI permissions. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a critical blocking check to the
check_version.shSessionStart hook to verify that thedeepworkcommand is installed and directly invokable before allowing any session to proceed. This prevents confusing downstream errors when deepwork is not properly installed.Key Changes
check_deepwork_installed()function that verifiesdeepwork --versioncan be executed directlyuv run deepworkwrappers)additionalContextfor Claude to inform the userImplementation Details