Two issues were identified in the handle-issue.sh script:
1. Incorrect Repository Path
Current behavior:
Repos are cloned to /home/<current_username>/<owner>/<reponame>
Example: /home/claude/fszontagh/agent-manager
Expected behavior:
Repos should be cloned to /home/<current_username>/<reponame>
Example: /home/claude/agent-manager
Location: Line 30 in scripts/handle-issue.sh
2. Claude Command Not Found
Error:
/home/claude/agent-manager/scripts/handle-issue.sh: line 86: claude: command not found
Root cause:
The claude command is installed at /home/claude/.local/bin/claude but this path is not in the shell's PATH environment variable when the script executes via webhook.
Location: Line 86 in scripts/handle-issue.sh
Logs
Repository not found at /home/claude/fszontagh/agent-manager, cloning...
Repository cloned successfully
Working directory: /home/claude/fszontagh/agent-manager
Calling Claude Code with the issue information...
---
/home/claude/agent-manager/scripts/handle-issue.sh: line 86: claude: command not found
---
Solution
Change line 30 from REPO_PATH="$HOME/$OWNER/$REPO" to REPO_PATH="$HOME/$REPO"
Change line 86 from claude -p "$PROMPT" to use full path: /home/claude/.local/bin/claude -p "$PROMPT" or add PATH at the beginning of the script
## Problems
Two issues were identified in the `handle-issue.sh` script:
### 1. Incorrect Repository Path
**Current behavior:**
Repos are cloned to `/home/<current_username>/<owner>/<reponame>`
Example: `/home/claude/fszontagh/agent-manager`
**Expected behavior:**
Repos should be cloned to `/home/<current_username>/<reponame>`
Example: `/home/claude/agent-manager`
**Location:** Line 30 in `scripts/handle-issue.sh`
### 2. Claude Command Not Found
**Error:**
```
/home/claude/agent-manager/scripts/handle-issue.sh: line 86: claude: command not found
```
**Root cause:**
The `claude` command is installed at `/home/claude/.local/bin/claude` but this path is not in the shell's PATH environment variable when the script executes via webhook.
**Location:** Line 86 in `scripts/handle-issue.sh`
## Logs
```
Repository not found at /home/claude/fszontagh/agent-manager, cloning...
Repository cloned successfully
Working directory: /home/claude/fszontagh/agent-manager
Calling Claude Code with the issue information...
---
/home/claude/agent-manager/scripts/handle-issue.sh: line 86: claude: command not found
---
```
## Solution
1. Change line 30 from `REPO_PATH="$HOME/$OWNER/$REPO"` to `REPO_PATH="$HOME/$REPO"`
2. Change line 86 from `claude -p "$PROMPT"` to use full path: `/home/claude/.local/bin/claude -p "$PROMPT"` or add PATH at the beginning of the script
Fixing repository path to use $HOME/$REPO instead of $HOME/$OWNER/$REPO
Adding PATH environment variable or using full path to claude binary
## Implementing Fix
Working on both issues now:
1. Fixing repository path to use `$HOME/$REPO` instead of `$HOME/$OWNER/$REPO`
2. Adding PATH environment variable or using full path to claude binary
Also updated mkdir -p "$HOME/$OWNER" to mkdir -p "$HOME" (line 38)
2. Claude Command PATH Fix (Line 6-7)
Added:
# Add claude binary to PATH
export PATH="$HOME/.local/bin:$PATH"
This ensures the claude command at /home/claude/.local/bin/claude is accessible when the script executes via webhook.
Testing
The fixes ensure:
✅ Repositories are cloned to the correct location: /home/<username>/<reponame>
✅ Claude Code CLI is found and executable from webhook context
✅ No more "claude: command not found" errors
The webhook handler will now correctly clone repositories to the proper path and successfully execute Claude Code for issue automation.
## ✅ Fixed and Deployed
Both issues have been successfully resolved and pushed:
- Commit: `13d7b41` - fix: correct repo path and add claude to PATH (#5)
### Changes Made
#### 1. Repository Path Fix (Line 33)
**Before:**
```bash
REPO_PATH="$HOME/$OWNER/$REPO"
# Result: /home/claude/fszontagh/agent-manager
```
**After:**
```bash
REPO_PATH="$HOME/$REPO"
# Result: /home/claude/agent-manager
```
Also updated `mkdir -p "$HOME/$OWNER"` to `mkdir -p "$HOME"` (line 38)
#### 2. Claude Command PATH Fix (Line 6-7)
**Added:**
```bash
# Add claude binary to PATH
export PATH="$HOME/.local/bin:$PATH"
```
This ensures the `claude` command at `/home/claude/.local/bin/claude` is accessible when the script executes via webhook.
### Testing
The fixes ensure:
- ✅ Repositories are cloned to the correct location: `/home/<username>/<reponame>`
- ✅ Claude Code CLI is found and executable from webhook context
- ✅ No more "claude: command not found" errors
The webhook handler will now correctly clone repositories to the proper path and successfully execute Claude Code for issue automation.
Problems
Two issues were identified in the
handle-issue.shscript:1. Incorrect Repository Path
Current behavior: Repos are cloned to
/home/<current_username>/<owner>/<reponame>Example:
/home/claude/fszontagh/agent-managerExpected behavior: Repos should be cloned to
/home/<current_username>/<reponame>Example:
/home/claude/agent-managerLocation: Line 30 in
scripts/handle-issue.sh2. Claude Command Not Found
Error:
Root cause: The
claudecommand is installed at/home/claude/.local/bin/claudebut this path is not in the shell's PATH environment variable when the script executes via webhook.Location: Line 86 in
scripts/handle-issue.shLogs
Solution
REPO_PATH="$HOME/$OWNER/$REPO"toREPO_PATH="$HOME/$REPO"claude -p "$PROMPT"to use full path:/home/claude/.local/bin/claude -p "$PROMPT"or add PATH at the beginning of the scriptImplementing Fix
Working on both issues now:
$HOME/$REPOinstead of$HOME/$OWNER/$REPO✅ Fixed and Deployed
Both issues have been successfully resolved and pushed:
13d7b41- fix: correct repo path and add claude to PATH (#5)Changes Made
1. Repository Path Fix (Line 33)
Before:
After:
Also updated
mkdir -p "$HOME/$OWNER"tomkdir -p "$HOME"(line 38)2. Claude Command PATH Fix (Line 6-7)
Added:
This ensures the
claudecommand at/home/claude/.local/bin/claudeis accessible when the script executes via webhook.Testing
The fixes ensure:
/home/<username>/<reponame>The webhook handler will now correctly clone repositories to the proper path and successfully execute Claude Code for issue automation.