Skip to content

Troubleshooting

This guide covers common problems and their solutions. Check your issue below.

MCP Connection Issues

MCP server fails to start

Symptom: Error: Cannot find module or MCP tools unavailable in Claude Code

Solutions:

  1. Verify Node.js is installed:
Terminal window
node --version # Should be 22+
  1. Check the script path is absolute (not relative):
Terminal window
# ❌ Bad: "args": ["./preqstation-mcp-server.mjs"]
# ✅ Good: "args": ["/Users/kendrick/projects/preqstation-skill/scripts/preqstation-mcp-server.mjs"]
  1. Verify the script file exists:
Terminal window
ls -la /path/to/preqstation-skill/scripts/preqstation-mcp-server.mjs
  1. Check environment variables are set:
Terminal window
echo $PREQSTATION_API_URL
echo $PREQSTATION_TOKEN
  1. Restart Claude Code or re-add the MCP server:
Terminal window
claude mcp remove preqstation
claude mcp add -s user \
--env='PREQSTATION_API_URL=https://...' \
--env='PREQSTATION_TOKEN=preq_...' \
preqstation -- node /path/to/preqstation-mcp-server.mjs

Tools appear in MCP but return errors

Symptom: preq_list_tasks or other tools fail with 401 Unauthorized

  1. Verify token format (should start with preq_):
Terminal window
echo $PREQSTATION_TOKEN # Should output: preq_xxxxxxxxx
  1. Verify token is not expired:
  • Go to projects-manager UI → Settings → API Keys
  • Check token creation date and expiration
  • Generate a new token if needed
  1. Test connectivity directly:
Terminal window
curl -H "Authorization: Bearer $PREQSTATION_TOKEN" \
"$PREQSTATION_API_URL/api/health"
# Should return: {"status":"ok"}
  1. Verify API URL is correct (must include protocol):
Terminal window
# ❌ Bad: "preqstation-lp.vercel.app"
# ✅ Good: "https://preqstation-lp.vercel.app"

Token & Authentication Issues

”Invalid token” error on every MCP call

Symptom: Token auth fails even with correct-looking token

Check: In projects-manager UI, go to Settings → API Keys and check expiration date.

Fix: Generate a new token:

  1. Click “New Token”
  2. Copy the new token value
  3. Update PREQSTATION_TOKEN environment variable
  4. Re-register MCP server with new token

Worktree & Git Issues

Worktree conflicts or cleanup failures

Symptom: fatal: invalid reference: <branch> or stale worktree directory

Solutions:

  1. List existing worktrees:
Terminal window
git -C <project_cwd> worktree list
  1. Remove stale worktrees:
Terminal window
git -C <project_cwd> worktree remove <path> --force
git -C <project_cwd> worktree prune
  1. If worktree is locked:
Terminal window
git -C <project_cwd> worktree unlock <path>
git -C <project_cwd> worktree remove <path> --force
  1. Check for corrupted .git/worktrees/ directory:
Terminal window
ls -la <project_cwd>/.git/worktrees/
# If corrupted, delete the lock file:
rm <project_cwd>/.git/worktrees/<worktree_name>/locked

Remote push verification fails

Symptom: failed: ... - Remote push verification failed

Cause: deploy_commit_on_review=true requires successful push before completing task.

Check:

Terminal window
git -C <project_cwd> branch -r | grep <branch_name>
# Or:
git ls-remote --heads origin <branch_name>

Fix:

  1. Manually push the branch:
Terminal window
git -C <project_cwd> push origin <branch_name>
  1. Then call preq_complete_task again

Build & Compilation Errors

”npm install” fails in worktree

Symptom: npm ERR! 404 Not Found or dependency resolution errors

Check: Use the package manager already configured by the repo.

Fix: Do not delete lockfiles as a first step. Run the repo’s intended install command instead:

Terminal window
# examples
pnpm install
npm install
yarn install

Project Mapping Issues

”Project path not found”

Symptom: OpenClaw asks for a project path even though you thought it was already configured.

Solutions:

  1. Confirm the mapping exists in OpenClaw agent memory.

  2. If you use the sample MEMORY.md format as a reference, check that the row looks like:

| key | cwd | note |
|-----|-----|------|
| proj | /absolute/path | Description |
  1. Verify the project key matches the task prefix:
  • PRJ-284 should normally map to prj
  1. Ensure paths are absolute (not relative):
./projects/example
# ✅ Good: /Users/kendrick/projects/example

OpenClaw Execution Issues

Session never completes or seems stuck

Symptom: Process shows no output for hours, or stuck at same log line

Solutions:

  1. Check session status:
Terminal window
process action:poll sessionId:<id>
  1. Read last 100 lines of output:
Terminal window
process action:log sessionId:<id> | tail -100
  1. If truly stuck, kill the session:
Terminal window
process action:kill sessionId:<id>
  1. Check for infinite loops or blocking I/O:
Terminal window
# Common causes:
# - npm install hung on network
# - Interactive prompts waiting for input
# - Subprocess blocking on child process

“Permission denied” when accessing project files

Symptom: Error: EACCES: permission denied in worktree

Solutions:

  1. Verify directory permissions:
Terminal window
ls -ld <project_cwd>
# Should be readable/writable by current user
  1. Check worktree permissions:
Terminal window
ls -ld <cwd>
chmod -R u+rw <cwd> # If needed
  1. Ensure Git can write to worktree:
Terminal window
touch <cwd>/.test-write
rm <cwd>/.test-write

Common Mistakes

❌ Forgetting to update OpenClaw project mappings

Issue: OpenClaw can’t resolve project path, requires manual input each time.

Fix: Update the OpenClaw mapping whenever you clone a new project or change paths. If you keep a reference MEMORY.md, keep that in sync too:

| key | cwd | note |
|-----|-----|------|
| newproj | /absolute/path | Added 2026-03-06 |

❌ Using relative paths in project mappings

Issue: Worktree creation fails because path doesn’t expand.

Fix: Always use absolute paths:

Terminal window
# Get absolute path:
pwd # from within the project

❌ Not cleaning up old worktrees

Issue: Disk fills up, performance degrades.

Fix: Periodic cleanup:

Terminal window
git -C <project_cwd> worktree list
git -C <project_cwd> worktree remove <old_path> --force
git -C <project_cwd> worktree prune

❌ Expecting PREQ tools without MCP

Issue: preq_* tools are unavailable because the MCP server was never registered.

Fix: Ensure the PREQSTATION MCP server is registered:

Terminal window
claude mcp list | grep preqstation

Getting Help

If you’ve checked all above:

  1. Gather diagnostics:

    Terminal window
    echo "API URL: $PREQSTATION_API_URL"
    echo "Token format: ${PREQSTATION_TOKEN:0:4}... (masked)"
    node --version
    git --version
    npm --version
  2. Test basic connectivity:

    Terminal window
    curl -H "Authorization: Bearer $PREQSTATION_TOKEN" \
    "$PREQSTATION_API_URL/api/health" | jq .
  3. Check logs:

    • Claude Code: Settings → Logs
    • OpenClaw: Session output via process action:log
    • projects-manager: Vercel dashboard logs
  4. File an issue with:

    • System info (OS, Node version)
    • Error message (full stack trace)
    • Steps to reproduce
    • Diagnostics output (without exposing tokens)