claude-memory/graph/configurations/cargo-check-post-edit-hook-for-rust-files-in-claude-code-a2d02a.md
2026-03-01 20:20:38 -06:00

2.4 KiB

id type title tags importance confidence created updated relations
a2d02aea-07fd-4528-8158-f2f42a23a2dd configuration Cargo check post-edit hook for Rust files in Claude Code
sba-scouting
rust
claude-code
hooks
linting
cargo
configuration
developer-experience
0.65 0.8 2026-03-02T00:33:26.804471+00:00 2026-03-02T02:20:38.872040+00:00
target type direction strength edge_id
73646e80-a640-4316-b7c6-54a4330f1b28 RELATED_TO outgoing 0.76 72478c93-188b-4e69-8809-5bfd4132e5a0
target type direction strength edge_id
fc4eb194-1b19-4bb7-8b63-97ae30c8a3e0 RELATED_TO outgoing 0.75 5a1bd148-d2be-4c98-a116-9068e0d7a6ee
target type direction strength edge_id
e9e6a15a-bec3-4b62-98c9-4a70a5165348 RELATED_TO outgoing 0.73 c52bf965-695a-457a-a950-3e824dd87c0e
target type direction strength edge_id
1d64c80d-61ec-434f-902a-3a511e2b92c2 FOLLOWS outgoing 0.6 0e1c4047-45b6-4e4e-92b0-d354a495a23c
target type direction strength edge_id
77c0b897-4124-432f-84de-700ff82dcde1 RELATED_TO outgoing 0.5 b0015c81-b5ab-4972-8811-04dc5ddaebf4
target type direction strength edge_id
be0bda86-d893-4f86-97c4-0ca4e1073121 RELATED_TO incoming 0.8 ceebc50e-6db0-444e-b31d-36344913dc12
target type direction strength edge_id
be0bda86-d893-4f86-97c4-0ca4e1073121 SOLVES incoming 0.95 b5623458-9ace-43ae-ae7e-101d465498ee

Cargo Check Post-Edit Hook Configuration

File

rust/.claude/settings.json

Purpose

Runs cargo check --message-format=short automatically after any Edit or Write to .rs files during a Claude Code session. Provides fast feedback without waiting for a manual build.

Why cargo check (not clippy)

  • cargo clippy is too slow for every single edit (takes several seconds)
  • cargo check is faster — catches type errors and borrow checker issues quickly
  • Clippy should be run manually at logical checkpoints:
    • Before commits
    • After finishing a feature
    • After batch edits to multiple files

Settings JSON Structure

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": { "tool_name": ["Edit", "Write"], "file_paths": [".*\\.rs$"] },
        "hooks": [
          { "type": "command", "command": "cargo check --message-format=short" }
        ]
      }
    ]
  }
}

Documentation

Also documented in rust/CLAUDE.md for future session context.