Install command
Provided
Automatically runs cargo check and clippy when Rust files are modified.
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.
#!/bin/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
# Check if this is a Rust file or Cargo configuration
if [[ "$FILE_PATH" == *.rs ]] || [[ "$FILE_PATH" == *Cargo.toml ]] || [[ "$FILE_PATH" == *Cargo.lock ]]; then
echo "🦀 Rust Cargo Check - Analyzing Rust code..."
echo "📄 File: $FILE_PATH"
# Check if cargo is available
if ! command -v cargo >/dev/null 2>&1; then
echo "⚠️ Cargo not found - please install Rust toolchain"
echo "💡 Install from: https://rustup.rs/"
exit 1
fi
# Check if we're in a Rust project
if [ ! -f "Cargo.toml" ]; then
echo "⚠️ No Cargo.toml found - not a Rust project"
exit 0
fi
echo "🔍 Running Rust toolchain checks..."
# Step 1: Run cargo check for fast compilation validation
echo "⚡ Running cargo check (fast compilation check)..."
if cargo check --message-format=short; then
echo "✅ Cargo check passed - code compiles successfully"
else
echo "❌ Cargo check failed - compilation errors found"
echo "💡 Fix compilation errors before proceeding"
exit 1
fi
# Step 2: Run clippy for linting (if available)
echo ""
echo "📋 Running clippy (Rust linter)..."
if command -v cargo-clippy >/dev/null 2>&1 || cargo clippy --version >/dev/null 2>&1; then
if cargo clippy --message-format=short -- -W clippy::pedantic -W clippy::nursery; then
echo "✅ Clippy analysis passed - no linting issues"
else
echo "⚠️ Clippy found linting issues (non-blocking)"
fi
else
echo "ℹ️ Clippy not available - install with: rustup component add clippy"
fi
# Step 3: Check formatting (if rustfmt is available)
echo ""
echo "🎨 Checking code formatting..."
if command -v rustfmt >/dev/null 2>&1; then
if cargo fmt -- --check; then
echo "✅ Code formatting is correct"
else
echo "⚠️ Code formatting issues found"
echo "💡 Run 'cargo fmt' to fix formatting"
fi
else
echo "ℹ️ rustfmt not available - install with: rustup component add rustfmt"
fi
# Step 4: Security audit (if cargo-audit is available)
echo ""
echo "🔒 Running security audit..."
if command -v cargo-audit >/dev/null 2>&1; then
if cargo audit; then
echo "✅ No known security vulnerabilities found"
else
echo "⚠️ Security vulnerabilities detected - review dependencies"
fi
else
echo "ℹ️ cargo-audit not available - install with: cargo install cargo-audit"
fi
# Step 5: Project analysis
echo ""
echo "📊 Project Analysis:"
# Count Rust files
RUST_FILES=$(find . -name "*.rs" -not -path "./target/*" | wc -l)
echo " • Rust files: $RUST_FILES"
# Check for tests
TEST_FILES=$(find . -name "*.rs" -not -path "./target/*" -exec grep -l "#\[test\]\|#\[cfg(test)\]" {} \; | wc -l)
echo " • Files with tests: $TEST_FILES"
# Check dependencies
DEPENDENCIES=$(grep -c '^[a-zA-Z].*=' Cargo.toml 2>/dev/null || echo 0)
echo " • Dependencies: $DEPENDENCIES"
# Check for unsafe blocks
if find . -name "*.rs" -not -path "./target/*" -exec grep -l "unsafe" {} \; | head -1 >/dev/null 2>&1; then
UNSAFE_COUNT=$(find . -name "*.rs" -not -path "./target/*" -exec grep -c "unsafe" {} \; | awk '{sum+=$1} END {print sum}')
echo " • ⚠️ Unsafe blocks found: $UNSAFE_COUNT"
fi
echo ""
echo "💡 Rust Development Tips:"
echo " • Use 'cargo test' to run all tests"
echo " • Use 'cargo build --release' for optimized builds"
echo " • Use 'cargo doc --open' to generate and view documentation"
echo " • Use 'cargo bench' for benchmarking (if available)"
echo " • Consider using 'cargo watch' for continuous testing"
echo ""
echo "🎯 Rust code analysis complete!"
else
echo "ℹ️ File is not a Rust file: $FILE_PATH"
fi
exit 0{
"hooks": {
"postToolUse": {
"script": "./.claude/hooks/rust-cargo-check.sh",
"matchers": [
"write",
"edit"
]
}
}
}.claude/settings.local.json~/.claude/settings.json.claude/settings.json{
"hooks": {
"postToolUse": {
"script": "./.claude/hooks/rust-cargo-check.sh",
"matchers": ["write", "edit"]
}
}
}
#!/bin/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
# Check if this is a Rust file or Cargo configuration
if [[ "$FILE_PATH" == *.rs ]] || [[ "$FILE_PATH" == *Cargo.toml ]] || [[ "$FILE_PATH" == *Cargo.lock ]]; then
echo "🦀 Rust Cargo Check - Analyzing Rust code..."
echo "📄 File: $FILE_PATH"
# Check if cargo is available
if ! command -v cargo >/dev/null 2>&1; then
echo "⚠️ Cargo not found - please install Rust toolchain"
echo "💡 Install from: https://rustup.rs/"
exit 1
fi
# Check if we're in a Rust project
if [ ! -f "Cargo.toml" ]; then
echo "⚠️ No Cargo.toml found - not a Rust project"
exit 0
fi
echo "🔍 Running Rust toolchain checks..."
# Step 1: Run cargo check for fast compilation validation
echo "⚡ Running cargo check (fast compilation check)..."
if cargo check --message-format=short; then
echo "✅ Cargo check passed - code compiles successfully"
else
echo "❌ Cargo check failed - compilation errors found"
echo "💡 Fix compilation errors before proceeding"
exit 1
fi
# Step 2: Run clippy for linting (if available)
echo ""
echo "📋 Running clippy (Rust linter)..."
if command -v cargo-clippy >/dev/null 2>&1 || cargo clippy --version >/dev/null 2>&1; then
if cargo clippy --message-format=short -- -W clippy::pedantic -W clippy::nursery; then
echo "✅ Clippy analysis passed - no linting issues"
else
echo "⚠️ Clippy found linting issues (non-blocking)"
fi
else
echo "ℹ️ Clippy not available - install with: rustup component add clippy"
fi
# Step 3: Check formatting (if rustfmt is available)
echo ""
echo "🎨 Checking code formatting..."
if command -v rustfmt >/dev/null 2>&1; then
if cargo fmt -- --check; then
echo "✅ Code formatting is correct"
else
echo "⚠️ Code formatting issues found"
echo "💡 Run 'cargo fmt' to fix formatting"
fi
else
echo "ℹ️ rustfmt not available - install with: rustup component add rustfmt"
fi
# Step 4: Security audit (if cargo-audit is available)
echo ""
echo "🔒 Running security audit..."
if command -v cargo-audit >/dev/null 2>&1; then
if cargo audit; then
echo "✅ No known security vulnerabilities found"
else
echo "⚠️ Security vulnerabilities detected - review dependencies"
fi
else
echo "ℹ️ cargo-audit not available - install with: cargo install cargo-audit"
fi
# Step 5: Project analysis
echo ""
echo "📊 Project Analysis:"
# Count Rust files
RUST_FILES=$(find . -name "*.rs" -not -path "./target/*" | wc -l)
echo " • Rust files: $RUST_FILES"
# Check for tests
TEST_FILES=$(find . -name "*.rs" -not -path "./target/*" -exec grep -l "#\[test\]\|#\[cfg(test)\]" {} \; | wc -l)
echo " • Files with tests: $TEST_FILES"
# Check dependencies
DEPENDENCIES=$(grep -c '^[a-zA-Z].*=' Cargo.toml 2>/dev/null || echo 0)
echo " • Dependencies: $DEPENDENCIES"
# Check for unsafe blocks
if find . -name "*.rs" -not -path "./target/*" -exec grep -l "unsafe" {} \; | head -1 >/dev/null 2>&1; then
UNSAFE_COUNT=$(find . -name "*.rs" -not -path "./target/*" -exec grep -c "unsafe" {} \; | awk '{sum+=$1} END {print sum}')
echo " • ⚠️ Unsafe blocks found: $UNSAFE_COUNT"
fi
echo ""
echo "💡 Rust Development Tips:"
echo " • Use 'cargo test' to run all tests"
echo " • Use 'cargo build --release' for optimized builds"
echo " • Use 'cargo doc --open' to generate and view documentation"
echo " • Use 'cargo bench' for benchmarking (if available)"
echo " • Consider using 'cargo watch' for continuous testing"
echo ""
echo "🎯 Rust code analysis complete!"
else
echo "ℹ️ File is not a Rust file: $FILE_PATH"
fi
exit 0
Complete hook script that runs cargo check on Rust file changes
#!/bin/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" == *.rs ]] || [[ "$FILE_PATH" == *Cargo.toml ]]; then
if command -v cargo >/dev/null 2>&1 && [ -f "Cargo.toml" ]; then
echo "🦀 Running cargo check..."
if cargo check --message-format=short; then
echo "✅ Cargo check passed"
else
echo "❌ Cargo check failed"
exit 1
fi
fi
fi
exit 0
Complete hook configuration for .claude/settings.json to enable Rust cargo check
{
"hooks": {
"postToolUse": {
"script": "./.claude/hooks/rust-cargo-check.sh",
"matchers": ["write", "edit"]
}
}
}
Enhanced hook script with cargo check, clippy, and rustfmt
#!/bin/bash
INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
if [[ "$FILE_PATH" == *.rs ]] || [[ "$FILE_PATH" == *Cargo.toml ]]; then
if command -v cargo >/dev/null 2>&1 && [ -f "Cargo.toml" ]; then
echo "🦀 Running cargo check..."
cargo check --message-format=short
if command -v cargo-clippy >/dev/null 2>&1 || cargo clippy --version >/dev/null 2>&1; then
echo "📋 Running clippy..."
cargo clippy --message-format=short -- -W clippy::pedantic
fi
if command -v rustfmt >/dev/null 2>&1; then
echo "🎨 Checking formatting..."
cargo fmt -- --check
fi
fi
fi
exit 0
Enhanced hook script with file locking to prevent concurrent cargo check executions
#!/bin/bash
INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
if [[ "$FILE_PATH" == *.rs ]]; then
if command -v cargo >/dev/null 2>&1 && [ -f "Cargo.toml" ]; then
{ flock -n 200 || exit 0; cargo check --message-format=short; } 200>/tmp/cargo-check.lock
fi
fi
exit 0
Example clippy.toml configuration for strict linting
[clippy]
denied-warnings = ["clippy::all"]
warn-on-all-lints = true
[clippy::pedantic]
[clippy::nursery]
Hook searches from file directory upward but may fail in nested workspaces. Add cd logic to find workspace root: while [ ! -f Cargo.toml ] && [ $(pwd) != / ]; do cd ..; done before running cargo commands. Verify workspace structure. Test with various workspace configurations.
Cargo check reuses incremental compilation from target/. Ensure .gitignore excludes target/ but preserve it locally. Use cargo clean selectively or CARGO_TARGET_DIR to separate hook builds from development builds. Verify target directory. Test with various build configurations.
Script treats cargo-audit as optional but doesn't handle network errors. Add CARGO_NET_OFFLINE=true check or wrap in: timeout 5s cargo audit || echo 'Audit skipped (offline)' to prevent hanging on network unavailable. Verify network connectivity. Test with various network configurations.
PostToolUse fires per operation causing parallel cargo check processes. Add flock-based locking: { flock -n 200 || exit 0; cargo check; } 200>/tmp/cargo-check.lock to serialize executions and prevent resource contention. Verify file locking. Test with various concurrent scenarios.
PostToolUse hooks fire after tool completion but file system may buffer writes. Add small delay: sleep 0.1 before cargo check, or verify file timestamp: [ "$FILE_PATH" -nt /tmp/last-check ] to ensure fresh content is analyzed. Verify file timestamps. Test with various file write scenarios.
Configure clippy with clippy.toml to customize lint levels. Use #[allow(clippy::lint_name)] for specific suppressions. Adjust clippy lint groups (pedantic, nursery) based on project needs. Verify clippy configuration. Test with various clippy configurations.
Use incremental compilation with target directory caching. Consider using cargo check --workspace for workspace projects. Use CARGO_TARGET_DIR for separate build directories. Optimize Cargo.toml dependencies. Verify compilation settings. Test with various project sizes.
Configure rustfmt with rustfmt.toml to match project style. Use #[rustfmt::skip] for specific code sections. Customize formatting rules to match project standards. Verify rustfmt configuration. Test with various formatting configurations.
Rust Cargo Check - Hooks side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
| Field | Automatically runs cargo check and clippy when Rust files are modified. Open dossier | Lints Vue 3 components for Composition API best practices and common issues. 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 | Automatically creates timestamped backups of files before modification to prevent data loss. This hook runs before file editing operations (Edit, Write, Multiedit) and creates versioned backups in a centralized .backups directory with ISO 8601-compliant timestamps including nanoseconds for collision prevention. 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-19 | 2025-09-19 | 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 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. | ✓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. | ✓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. | ✓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 |
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.