When creating or amending commits:
- Author and committer must always be taken from the local git config (
git config user.name/git config user.email). Never use Claude's own identity. - Never add
Co-Authored-By:trailers of any kind. - Never include any Claude session URLs, session IDs, or links to claude.ai in commit messages or PR descriptions. Commit messages should only describe the code changes.
- Always use
--no-gpg-signto avoid GPG signing.
Before creating any commit, always run and ensure the following pass:
make clippy # Rust lints (wraps cargo clippy)
cargo fmt --check # Formatting check
cargo build # CompilationFix any errors or warnings reported before proceeding with the commit.
The following failures are pre-existing environment issues, not caused by code changes:
-
clippy/rustfmtnot installed for active toolchain: The active toolchain (e.g.1.89.0-x86_64-unknown-linux-gnu) may be missing components. Install them before running checks:rustup component add clippy rustup component add rustfmt
-
make clippyfails with 403 from crates.io: Some crates (e.g.alloc-no-stdlib) fail to download due to network restrictions in the CI environment. This is an infrastructure issue; proceed if the code change does not touch the affected crates. -
cargo buildfails with "Could not findprotoc": Therats-certcrate generates gRPC code at build time and requires the Protocol Buffers compiler. Install it before running checks:apt-get install protobuf-compiler
Before pushing, verify that no commits in the push carry a gpgsig header or a Claude committer identity:
for sha in $(git log --format="%H" origin/$(git rev-parse --abbrev-ref HEAD)..HEAD 2>/dev/null); do
git cat-file -p "$sha" | grep -q "^gpgsig" && echo "ERROR: commit $sha has gpgsig — rewrite with filter-branch before pushing" && exit 1
git log -1 --format="%ce" "$sha" | grep -qi "anthropic" && echo "ERROR: commit $sha has Claude committer — rewrite with filter-branch before pushing" && exit 1
done
echo "Pre-push checks passed"If any commit fails, rewrite the committer with:
git filter-branch -f --env-filter '
if [ "$GIT_COMMITTER_EMAIL" = "noreply@anthropic.com" ]; then
export GIT_COMMITTER_NAME="$(git config user.name)"
export GIT_COMMITTER_EMAIL="$(git config user.email)"
fi
' <base-commit>..HEAD