Install command
Provided
Automatically run relevant tests when code changes are detected, with intelligent test selection and parallel execution.
Open the source and read safety notes before installing.
Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.
Decision playbook
Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.
0
78
—
No baseline selected
No major trust-signal divergence detected in the current selection.
Confirm ownership and provenance before trusting install instructions.
Source link availableRequired
Open the canonical repository and verify ownership.
Source provenance statusRequired
Marked as source-backed.
Metadata reviewed
Registry metadata indicates a reviewed listing.
Validate risk disclosures before installation or API wiring.
Safety notes presentRequired
Review the listed safety guidance before running commands.
Privacy notes presentRequired
Review data handling notes before connecting accounts or secrets.
Trust level risk gateRequired
Trust level does not block evaluation.
Check package metadata and artifact integrity signals.
Install payload available
Install or copy payload is available for review.
Package verification flag
No package verification flag provided.
Checksum metadata
No checksum provided for downloaded artifact.
Use compare context to validate trade-offs before adoption.
Compare tray has multiple entries
Add at least one more entry to compare trust differences.
Baseline comparison available
No baseline peer selected yet.
Diverging trust signals identified
No major trust-signal divergence found.
Setup at a glance
Copy-ready — paste the snippet to get started.
Install command
Provided
Config snippet
Provided
Copy snippet
Provided
Prerequisites
None
Platforms
1 listed
Difficulty
0/100
Adoption plan
Current risk score 16/100. Use staged verification before broader rollout.
Validate source and review signals before any execution.
Confirm source provenanceRequired
Source URL/provenance metadata is present.
Confirm metadata review state
Listing has review metadata.
Verify install payload
Install/config payload exists and can be inspected.
Confirm safety, privacy, and package integrity signals.
Review safety notesRequired
Safety notes are present.
Review privacy notesRequired
Privacy notes are present.
Verify package integrity metadata
No package verification/checksum metadata.
Adopt in controlled steps based on the selected plan.
Run in isolated sandbox firstRequired
Use a constrained sandbox and observe behavior across multiple tasks.
Roll out graduallyRequired
Roll out to a small cohort before wider usage.
Set monitoring and fallback
Define rollback path and monitor errors after adoption.
Evidence readiness
Required evidence gates are covered (5/6 signals complete).
Source repository/provenance is listed.
Required in this preset
Review metadata is present.
Required in this preset
Safety notes are present.
Required in this preset
Privacy notes are present.
Optional in this preset
Package integrity metadata is missing.
Optional in this preset
Install payload is available.
Required in this preset
Required evidence gates are covered for this preset.
Decision timeline
5/6 steps complete with no blocking gaps for this preset.
triage
Source/provenance metadata is available.
triage
Review metadata is available.
verify
Safety notes are available.
verify
Privacy notes are available.
verify
Package integrity metadata is missing.
rollout
Install payload is available.
No required blockers for this timeline preset.
Safety & privacy surface
1 safety and 1 privacy notes across 2 risk areas. Review closely: credentials & tokens, permissions & scopes.
#!/usr/bin/env bash
# Read the tool input from stdin
INPUT=$(cat)
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name')
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
if [ -z "$FILE_PATH" ]; then
exit 0
fi
echo "🧪 Running tests for $FILE_PATH..."
# Get file extension and directory
EXT="${FILE_PATH##*.}"
DIR=$(dirname "$FILE_PATH")
# Find and run relevant tests based on file type
case "$EXT" in
js|jsx|ts|tsx)
# JavaScript/TypeScript files
if [ -f "package.json" ]; then
if command -v npm &> /dev/null && npm list jest &> /dev/null; then
echo "Running Jest tests..."
npm test -- --testPathPattern="$FILE_PATH" --passWithNoTests 2>/dev/null
elif command -v npm &> /dev/null && npm list vitest &> /dev/null; then
echo "Running Vitest tests..."
npx vitest run "$FILE_PATH" 2>/dev/null
fi
fi
;;
py)
# Python files
if command -v pytest &> /dev/null; then
echo "Running pytest..."
pytest "${FILE_PATH%.*}_test.py" "${DIR}/test_*.py" 2>/dev/null || echo "No Python tests found"
elif command -v python &> /dev/null; then
echo "Running Python unittest..."
python -m unittest discover -s "$DIR" -p "*test*.py" 2>/dev/null || echo "No Python tests found"
fi
;;
go)
# Go files
if command -v go &> /dev/null; then
echo "Running Go tests..."
go test "${DIR}/..." 2>/dev/null || echo "No Go tests found"
fi
;;
java)
# Java files
if command -v mvn &> /dev/null && [ -f "pom.xml" ]; then
echo "Running Maven tests..."
mvn test 2>/dev/null
elif command -v gradle &> /dev/null && [ -f "build.gradle" ]; then
echo "Running Gradle tests..."
gradle test 2>/dev/null
fi
;;
esac
echo "✅ Test execution completed for $FILE_PATH" >&2
exit 0{
"hooks": {
"postToolUse": {
"script": "./.claude/hooks/code-test-runner-hook.sh",
"matchers": [
"write",
"edit",
"multiedit"
]
}
}
}.claude/settings.local.json~/.claude/settings.json.claude/settings.json{
"hooks": {
"postToolUse": {
"script": "./.claude/hooks/code-test-runner-hook.sh",
"matchers": ["write", "edit", "multiedit"]
}
}
}
#!/usr/bin/env bash
# Read the tool input from stdin
INPUT=$(cat)
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name')
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
if [ -z "$FILE_PATH" ]; then
exit 0
fi
echo "🧪 Running tests for $FILE_PATH..."
# Get file extension and directory
EXT="${FILE_PATH##*.}"
DIR=$(dirname "$FILE_PATH")
# Find and run relevant tests based on file type
case "$EXT" in
js|jsx|ts|tsx)
# JavaScript/TypeScript files
if [ -f "package.json" ]; then
if command -v npm &> /dev/null && npm list jest &> /dev/null; then
echo "Running Jest tests..."
npm test -- --testPathPattern="$FILE_PATH" --passWithNoTests 2>/dev/null
elif command -v npm &> /dev/null && npm list vitest &> /dev/null; then
echo "Running Vitest tests..."
npx vitest run "$FILE_PATH" 2>/dev/null
fi
fi
;;
py)
# Python files
if command -v pytest &> /dev/null; then
echo "Running pytest..."
pytest "${FILE_PATH%.*}_test.py" "${DIR}/test_*.py" 2>/dev/null || echo "No Python tests found"
elif command -v python &> /dev/null; then
echo "Running Python unittest..."
python -m unittest discover -s "$DIR" -p "*test*.py" 2>/dev/null || echo "No Python tests found"
fi
;;
go)
# Go files
if command -v go &> /dev/null; then
echo "Running Go tests..."
go test "${DIR}/..." 2>/dev/null || echo "No Go tests found"
fi
;;
java)
# Java files
if command -v mvn &> /dev/null && [ -f "pom.xml" ]; then
echo "Running Maven tests..."
mvn test 2>/dev/null
elif command -v gradle &> /dev/null && [ -f "build.gradle" ]; then
echo "Running Gradle tests..."
gradle test 2>/dev/null
fi
;;
esac
echo "✅ Test execution completed for $FILE_PATH" >&2
exit 0
Complete hook script that automatically runs relevant tests when code changes are detected
#!/usr/bin/env bash
INPUT=$(cat)
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name')
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
if [ -z "$FILE_PATH" ]; then
exit 0
fi
echo "🧪 Running tests for $FILE_PATH..."
EXT="${FILE_PATH##*.}"
DIR=$(dirname "$FILE_PATH")
case "$EXT" in
js|jsx|ts|tsx)
if [ -f "package.json" ]; then
if command -v npm &> /dev/null && npm list jest &> /dev/null; then
echo "Running Jest tests..."
npm test -- --findRelatedTests "$FILE_PATH" --passWithNoTests 2>/dev/null
elif command -v npm &> /dev/null && npm list vitest &> /dev/null; then
echo "Running Vitest tests..."
npx vitest run "$FILE_PATH" 2>/dev/null
fi
fi
;;
py)
if command -v pytest &> /dev/null; then
echo "Running pytest..."
pytest "${FILE_PATH%.*}_test.py" "${DIR}/test_*.py" 2>/dev/null || echo "No Python tests found"
elif command -v python &> /dev/null; then
echo "Running Python unittest..."
python -m unittest discover -s "$DIR" -p "*test*.py" 2>/dev/null || echo "No Python tests found"
fi
;;
go)
if command -v go &> /dev/null; then
echo "Running Go tests..."
go test -timeout 30s "${DIR}/..." 2>/dev/null || echo "No Go tests found"
fi
;;
java)
if command -v mvn &> /dev/null && [ -f "pom.xml" ]; then
echo "Running Maven tests..."
mvn test 2>/dev/null
elif command -v gradle &> /dev/null && [ -f "build.gradle" ]; then
echo "Running Gradle tests..."
gradle test 2>/dev/null
fi
;;
esac
echo "✅ Test execution completed for $FILE_PATH" >&2
exit 0
Complete hook configuration for .claude/settings.json to enable automatic test execution
{
"hooks": {
"postToolUse": {
"script": "./.claude/hooks/test-runner-hook.sh",
"matchers": ["write", "edit", "multiedit"]
}
}
}
Enhanced hook script with parallel test execution, test file filtering, and fail-fast mode
#!/usr/bin/env bash
INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
if [ -z "$FILE_PATH" ]; then
exit 0
fi
if [[ "$FILE_PATH" == *test* ]] || [[ "$FILE_PATH" == *spec* ]]; then
exit 0
fi
echo "🧪 Running tests for $FILE_PATH..."
EXT="${FILE_PATH##*.}"
DIR=$(dirname "$FILE_PATH")
case "$EXT" in
js|jsx|ts|tsx)
if [ -f "package.json" ]; then
if npm list jest &> /dev/null; then
echo "Running Jest tests with parallel execution..."
npm test -- --findRelatedTests "$FILE_PATH" --maxWorkers=4 --passWithNoTests 2>/dev/null
elif npm list vitest &> /dev/null; then
echo "Running Vitest tests with parallel execution..."
npx vitest run "$FILE_PATH" --max-workers=4 2>/dev/null
fi
fi
;;
py)
if command -v pytest &> /dev/null; then
echo "Running pytest with parallel execution..."
pytest "${FILE_PATH%.*}_test.py" "${DIR}/test_*.py" -n auto --maxfail=1 2>/dev/null || echo "No Python tests found"
fi
;;
go)
if command -v go &> /dev/null; then
echo "Running Go tests with parallel execution..."
go test -timeout 30s -parallel 4 "${DIR}/..." 2>/dev/null || echo "No Go tests found"
fi
;;
esac
echo "✅ Test execution completed for $FILE_PATH" >&2
exit 0
Enhanced hook script with smart retry logic for handling flaky tests
#!/usr/bin/env bash
INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
if [ -z "$FILE_PATH" ]; then
exit 0
fi
echo "🧪 Running tests for $FILE_PATH with smart retry..."
EXT="${FILE_PATH##*.}"
DIR=$(dirname "$FILE_PATH")
MAX_RETRIES=3
RETRY_COUNT=0
case "$EXT" in
js|jsx|ts|tsx)
if [ -f "package.json" ]; then
if npm list jest &> /dev/null; then
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
if npm test -- --findRelatedTests "$FILE_PATH" --passWithNoTests 2>/dev/null; then
echo "✅ Tests passed on attempt $((RETRY_COUNT + 1))"
exit 0
else
RETRY_COUNT=$((RETRY_COUNT + 1))
if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
echo "⚠️ Test failed, retrying (attempt $((RETRY_COUNT + 1))/$MAX_RETRIES)..."
sleep 1
fi
fi
done
echo "❌ Tests failed after $MAX_RETRIES attempts"
exit 1
fi
fi
;;
py)
if command -v pytest &> /dev/null; then
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
if pytest "${FILE_PATH%.*}_test.py" "${DIR}/test_*.py" --maxfail=1 2>/dev/null; then
echo "✅ Tests passed on attempt $((RETRY_COUNT + 1))"
exit 0
else
RETRY_COUNT=$((RETRY_COUNT + 1))
if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
echo "⚠️ Test failed, retrying (attempt $((RETRY_COUNT + 1))/$MAX_RETRIES)..."
sleep 1
fi
fi
done
echo "❌ Tests failed after $MAX_RETRIES attempts"
exit 1
fi
;;
esac
echo "✅ Test execution completed for $FILE_PATH" >&2
exit 0
Example test runner hook configuration for customizing test execution behavior
{
"test_runner": {
"enabled": true,
"parallel_execution": true,
"max_workers": 4,
"fail_fast": true,
"max_failures": 1,
"retry_flaky_tests": true,
"max_retries": 3,
"skip_test_files": true,
"frameworks": {
"jest": {
"command": "npm test -- --findRelatedTests",
"parallel": "--maxWorkers=4",
"fail_fast": "--bail"
},
"vitest": {
"command": "npx vitest run",
"parallel": "--max-workers=4",
"fail_fast": "--bail"
},
"pytest": {
"command": "pytest",
"parallel": "-n auto",
"fail_fast": "--maxfail=1"
},
"go": {
"command": "go test",
"parallel": "-parallel 4",
"timeout": "-timeout 30s"
}
},
"file_extensions": ["js", "jsx", "ts", "tsx", "py", "go", "java"],
"exclude_patterns": [
"**/node_modules/**",
"**/vendor/**",
"**/__pycache__/**"
]
}
}
Add file extension filter or test file detection: if [[ "$FILE_PATH" == *test* ]] || [[ "$FILE_PATH" == *spec* ]]; then exit 0; fi to skip running tests when editing test files themselves. Configure matchers to exclude test files. Use debouncing for rapid file changes.
Pattern matches test file paths not source. Use --findRelatedTests instead: npm test -- --findRelatedTests="$FILE_PATH" which finds tests importing the changed file through dependency graph. Verify Jest configuration. Check test file naming conventions.
Detection uses npm list jest which may find both. Add explicit priority: if npm list jest &> /dev/null; then run_jest; exit 0; elif npm list vitest ... to prevent fallthrough. Verify package.json dependencies. Check framework detection logic.
Hook looks for ${FILE_PATH%.*}_test.py and test_*.py. For pytest, use explicit discovery: pytest --collect-only "$DIR" 2>/dev/null | grep "test session starts" to verify test detection. Check pytest configuration. Verify test file naming conventions.
Add timeout flag and scope: go test -timeout 30s "${DIR}" 2>/dev/null instead of ${DIR}/... which tests all subpackages. Or use go test -short for quick tests only during development. Verify Go module structure. Check test execution scope.
Disable parallel execution for tests with shared state: npm test -- --runInBand for Jest, npx vitest run --no-file-parallelism for Vitest, pytest -n 1 for pytest. Configure test isolation. Verify test dependencies.
Use vitest run instead of vitest to avoid watch mode conflicts. Ensure hook runs in non-interactive mode. Configure Vitest for CI/CD environments. Verify Vitest configuration.
Install pytest-xdist: pip install pytest-xdist. Use pytest -n auto for automatic worker count. Verify pytest-xdist installation. Check pytest configuration for parallel execution settings.
Test Runner Hook - Hooks side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
| Field | Automatically run relevant tests when code changes are detected, with intelligent test selection and parallel execution. Open dossier | A PostToolUse hook that runs the matching test runner for a changed file's language — Jest or Vitest for JS/TS, pytest for Python, go test, or Maven/Gradle for Java — scoped to the edited file. Open dossier | Automatically runs Playwright E2E tests when test files or page components are modified. Open dossier | Automated accessibility testing and compliance checking for web applications following WCAG 2.1 and WCAG 2.2 guidelines. This hook automatically runs accessibility scans on HTML files after they are written or edited, using axe-core for comprehensive WCAG compliance testing. Open dossier |
|---|---|---|---|---|
| Next steps | ||||
| Trust | ||||
| Review status | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed |
| Package trust | Package not verified | Package not verified | Package not verified | Package not verified |
| Source provenance | Source-backed | Source-backed | Source-backed | Source-backed |
| Submitter | — | — | — | — |
| Install risk | Review first | Review first | Review first | Review first |
| Notes | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ |
| Brand | — | — | — | — |
| Category | hooks | hooks | hooks | hooks |
| Source | source-backed | source-backed | source-backed | source-backed |
| Author | JSONbored | JSONbored | JSONbored | JSONbored |
| Added | 2025-09-16 | 2025-09-16 | 2025-09-19 | 2025-09-19 |
| Platforms | Claude Code | Claude Code | Claude Code | Claude Code |
| Source repo | — | — | — | — |
| Safety notes | ✓Runs automatically on its configured Claude Code hook event and executes shell logic that can read, modify, or delete files in your project (and may run builds, installs, or network calls); review the script and scope it to expected paths before enabling. | ✓Runs your project's test command automatically after each edit; tests execute arbitrary project code, so enable this only in a trusted repo and expect it to run frequently. The script invokes whichever runner it detects (npm test, npx vitest, pytest, go test, mvn/gradle); make sure the right one is installed so it does not run an unexpected command. | ✓Runs automatically on its configured Claude Code hook event and executes shell logic that can read, modify, or delete files in your project (and may run builds, installs, or network calls); review the script and scope it to expected paths before enabling. | ✓Runs automatically on its configured Claude Code hook event and executes shell logic that can read, modify, or delete files in your project (and may run builds, installs, or network calls); review the script and scope it to expected paths before enabling. |
| Privacy notes | ✓Receives Claude Code hook input (session metadata, file paths, and tool output) and reads local project files; review what the script logs or forwards to external services and keep credentials out of its output. | ✓Runs locally and prints test output to the hook; that output can include file paths, test names, and any data your tests log. | ✓Receives Claude Code hook input (session metadata, file paths, and tool output) and reads local project files; review what the script logs or forwards to external services and keep credentials out of its output. | ✓Receives Claude Code hook input (session metadata, file paths, and tool output) and reads local project files; review what the script logs or forwards to external services and keep credentials out of its output. |
| Prerequisites | — none listed | — none listed | — none listed | — none listed |
| Install | | | | |
| Config | | | | |
| Citations | ||||
| Claim | Unclaimed | Unclaimed | Unclaimed | Unclaimed |
Source-backed guides for putting this to work.
Automate business and engineering processes with headless Claude Code, GitHub Actions, and scheduled routines.
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.