Compare commits

..

5 Commits

Author SHA1 Message Date
Noah Zweben MacBook
49a24d66e3 Add README and setup documentation for Greptile plugin
Claude-Generated-By: Claude Code (cli/claude-opus-4-5=100%)
Claude-Steers: 2
Claude-Permission-Prompts: 4
Claude-Escapes: 0
2026-01-05 17:51:09 -08:00
Anthony Morris
15b07b46da Merge pull request #114 from anthropics/fix/ralph-wiggum-newline-error
fix(ralph-wiggum): move multi-line bash from command to setup script
2026-01-04 23:16:39 -08:00
Daisy S. Hollman
6d3752c000 Merge pull request #39 from anthropics/daisy/plugins/fix-hookify-imports
Fix hookify plugin import error: No module named 'hookify'
2025-12-18 20:29:39 -08:00
Daisy Hollman
5f2db35c65 Fix hookify plugin import error: No module named 'hookify'
The hook scripts used absolute imports like `from hookify.core.config_loader`
but when installed, the plugin lives in a cache directory with a hash name,
not in a directory named `hookify/`. Python couldn't resolve the package.

Changed to local imports (`from core.X`) which work because PLUGIN_ROOT
is added to sys.path. Also simplified the sys.path setup.

Fixes: https://github.com/anthropics/claude-code/issues/14267

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-19 02:54:38 +00:00
Daisy S. Hollman
4bab8d0f50 Merge pull request #38 from anthropics/daisy/plugins/add-lsp-plugins
Add LSP plugins with inline lspServers configuration
2025-12-18 17:59:19 -08:00
10 changed files with 120 additions and 91 deletions

View File

@@ -1,7 +1,10 @@
{
"name": "greptile",
"description": "AI-powered codebase search and understanding. Query your repositories using natural language to find relevant code, understand dependencies, and get contextual answers about your codebase architecture.",
"description": "AI code review agent for GitHub and GitLab. View and resolve Greptile's PR review comments directly from Claude Code.",
"author": {
"name": "Greptile"
}
"name": "Greptile",
"url": "https://greptile.com"
},
"homepage": "https://greptile.com/docs",
"keywords": ["code-review", "pull-requests", "github", "gitlab", "ai"]
}

View File

