Common Issues
This page covers frequently encountered issues and their solutions. For each problem, we provide symptoms, causes, and step-by-step solutions.
Agent Issues
Agent Not Found
Symptoms:
Error: cursor: command not found
Error: spawn cursor ENOENTCause: The AI agent CLI is not installed or not in your PATH.
Solutions:
- Verify agent installation:
# For Cursor CLI
which cursor
# For Claude Code
which claude
# For Codex
which codexIf the command returns nothing, the agent isn’t in your PATH.
- Install the agent:
- Add agent to PATH:
If installed but not in PATH, add the installation directory:
# For bash
echo 'export PATH="/path/to/agent:$PATH"' >> ~/.bashrc
source ~/.bashrc
# For zsh
echo 'export PATH="/path/to/agent:$PATH"' >> ~/.zshrc
source ~/.zshrc- Verify Ralph can find the agent:
ralph configCheck that the agent setting matches your installed agent.
Agent Keeps Timing Out
Symptoms:
- Iterations consistently hit the 30-minute timeout
- Ralph retries but times out again
- Tasks are never completed
Causes:
- Tasks are too complex for the timeout window
- Agent is working on large files or complex operations
- System is slow or under heavy load
Solutions:
- Increase the timeout:
Edit ~/.ralph/config.json:
{
"agentTimeoutMs": 3600000
}Common timeout values:
- 1800000 (30 min) — Default, good for most tasks
- 3600000 (1 hour) — Complex refactors
- 5400000 (90 min) — Large migrations
- 7200000 (2 hours) — Extremely complex tasks
- Break tasks into smaller pieces:
# View current task
ralph task current
# If too large, break it down
ralph task remove 3
ralph task add --title "Smaller subtask 1"
ralph task add --title "Smaller subtask 2"- Check system resources:
# CPU usage
top
# Memory usage
free -h
# Disk I/O
iostatIf system is overloaded, close other applications or increase resources.
- Try a different agent:
Some agents work better for certain tasks:
{
"agent": "claude"
}Agent Appears Stuck
Symptoms:
- Agent runs but produces no output for 5+ minutes
- Terminal shows no activity
- Ralph eventually triggers stuck detection
Causes:
- Agent is waiting for user input (shouldn’t happen but can)
- Agent is processing large files
- Network issues (agent can’t reach API)
- Agent crashed but process didn’t exit
Solutions:
- Reduce stuck threshold for faster detection:
{
"stuckThresholdMs": 180000
}- Check agent process:
# Find agent process
ps aux | grep cursor
# If hung, kill it
kill -9 <pid>
# Ralph will detect and retry- Check network connectivity:
# Test internet connection
ping -c 3 google.com
# Check if agent API is reachable
curl -I https://api.cursor.sh- Review logs for clues:
tail -f ~/.ralph/projects/<project>/logs/latest.logLook for:
- Network errors
- API rate limits
- Authentication issues
- Manually complete the task:
If stuck repeatedly on same task:
# Complete it yourself
# ... make the changes ...
# Mark as done
ralph task done 3
ralph progress add "Completed manually due to agent issues"
# Continue with next task
ralph runAgent Produces Errors
Symptoms:
- Agent exits with error code
- Error messages in output
- Iteration fails immediately
Common Errors and Solutions:
“Permission denied”
# Fix file permissions
chmod +x script.sh
# Fix directory permissions
chmod 755 directory/“Module not found”
# Install dependencies
npm install
# or
bun install“Git conflict”
# Resolve conflicts
git status
git diff
# Fix conflicts manually
git add .
git commit“Database connection failed”
# Check database is running
docker ps
# Verify connection string
cat .env
# Test connection
psql -h localhost -U user -d databaseSession Issues
Session Already Running
Symptoms:
Error: A session is already active for this project
Cannot start new session while another is runningCause: Ralph prevents multiple concurrent sessions on the same project to avoid conflicts.
Solutions:
- Check session status:
ralph status- Stop the existing session:
ralph stopWait for graceful shutdown, then start new session:
ralph run- Force kill if unresponsive:
# Find Ralph process
ps aux | grep ralph
# Kill it
kill -9 <pid>
# Clean up session state
ralph clear
# Start fresh
ralph runCan’t Resume Session
Symptoms:
Error: No session to resume
Session file not found or corruptedCauses:
- Session was never started
- Session was cleared
- Session file was deleted or corrupted
- Working in wrong directory
Solutions:
- Check session state:
ralph status- Verify you’re in the right project:
pwd
ralph projects current- Check if session file exists:
ls -la ~/.ralph/projects/<project>/session.json- If corrupted, start fresh:
ralph clear
ralph runSession Progress Lost
Symptoms:
- Progress notes disappeared
- Task completion status reset
- Session appears to start from beginning
Causes:
- Session was cleared with
ralph clear - Working in wrong directory
- Project not properly registered
- Session file was manually deleted
Solutions:
- Verify current project:
ralph projects current- Check if you’re in the right directory:
pwd
git remote -v- List all projects:
ralph projects- Check session file:
cat ~/.ralph/projects/<project>/session.json- If data is truly lost, review logs:
ls ~/.ralph/projects/<project>/logs/
cat ~/.ralph/projects/<project>/logs/2024-01-20.logLogs contain historical progress that can help reconstruct what was done.
Session Won’t Stop
Symptoms:
ralph stophangsCtrl+Cdoesn’t work- Session continues running
Solutions:
- Wait for current iteration to complete:
Ralph tries to stop gracefully, which means waiting for the current iteration to finish.
- Force stop with multiple Ctrl+C:
# Press Ctrl+C twice quickly
^C^C- Kill the process:
# Find Ralph process
ps aux | grep ralph
# Kill it
kill -9 <pid>- Clean up afterward:
ralph status # Verify it stopped
ralph clear # If neededTask Issues
No Tasks Found
Symptoms:
Error: No tasks defined in PRD
PRD file is empty or missingCauses:
- Project not initialized
- PRD file was deleted
- Working in wrong directory
Solutions:
- Initialize the project:
ralph init- Verify PRD file exists:
ls -la ~/.ralph/projects/<project>/prd.json
cat ~/.ralph/projects/<project>/prd.json- Manually add tasks:
ralph task add --title "First task"
ralph task add --title "Second task"Tasks Not Completing
Symptoms:
- Agent appears to finish work
- But task status stays pending
ralph task listshows no progress
Causes:
- Agent isn’t calling
ralph task done - Ralph command not accessible from agent
- Agent doesn’t have permissions to run commands
Solutions:
- Check logs for
ralph task donecalls:
grep "ralph task done" ~/.ralph/projects/<project>/logs/latest.log- Verify Ralph is in agent’s PATH:
# Test from agent's perspective
which ralph- Manually mark task done:
ralph task done 3- Add explicit instruction:
Create or edit ~/.ralph/projects/<project>/instructions.md:
## Completion Protocol
When you finish a task, you MUST run:
```bash
ralph task done <task-number>
ralph progress add "Description of what was done"
### Wrong Task Being Worked On
**Symptoms:**
- Agent working on task 5 when task 3 is pending
- Tasks completed out of order
- Unexpected task in `ralph task current`
**Causes:**
- Tasks were manually marked done incorrectly
- Task status got out of sync
- Multiple sessions running (shouldn't happen)
**Solutions:**
1. **Check current task:**
```bash
ralph task current- View all task statuses:
ralph task list- Fix incorrect completions:
# Mark incorrectly completed tasks as undone
ralph task undone 5
ralph task undone 4
# Verify order
ralph task list- Manually set correct task:
# Complete tasks up to where you want to be
ralph task done 1
ralph task done 2
# Now task 3 will be currentTask Keeps Failing
Symptoms:
- Same task fails repeatedly
- All retries exhausted
- Ralph moves to next task
Causes:
- Task is too complex
- Task description is unclear
- Agent lacks necessary context
- Technical blocker (missing dependency, etc.)
Solutions:
- Review failure logs:
ralph analyze patterns- Break task into smaller subtasks:
ralph task remove 3
ralph task add --title "Subtask 1: Setup"
ralph task add --title "Subtask 2: Implementation"
ralph task add --title "Subtask 3: Testing"- Add more context via guardrails:
ralph guardrails add "For task 3, use the pattern from src/existing-example.ts"- Complete manually and document:
# Do the work yourself
# ... make changes ...
# Mark done with explanation
ralph task done 3
ralph progress add "Completed manually. Agent struggled with X, used Y approach instead."GitHub Issues
Not Authenticated
Symptoms:
Error: Not authenticated with GitHub
GitHub operations require authenticationCause: GitHub credentials not configured or expired.
Solutions:
- Check auth status:
ralph auth- Login:
ralph auth loginFollow the OAuth device flow instructions.
- If using personal access token:
ralph github set-token ghp_xxxxxxxxxxxxx- Verify authentication:
ralph authShould show “Authenticated” status.
Repository Not Found
Symptoms:
Error: Repository not found
Could not detect GitHub repositoryCauses:
- No git remote configured
- Remote doesn’t point to GitHub
- Wrong directory
Solutions:
- Check git remotes:
git remote -vShould show a GitHub URL:
origin git@github.com:user/repo.git (fetch)
origin git@github.com:user/repo.git (push)- Add GitHub remote if missing:
git remote add origin git@github.com:user/repo.git- Verify you’re in the right directory:
pwd
ls -la .git- Check Ralph can detect it:
ralph githubPR Creation Fails
Symptoms:
Error: Failed to create pull request
API error: 422 Unprocessable EntityCauses:
- Branch already exists
- No changes to commit
- Insufficient permissions
- Invalid PR title/body
Solutions:
- Check if branch exists:
git branch -a | grep feature-branch- Verify you have changes:
git status
git diff- Re-authenticate with full permissions:
ralph auth logout
ralph auth loginEnsure you grant repo scope.
- Try creating PR manually:
gh pr create --title "Test" --body "Test"If this works, the issue is with Ralph’s integration.
Configuration Issues
Invalid Configuration
Symptoms:
Error: Invalid configuration
Failed to parse config fileCause: JSON syntax error in config file.
Solutions:
- Validate JSON:
cat ~/.ralph/config.json | jq .If jq reports an error, fix the JSON syntax.
- Common JSON errors:
// Bad: Trailing comma
{
"agent": "cursor",
}
// Good: No trailing comma
{
"agent": "cursor"
}
// Bad: Single quotes
{
'agent': 'cursor'
}
// Good: Double quotes
{
"agent": "cursor"
}- Reset to defaults:
mv ~/.ralph/config.json ~/.ralph/config.json.backup
echo '{"agent": "cursor"}' > ~/.ralph/config.json- Verify configuration:
ralph configSettings Not Taking Effect
Symptoms:
- Changed timeout but still timing out at old value
- Changed agent but still using old one
- Configuration appears ignored
Causes:
- Editing wrong config file (global vs project)
- JSON syntax error (silently ignored)
- Session started before config change
- Environment variable override
Solutions:
- Stop and restart session:
ralph stop
ralph runConfig is loaded at session start.
- Verify which config is active:
ralph config --verboseShows source of each setting.
- Check for syntax errors:
cat ~/.ralph/config.json | jq .
cat ~/.ralph/projects/<project>/config.json | jq .- Check for environment variable overrides:
env | grep RALPHEnvironment variables take precedence over config files.
Memory Issues
Memory Warning
Symptoms:
Warning: Memory usage exceeds 500 MB
Consider reducing maxOutputBufferBytesCause: Ralph’s memory usage is high, usually from large agent output.
Solutions:
- Reduce output buffer:
{
"memory": {
"maxOutputBufferBytes": 2621440
}
}- Clear session and restart:
ralph stop
ralph clear
ralph run- Check for memory leaks:
# Monitor Ralph's memory usage
ps aux | grep ralph
# If growing continuously, report as bug- Increase system memory or close other applications
Out of Memory
Symptoms:
Error: JavaScript heap out of memory
FATAL ERROR: Reached heap limitCause: Ralph ran out of memory, usually on very long sessions.
Solutions:
- Increase Node.js memory limit:
export NODE_OPTIONS="--max-old-space-size=4096"
ralph run- Reduce memory thresholds:
{
"memory": {
"maxOutputBufferBytes": 1048576,
"memoryThresholdMb": 512
}
}- Run shorter sessions:
ralph run 5 # Instead of 20- Clear and restart:
ralph clear
ralph runPerformance Issues
Slow Iterations
Symptoms:
- Each iteration takes very long
- Agent appears slow to respond
- System feels sluggish
Solutions:
- Check system resources:
top
free -h
df -hClose unnecessary applications
Check network speed:
speedtest-cliAgent APIs require good internet connection.
- Try a different agent:
Some agents are faster than others for certain tasks.
High CPU Usage
Symptoms:
- CPU at 100%
- System fans running loud
- Other applications slow
Solutions:
- Check what’s using CPU:
top- If agent process is the culprit:
This is normal during active development. Agent is analyzing code and generating responses.
- Reduce concurrent operations:
Don’t run multiple Ralph sessions simultaneously.
- Increase iteration timeout:
Give agent more time to work without rushing:
{
"agentTimeoutMs": 3600000
}Getting Help
If your issue isn’t listed here:
1. Check Logs
# Latest log
tail -f ~/.ralph/projects/<project>/logs/latest.log
# All logs
ls ~/.ralph/projects/<project>/logs/
# Search for errors
grep -i error ~/.ralph/projects/<project>/logs/*.log2. Search GitHub Issues
Search for your error message or symptoms.
3. Open a New Issue
Include:
- Ralph version:
ralph --version - Agent being used: From
ralph config - Operating system:
uname -a - Error message: Full error text
- Steps to reproduce: What you did before the error
- Logs: Relevant log excerpts
4. Community Support
- GitHub Discussions
- Discord (if available)
- Stack Overflow with
ralph-clitag
Next Steps
- Where to Find Logs — Understanding Ralph’s logging system
- FAQ — Frequently asked questions
- Configuration — Tune Ralph for your needs