@@ -0,0 +1,57 @@
# Greptile
[Greptile](https://greptile.com) is an AI code review agent for GitHub and GitLab that automatically reviews pull requests. This plugin connects Claude Code to your Greptile account, letting you view and resolve Greptile's review comments directly from your terminal.
## Setup
### 1. Create a Greptile Account
Sign up at [greptile.com](https://greptile.com) and connect your GitHub or GitLab repositories.
### 2. Get Your API Key
1. Go to [API Settings](https://app.greptile.com/settings/api)
2. Generate a new API key
3. Copy the key
### 3. Set Environment Variable
Add to your shell profile (`.bashrc`, `.zshrc`, etc.):
```bash
export GREPTILE_API_KEY="your-api-key-here"
```
Then reload your shell or run `source ~/.zshrc`.
## Available Tools
### Pull Request Tools
- `list_pull_requests` - List PRs with optional filtering by repo, branch, author, or state
- `get_merge_request` - Get detailed PR info including review analysis
- `list_merge_request_comments` - Get all comments on a PR with filtering options
### Code Review Tools
- `list_code_reviews` - List code reviews with optional filtering
- `get_code_review` - Get detailed code review information
- `trigger_code_review` - Start a new Greptile review on a PR
### Comment Search
- `search_greptile_comments` - Search across all Greptile review comments
### Custom Context Tools
- `list_custom_context` - List your organization's coding patterns and rules
- `get_custom_context` - Get details for a specific pattern
- `search_custom_context` - Search patterns by content
- `create_custom_context` - Create a new coding pattern
## Example Usage
Ask Claude Code to:
- "Show me Greptile's comments on my current PR and help me resolve them"
- "What issues did Greptile find on PR #123?"
- "Trigger a Greptile review on this branch"
## Documentation
For more information, visit [greptile.com/docs](https://greptile.com/docs).

View File

@@ -7,7 +7,7 @@ from functools import lru_cache
from typing import List, Dict, Any, Optional
# Import from local module
from hookify.core.config_loader import Rule, Condition
from core.config_loader import Rule, Condition
# Cache compiled regexes (max 128 patterns)
@@ -275,7 +275,7 @@ class RuleEngine:
# For testing
if __name__ == '__main__':
from hookify.core.config_loader import Condition, Rule
from core.config_loader import Condition, Rule
# Test rule evaluation
rule = Rule(

View File

@@ -9,18 +9,14 @@ import os
import sys
import json
# CRITICAL: Add plugin root to Python path for imports
# Add plugin root to Python path for imports
PLUGIN_ROOT = os.environ.get('CLAUDE_PLUGIN_ROOT')
if PLUGIN_ROOT:
parent_dir = os.path.dirname(PLUGIN_ROOT)
if parent_dir not in sys.path:
sys.path.insert(0, parent_dir)
if PLUGIN_ROOT not in sys.path:
sys.path.insert(0, PLUGIN_ROOT)
if PLUGIN_ROOT and PLUGIN_ROOT not in sys.path:
sys.path.insert(0, PLUGIN_ROOT)
try:
from hookify.core.config_loader import load_rules
from hookify.core.rule_engine import RuleEngine
from core.config_loader import load_rules
from core.rule_engine import RuleEngine
except ImportError as e:
error_msg = {"systemMessage": f"Hookify import error: {e}"}
print(json.dumps(error_msg), file=sys.stdout)

View File

@@ -9,22 +9,14 @@ import os
import sys
import json
# CRITICAL: Add plugin root to Python path for imports
# We need to add the parent of the plugin directory so Python can find "hookify" package
# Add plugin root to Python path for imports
PLUGIN_ROOT = os.environ.get('CLAUDE_PLUGIN_ROOT')
if PLUGIN_ROOT:
# Add the parent directory of the plugin
parent_dir = os.path.dirname(PLUGIN_ROOT)
if parent_dir not in sys.path:
sys.path.insert(0, parent_dir)
# Also add PLUGIN_ROOT itself in case we have other scripts
if PLUGIN_ROOT not in sys.path:
sys.path.insert(0, PLUGIN_ROOT)
if PLUGIN_ROOT and PLUGIN_ROOT not in sys.path:
sys.path.insert(0, PLUGIN_ROOT)
try:
from hookify.core.config_loader import load_rules
from hookify.core.rule_engine import RuleEngine
from core.config_loader import load_rules
from core.rule_engine import RuleEngine
except ImportError as e:
# If imports fail, allow operation and log error
error_msg = {"systemMessage": f"Hookify import error: {e}"}

View File

@@ -9,18 +9,14 @@ import os
import sys
import json
# CRITICAL: Add plugin root to Python path for imports
# Add plugin root to Python path for imports
PLUGIN_ROOT = os.environ.get('CLAUDE_PLUGIN_ROOT')
if PLUGIN_ROOT:
parent_dir = os.path.dirname(PLUGIN_ROOT)
if parent_dir not in sys.path:
sys.path.insert(0, parent_dir)
if PLUGIN_ROOT not in sys.path:
sys.path.insert(0, PLUGIN_ROOT)
if PLUGIN_ROOT and PLUGIN_ROOT not in sys.path:
sys.path.insert(0, PLUGIN_ROOT)
try:
from hookify.core.config_loader import load_rules
from hookify.core.rule_engine import RuleEngine
from core.config_loader import load_rules
from core.rule_engine import RuleEngine
except ImportError as e:
error_msg = {"systemMessage": f"Hookify import error: {e}"}
print(json.dumps(error_msg), file=sys.stdout)

View File

@@ -9,18 +9,14 @@ import os
import sys
import json
# CRITICAL: Add plugin root to Python path for imports
# Add plugin root to Python path for imports
PLUGIN_ROOT = os.environ.get('CLAUDE_PLUGIN_ROOT')
if PLUGIN_ROOT:
parent_dir = os.path.dirname(PLUGIN_ROOT)
if parent_dir not in sys.path:
sys.path.insert(0, parent_dir)
if PLUGIN_ROOT not in sys.path:
sys.path.insert(0, PLUGIN_ROOT)
if PLUGIN_ROOT and PLUGIN_ROOT not in sys.path:
sys.path.insert(0, PLUGIN_ROOT)
try:
from hookify.core.config_loader import load_rules
from hookify.core.rule_engine import RuleEngine
from core.config_loader import load_rules
from core.rule_engine import RuleEngine
except ImportError as e:
error_msg = {"systemMessage": f"Hookify import error: {e}"}
print(json.dumps(error_msg), file=sys.stdout)

View File

@@ -1,26 +1,18 @@
---
description: "Cancel active Ralph Wiggum loop"
allowed-tools: ["Bash"]
allowed-tools: ["Bash(test -f .claude/ralph-loop.local.md:*)", "Bash(rm .claude/ralph-loop.local.md)", "Read(.claude/ralph-loop.local.md)"]
hide-from-slash-command-tool: "true"
---
# Cancel Ralph
```!
if [[ -f .claude/ralph-loop.local.md ]]; then
ITERATION=$(grep '^iteration:' .claude/ralph-loop.local.md | sed 's/iteration: *//')
echo "FOUND_LOOP=true"
echo "ITERATION=$ITERATION"
else
echo "FOUND_LOOP=false"
fi
```
To cancel the Ralph loop:
Check the output above:
1. Check if `.claude/ralph-loop.local.md` exists using Bash: `test -f .claude/ralph-loop.local.md && echo "EXISTS" || echo "NOT_FOUND"`
1. **If FOUND_LOOP=false**:
- Say "No active Ralph loop found."
2. **If NOT_FOUND**: Say "No active Ralph loop found."
2. **If FOUND_LOOP=true**:
- Use Bash: `rm .claude/ralph-loop.local.md`
- Report: "Cancelled Ralph loop (was at iteration N)" where N is the ITERATION value from above.
3. **If EXISTS**:
- Read `.claude/ralph-loop.local.md` to get the current iteration number from the `iteration:` field
- Remove the file using Bash: `rm .claude/ralph-loop.local.md`
- Report: "Cancelled Ralph loop (was at iteration N)" where N is the iteration value

View File

@@ -11,36 +11,6 @@ Execute the setup script to initialize the Ralph loop:
```!
"${CLAUDE_PLUGIN_ROOT}/scripts/setup-ralph-loop.sh" $ARGUMENTS
# Extract and display completion promise if set
if [ -f .claude/ralph-loop.local.md ]; then
PROMISE=$(grep '^completion_promise:' .claude/ralph-loop.local.md | sed 's/completion_promise: *//' | sed 's/^"\(.*\)"$/\1/')
if [ -n "$PROMISE" ] && [ "$PROMISE" != "null" ]; then
echo ""
echo "═══════════════════════════════════════════════════════════"
echo "CRITICAL - Ralph Loop Completion Promise"
echo "═══════════════════════════════════════════════════════════"
echo ""
echo "To complete this loop, output this EXACT text:"
echo " <promise>$PROMISE</promise>"
echo ""
echo "STRICT REQUIREMENTS (DO NOT VIOLATE):"
echo " ✓ Use <promise> XML tags EXACTLY as shown above"
echo " ✓ The statement MUST be completely and unequivocally TRUE"
echo " ✓ Do NOT output false statements to exit the loop"
echo " ✓ Do NOT lie even if you think you should exit"
echo ""
echo "IMPORTANT - Do not circumvent the loop:"
echo " Even if you believe you're stuck, the task is impossible,"
echo " or you've been running too long - you MUST NOT output a"
echo " false promise statement. The loop is designed to continue"
echo " until the promise is GENUINELY TRUE. Trust the process."
echo ""
echo " If the loop should stop, the promise statement will become"
echo " true naturally. Do not force it by lying."
echo "═══════════════════════════════════════════════════════════"
fi
fi
```
Please work on the task. When you try to exit, the Ralph loop will feed the SAME PROMPT back to you for the next iteration. You'll see your previous work in files and git history, allowing you to iterate and improve.

View File

@@ -174,3 +174,30 @@ if [[ -n "$PROMPT" ]]; then
echo ""
echo "$PROMPT"
fi
# Display completion promise requirements if set
if [[ "$COMPLETION_PROMISE" != "null" ]]; then
echo ""
echo "═══════════════════════════════════════════════════════════"
echo "CRITICAL - Ralph Loop Completion Promise"
echo "═══════════════════════════════════════════════════════════"
echo ""
echo "To complete this loop, output this EXACT text:"
echo " <promise>$COMPLETION_PROMISE</promise>"
echo ""
echo "STRICT REQUIREMENTS (DO NOT VIOLATE):"
echo " ✓ Use <promise> XML tags EXACTLY as shown above"
echo " ✓ The statement MUST be completely and unequivocally TRUE"
echo " ✓ Do NOT output false statements to exit the loop"
echo " ✓ Do NOT lie even if you think you should exit"
echo ""
echo "IMPORTANT - Do not circumvent the loop:"
echo " Even if you believe you're stuck, the task is impossible,"
echo " or you've been running too long - you MUST NOT output a"
echo " false promise statement. The loop is designed to continue"
echo " until the promise is GENUINELY TRUE. Trust the process."
echo ""
echo " If the loop should stop, the promise statement will become"
echo " true naturally. Do not force it by lying."
echo "═══════════════════════════════════════════════════════════"
fi