Install command
Provided
Generates and sends a comprehensive summary email to the team when session ends.
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
3 safety and 3 privacy notes across 4 risk areas. Review closely: credentials & tokens, network access.
#!/bin/bash
echo "📧 Team Summary Email Generator - Preparing session summary..."
echo "⏰ Session ended: $(date)"
# Check if email configuration is available
if [ -z "$TEAM_EMAIL" ]; then
echo "ℹ️ TEAM_EMAIL not configured - skipping email summary"
echo "💡 Set TEAM_EMAIL environment variable to enable team notifications"
exit 0
fi
echo "📬 Team email configured: $TEAM_EMAIL"
# Check for email service configuration
EMAIL_METHOD="none"
if [ -n "$SENDGRID_API_KEY" ]; then
EMAIL_METHOD="sendgrid"
echo "📨 Using SendGrid API for email delivery"
elif command -v mail >/dev/null 2>&1; then
EMAIL_METHOD="mail"
echo "📮 Using system mail command for email delivery"
elif command -v sendmail >/dev/null 2>&1; then
EMAIL_METHOD="sendmail"
echo "📫 Using sendmail for email delivery"
else
echo "⚠️ No email service available - install mail command or configure SendGrid"
echo "💡 Install: apt-get install mailutils (Ubuntu) or brew install mailutils (macOS)"
exit 0
fi
echo "🔍 Analyzing session data..."
# Session metadata
SESSION_END=$(date)
SESSION_ID=$(date +%Y%m%d_%H%M%S)
USER=$(whoami 2>/dev/null || echo "developer")
HOST=$(hostname 2>/dev/null || echo "unknown")
WORKDIR=$(pwd)
PROJECT_NAME=$(basename "$WORKDIR" 2>/dev/null || echo "project")
# Git analysis
if git rev-parse --git-dir >/dev/null 2>&1; then
echo "📊 Analyzing git changes..."
BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
FILES_CHANGED=$(git diff --name-only 2>/dev/null | wc -l | tr -d ' ')
FILES_LIST=$(git diff --name-only 2>/dev/null | head -10)
# Get detailed diff stats
DIFF_STATS=$(git diff --stat 2>/dev/null)
INSERTIONS=$(echo "$DIFF_STATS" | tail -1 | grep -oE '[0-9]+ insertion' | grep -oE '[0-9]+' || echo "0")
DELETIONS=$(echo "$DIFF_STATS" | tail -1 | grep -oE '[0-9]+ deletion' | grep -oE '[0-9]+' || echo "0")
# Recent commits
RECENT_COMMITS=$(git log --oneline -5 2>/dev/null || echo "No recent commits")
else
echo "ℹ️ Not a git repository - skipping git analysis"
BRANCH="N/A"
FILES_CHANGED="0"
FILES_LIST="No git repository"
INSERTIONS="0"
DELETIONS="0"
RECENT_COMMITS="No git repository"
fi
# Test results analysis
echo "🧪 Checking test results..."
TEST_RESULTS="No test results available"
if [ -f "package.json" ] && grep -q '"test"' package.json 2>/dev/null; then
echo " • Running npm test..."
if timeout 30 npm test -- --silent --passWithNoTests 2>/dev/null; then
TEST_RESULTS="✅ All tests passed"
else
TEST_RESULTS="❌ Some tests failed - check logs"
fi
elif command -v pytest >/dev/null 2>&1; then
echo " • Running pytest..."
if timeout 30 pytest --tb=no -q 2>/dev/null; then
TEST_RESULTS="✅ All Python tests passed"
else
TEST_RESULTS="❌ Some Python tests failed"
fi
elif [ -f "Cargo.toml" ]; then
echo " • Running cargo test..."
if timeout 30 cargo test --quiet 2>/dev/null; then
TEST_RESULTS="✅ All Rust tests passed"
else
TEST_RESULTS="❌ Some Rust tests failed"
fi
fi
# Build status analysis
echo "🏗️ Checking build status..."
BUILD_STATUS="No build configuration found"
if [ -f "package.json" ] && grep -q '"build"' package.json 2>/dev/null; then
echo " • Running npm build..."
if timeout 60 npm run build >/dev/null 2>&1; then
BUILD_STATUS="✅ Build successful"
else
BUILD_STATUS="❌ Build failed"
fi
elif [ -f "Cargo.toml" ]; then
echo " • Running cargo build..."
if timeout 60 cargo build --quiet 2>/dev/null; then
BUILD_STATUS="✅ Cargo build successful"
else
BUILD_STATUS="❌ Cargo build failed"
fi
fi
# Generate HTML email content
echo "📝 Generating email content..."
HTML_CONTENT=$(cat <<EOF
<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; }
.header { background: #f4f4f4; padding: 20px; border-radius: 5px; }
.section { margin: 20px 0; padding: 15px; border-left: 4px solid #007cba; }
.stats { background: #f9f9f9; padding: 10px; border-radius: 3px; }
pre { background: #f5f5f5; padding: 10px; border-radius: 3px; overflow-x: auto; }
.success { color: #28a745; }
.error { color: #dc3545; }
.info { color: #17a2b8; }
</style>
</head>
<body>
<div class="header">
<h1>🤖 Claude Code Session Summary</h1>
<p><strong>Project:</strong> $PROJECT_NAME</p>
<p><strong>Session ID:</strong> $SESSION_ID</p>
<p><strong>Completed:</strong> $SESSION_END</p>
<p><strong>User:</strong> $USER@$HOST</p>
</div>
<div class="section">
<h2>📊 Development Statistics</h2>
<div class="stats">
<ul>
<li><strong>Branch:</strong> $BRANCH</li>
<li><strong>Files Modified:</strong> $FILES_CHANGED</li>
<li><strong>Lines Added:</strong> $INSERTIONS</li>
<li><strong>Lines Removed:</strong> $DELETIONS</li>
</ul>
</div>
</div>
<div class="section">
<h2>📁 Modified Files</h2>
<pre>$FILES_LIST</pre>
</div>
<div class="section">
<h2>🧪 Test Results</h2>
<p>$TEST_RESULTS</p>
</div>
<div class="section">
<h2>🏗️ Build Status</h2>
<p>$BUILD_STATUS</p>
</div>
<div class="section">
<h2>📝 Recent Commits</h2>
<pre>$RECENT_COMMITS</pre>
</div>
<div class="section">
<h2>💡 Next Steps</h2>
<ul>
<li>Review changes and test thoroughly</li>
<li>Update documentation if needed</li>
<li>Consider code review for significant changes</li>
<li>Merge changes when ready</li>
</ul>
</div>
<hr>
<p><small>Generated automatically by Claude Code Team Summary Hook</small></p>
</body>
</html>
EOF
)
# Send email based on available method
SUBJECT="Claude Code Session Summary - $PROJECT_NAME ($SESSION_END)"
echo "📤 Sending email via $EMAIL_METHOD..."
case "$EMAIL_METHOD" in
"sendgrid")
SENDGRID_PAYLOAD=$(cat <<EOF
{
"personalizations": [{
"to": [{"email": "$TEAM_EMAIL"}]
}],
"from": {"email": "claude@yourdomain.com", "name": "Claude Code"},
"subject": "$SUBJECT",
"content": [{
"type": "text/html",
"value": "$(echo "$HTML_CONTENT" | sed 's/"/\\"/g')"
}]
}
EOF
)
if curl -X POST \
-H "Authorization: Bearer $SENDGRID_API_KEY" \
-H "Content-Type: application/json" \
-d "$SENDGRID_PAYLOAD" \
"https://api.sendgrid.com/v3/mail/send" \
--silent --show-error 2>/dev/null; then
echo "✅ Email sent successfully via SendGrid"
else
echo "❌ Failed to send email via SendGrid"
fi
;;
"mail")
echo "$HTML_CONTENT" | mail -s "$SUBJECT" -a "Content-Type: text/html" "$TEAM_EMAIL"
echo "✅ Email sent via system mail command"
;;
"sendmail")
{
echo "To: $TEAM_EMAIL"
echo "Subject: $SUBJECT"
echo "Content-Type: text/html"
echo ""
echo "$HTML_CONTENT"
} | sendmail "$TEAM_EMAIL"
echo "✅ Email sent via sendmail"
;;
esac
echo ""
echo "💡 Email Configuration Tips:"
echo " • Set TEAM_EMAIL environment variable"
echo " • For SendGrid: Set SENDGRID_API_KEY"
echo " • For system mail: Install mailutils package"
echo " • Configure SMTP settings in your system"
echo ""
echo "🎯 Team summary email generation complete!"
exit 0{
"hooks": {
"stop": {
"script": "./.claude/hooks/team-summary-email-generator.sh",
"matchers": [
"*"
]
}
}
}.claude/settings.local.json~/.claude/settings.json.claude/settings.json{
"hooks": {
"stop": {
"script": "./.claude/hooks/team-summary-email-generator.sh",
"matchers": ["*"]
}
}
}
#!/bin/bash
echo "📧 Team Summary Email Generator - Preparing session summary..."
echo "⏰ Session ended: $(date)"
# Check if email configuration is available
if [ -z "$TEAM_EMAIL" ]; then
echo "ℹ️ TEAM_EMAIL not configured - skipping email summary"
echo "💡 Set TEAM_EMAIL environment variable to enable team notifications"
exit 0
fi
echo "📬 Team email configured: $TEAM_EMAIL"
# Check for email service configuration
EMAIL_METHOD="none"
if [ -n "$SENDGRID_API_KEY" ]; then
EMAIL_METHOD="sendgrid"
echo "📨 Using SendGrid API for email delivery"
elif command -v mail >/dev/null 2>&1; then
EMAIL_METHOD="mail"
echo "📮 Using system mail command for email delivery"
elif command -v sendmail >/dev/null 2>&1; then
EMAIL_METHOD="sendmail"
echo "📫 Using sendmail for email delivery"
else
echo "⚠️ No email service available - install mail command or configure SendGrid"
echo "💡 Install: apt-get install mailutils (Ubuntu) or brew install mailutils (macOS)"
exit 0
fi
echo "🔍 Analyzing session data..."
# Session metadata
SESSION_END=$(date)
SESSION_ID=$(date +%Y%m%d_%H%M%S)
USER=$(whoami 2>/dev/null || echo "developer")
HOST=$(hostname 2>/dev/null || echo "unknown")
WORKDIR=$(pwd)
PROJECT_NAME=$(basename "$WORKDIR" 2>/dev/null || echo "project")
# Git analysis
if git rev-parse --git-dir >/dev/null 2>&1; then
echo "📊 Analyzing git changes..."
BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
FILES_CHANGED=$(git diff --name-only 2>/dev/null | wc -l | tr -d ' ')
FILES_LIST=$(git diff --name-only 2>/dev/null | head -10)
# Get detailed diff stats
DIFF_STATS=$(git diff --stat 2>/dev/null)
INSERTIONS=$(echo "$DIFF_STATS" | tail -1 | grep -oE '[0-9]+ insertion' | grep -oE '[0-9]+' || echo "0")
DELETIONS=$(echo "$DIFF_STATS" | tail -1 | grep -oE '[0-9]+ deletion' | grep -oE '[0-9]+' || echo "0")
# Recent commits
RECENT_COMMITS=$(git log --oneline -5 2>/dev/null || echo "No recent commits")
else
echo "ℹ️ Not a git repository - skipping git analysis"
BRANCH="N/A"
FILES_CHANGED="0"
FILES_LIST="No git repository"
INSERTIONS="0"
DELETIONS="0"
RECENT_COMMITS="No git repository"
fi
# Test results analysis
echo "🧪 Checking test results..."
TEST_RESULTS="No test results available"
if [ -f "package.json" ] && grep -q '"test"' package.json 2>/dev/null; then
echo " • Running npm test..."
if timeout 30 npm test -- --silent --passWithNoTests 2>/dev/null; then
TEST_RESULTS="✅ All tests passed"
else
TEST_RESULTS="❌ Some tests failed - check logs"
fi
elif command -v pytest >/dev/null 2>&1; then
echo " • Running pytest..."
if timeout 30 pytest --tb=no -q 2>/dev/null; then
TEST_RESULTS="✅ All Python tests passed"
else
TEST_RESULTS="❌ Some Python tests failed"
fi
elif [ -f "Cargo.toml" ]; then
echo " • Running cargo test..."
if timeout 30 cargo test --quiet 2>/dev/null; then
TEST_RESULTS="✅ All Rust tests passed"
else
TEST_RESULTS="❌ Some Rust tests failed"
fi
fi
# Build status analysis
echo "🏗️ Checking build status..."
BUILD_STATUS="No build configuration found"
if [ -f "package.json" ] && grep -q '"build"' package.json 2>/dev/null; then
echo " • Running npm build..."
if timeout 60 npm run build >/dev/null 2>&1; then
BUILD_STATUS="✅ Build successful"
else
BUILD_STATUS="❌ Build failed"
fi
elif [ -f "Cargo.toml" ]; then
echo " • Running cargo build..."
if timeout 60 cargo build --quiet 2>/dev/null; then
BUILD_STATUS="✅ Cargo build successful"
else
BUILD_STATUS="❌ Cargo build failed"
fi
fi
# Generate HTML email content
echo "📝 Generating email content..."
HTML_CONTENT=$(cat <<EOF
<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; }
.header { background: #f4f4f4; padding: 20px; border-radius: 5px; }
.section { margin: 20px 0; padding: 15px; border-left: 4px solid #007cba; }
.stats { background: #f9f9f9; padding: 10px; border-radius: 3px; }
pre { background: #f5f5f5; padding: 10px; border-radius: 3px; overflow-x: auto; }
.success { color: #28a745; }
.error { color: #dc3545; }
.info { color: #17a2b8; }
</style>
</head>
<body>
<div class="header">
<h1>🤖 Claude Code Session Summary</h1>
<p><strong>Project:</strong> $PROJECT_NAME</p>
<p><strong>Session ID:</strong> $SESSION_ID</p>
<p><strong>Completed:</strong> $SESSION_END</p>
<p><strong>User:</strong> $USER@$HOST</p>
</div>
<div class="section">
<h2>📊 Development Statistics</h2>
<div class="stats">
<ul>
<li><strong>Branch:</strong> $BRANCH</li>
<li><strong>Files Modified:</strong> $FILES_CHANGED</li>
<li><strong>Lines Added:</strong> $INSERTIONS</li>
<li><strong>Lines Removed:</strong> $DELETIONS</li>
</ul>
</div>
</div>
<div class="section">
<h2>📁 Modified Files</h2>
<pre>$FILES_LIST</pre>
</div>
<div class="section">
<h2>🧪 Test Results</h2>
<p>$TEST_RESULTS</p>
</div>
<div class="section">
<h2>🏗️ Build Status</h2>
<p>$BUILD_STATUS</p>
</div>
<div class="section">
<h2>📝 Recent Commits</h2>
<pre>$RECENT_COMMITS</pre>
</div>
<div class="section">
<h2>💡 Next Steps</h2>
<ul>
<li>Review changes and test thoroughly</li>
<li>Update documentation if needed</li>
<li>Consider code review for significant changes</li>
<li>Merge changes when ready</li>
</ul>
</div>
<hr>
<p><small>Generated automatically by Claude Code Team Summary Hook</small></p>
</body>
</html>
EOF
)
# Send email based on available method
SUBJECT="Claude Code Session Summary - $PROJECT_NAME ($SESSION_END)"
echo "📤 Sending email via $EMAIL_METHOD..."
case "$EMAIL_METHOD" in
"sendgrid")
SENDGRID_PAYLOAD=$(cat <<EOF
{
"personalizations": [{
"to": [{"email": "$TEAM_EMAIL"}]
}],
"from": {"email": "claude@yourdomain.com", "name": "Claude Code"},
"subject": "$SUBJECT",
"content": [{
"type": "text/html",
"value": "$(echo "$HTML_CONTENT" | sed 's/"/\\"/g')"
}]
}
EOF
)
if curl -X POST \
-H "Authorization: Bearer $SENDGRID_API_KEY" \
-H "Content-Type: application/json" \
-d "$SENDGRID_PAYLOAD" \
"https://api.sendgrid.com/v3/mail/send" \
--silent --show-error 2>/dev/null; then
echo "✅ Email sent successfully via SendGrid"
else
echo "❌ Failed to send email via SendGrid"
fi
;;
"mail")
echo "$HTML_CONTENT" | mail -s "$SUBJECT" -a "Content-Type: text/html" "$TEAM_EMAIL"
echo "✅ Email sent via system mail command"
;;
"sendmail")
{
echo "To: $TEAM_EMAIL"
echo "Subject: $SUBJECT"
echo "Content-Type: text/html"
echo ""
echo "$HTML_CONTENT"
} | sendmail "$TEAM_EMAIL"
echo "✅ Email sent via sendmail"
;;
esac
echo ""
echo "💡 Email Configuration Tips:"
echo " • Set TEAM_EMAIL environment variable"
echo " • For SendGrid: Set SENDGRID_API_KEY"
echo " • For system mail: Install mailutils package"
echo " • Configure SMTP settings in your system"
echo ""
echo "🎯 Team summary email generation complete!"
exit 0
Complete hook script that generates and sends team summary emails on session end
#!/bin/bash
echo "📧 Team Summary Email Generator - Preparing session summary..."
SESSION_END=$(date)
SESSION_ID=$(date +%Y%m%d_%H%M%S)
if [ -z "$TEAM_EMAIL" ]; then
exit 0
fi
if [ -n "$SENDGRID_API_KEY" ]; then
EMAIL_METHOD="sendgrid"
elif command -v mail >/dev/null 2>&1; then
EMAIL_METHOD="mail"
else
exit 0
fi
PROJECT_NAME=$(basename "$(pwd)" 2>/dev/null || echo 'project')
BRANCH=$(git branch --show-current 2>/dev/null || echo 'unknown')
FILES_CHANGED=$(git diff --name-only 2>/dev/null | wc -l | tr -d ' ')
HTML_CONTENT="<!DOCTYPE html><html><head><style>body{font-family:Arial,sans-serif;line-height:1.6;color:#333;}.header{background:#f4f4f4;padding:20px;border-radius:5px;}.section{margin:20px 0;padding:15px;border-left:4px solid #007cba;}</style></head><body><div class=\"header\"><h1>🤖 Claude Code Session Summary</h1><p><strong>Project:</strong> $PROJECT_NAME</p><p><strong>Session ID:</strong> $SESSION_ID</p><p><strong>Completed:</strong> $SESSION_END</p></div><div class=\"section\"><h2>📊 Development Statistics</h2><p><strong>Branch:</strong> $BRANCH</p><p><strong>Files Modified:</strong> $FILES_CHANGED</p></div></body></html>"
SUBJECT="Claude Code Session Summary - $PROJECT_NAME ($SESSION_END)"
if [ "$EMAIL_METHOD" = "sendgrid" ]; then
jq -n --arg to "$TEAM_EMAIL" --arg subject "$SUBJECT" --arg html "$HTML_CONTENT" '{"personalizations":[{"to":[{"email":$to}]}],"from":{"email":"claude@yourdomain.com","name":"Claude Code"},"subject":$subject,"content":[{"type":"text/html","value":$html}]}' | curl -X POST -H "Authorization: Bearer $SENDGRID_API_KEY" -H "Content-Type: application/json" -d @- "https://api.sendgrid.com/v3/mail/send" --silent >/dev/null 2>&1
elif [ "$EMAIL_METHOD" = "mail" ]; then
echo "$HTML_CONTENT" | mail -s "$SUBJECT" -a "Content-Type: text/html" "$TEAM_EMAIL"
fi
echo "🎯 Team summary email generation complete!"
exit 0
Complete hook configuration for .claude/settings.json to enable team summary emails
{
"hooks": {
"stop": {
"script": "./.claude/hooks/team-summary-email-generator.sh",
"matchers": ["*"]
}
}
}
Enhanced hook script with comprehensive Git analysis, test results, and build status
#!/bin/bash
INPUT=$(cat)
SESSION_END=$(date)
SESSION_ID=$(date +%Y%m%d_%H%M%S)
PROJECT_NAME=$(basename "$(pwd)" 2>/dev/null || echo 'project')
BRANCH=$(git branch --show-current 2>/dev/null || echo 'unknown')
FILES_CHANGED=$(git diff --name-only 2>/dev/null | wc -l | tr -d ' ')
DIFF_STATS=$(git diff --stat 2>/dev/null)
INSERTIONS=$(echo "$DIFF_STATS" | tail -1 | grep -oE '[0-9]+ insertion' | grep -oE '[0-9]+' || echo "0")
DELETIONS=$(echo "$DIFF_STATS" | tail -1 | grep -oE '[0-9]+ deletion' | grep -oE '[0-9]+' || echo "0")
RECENT_COMMITS=$(git log --oneline -5 2>/dev/null || echo "No recent commits")
TEST_RESULTS="No test results available"
if [ -f "package.json" ] && grep -q '"test"' package.json 2>/dev/null; then
if timeout 30 npm test -- --silent --passWithNoTests 2>/dev/null; then
TEST_RESULTS="✅ All tests passed"
else
TEST_RESULTS="❌ Some tests failed"
fi
fi
BUILD_STATUS="No build configuration found"
if [ -f "package.json" ] && grep -q '"build"' package.json 2>/dev/null; then
if timeout 60 npm run build >/dev/null 2>&1; then
BUILD_STATUS="✅ Build successful"
else
BUILD_STATUS="❌ Build failed"
fi
fi
HTML_CONTENT="<!DOCTYPE html><html><head><style>body{font-family:Arial,sans-serif;line-height:1.6;color:#333;}.header{background:#f4f4f4;padding:20px;border-radius:5px;}.section{margin:20px 0;padding:15px;border-left:4px solid #007cba;}.stats{background:#f9f9f9;padding:10px;border-radius:3px;}</style></head><body><div class=\"header\"><h1>🤖 Claude Code Session Summary</h1><p><strong>Project:</strong> $PROJECT_NAME</p><p><strong>Session ID:</strong> $SESSION_ID</p><p><strong>Completed:</strong> $SESSION_END</p></div><div class=\"section\"><h2>📊 Development Statistics</h2><div class=\"stats\"><ul><li><strong>Branch:</strong> $BRANCH</li><li><strong>Files Modified:</strong> $FILES_CHANGED</li><li><strong>Lines Added:</strong> $INSERTIONS</li><li><strong>Lines Removed:</strong> $DELETIONS</li></ul></div></div><div class=\"section\"><h2>🧪 Test Results</h2><p>$TEST_RESULTS</p></div><div class=\"section\"><h2>🏗️ Build Status</h2><p>$BUILD_STATUS</p></div><div class=\"section\"><h2>📝 Recent Commits</h2><pre>$RECENT_COMMITS</pre></div></body></html>"
SUBJECT="Claude Code Session Summary - $PROJECT_NAME ($SESSION_END)"
if [ -n "$SENDGRID_API_KEY" ] && [ -n "$TEAM_EMAIL" ]; then
jq -n --arg to "$TEAM_EMAIL" --arg subject "$SUBJECT" --arg html "$HTML_CONTENT" '{"personalizations":[{"to":[{"email":$to}]}],"from":{"email":"claude@yourdomain.com","name":"Claude Code"},"subject":$subject,"content":[{"type":"text/html","value":$html}]}' | curl -X POST -H "Authorization: Bearer $SENDGRID_API_KEY" -H "Content-Type: application/json" -d @- "https://api.sendgrid.com/v3/mail/send" --silent >/dev/null 2>&1
echo "✅ Email sent successfully via SendGrid"
elif command -v mail >/dev/null 2>&1 && [ -n "$TEAM_EMAIL" ]; then
echo "$HTML_CONTENT" | mail -s "$SUBJECT" -a "Content-Type: text/html" "$TEAM_EMAIL"
echo "✅ Email sent via system mail command"
fi
exit 0
Enhanced hook script with responsive HTML email template and modern styling
#!/bin/bash
SESSION_END=$(date)
SESSION_ID=$(date +%Y%m%d_%H%M%S)
PROJECT_NAME=$(basename "$(pwd)" 2>/dev/null || echo 'project')
USER=$(whoami 2>/dev/null || echo 'developer')
HOST=$(hostname 2>/dev/null || echo 'unknown')
BRANCH=$(git branch --show-current 2>/dev/null || git rev-parse --short HEAD 2>/dev/null || echo 'unknown')
FILES_LIST=$(git diff --name-only 2>/dev/null | head -10 | tr '\n' ',' | sed 's/,$//')
HTML_CONTENT="<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><style>body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;line-height:1.6;color:#333;max-width:800px;margin:0 auto;padding:20px;}.header{background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);color:#fff;padding:30px;border-radius:8px;margin-bottom:20px;}.section{background:#fff;border:1px solid #e0e0e0;border-radius:8px;padding:20px;margin-bottom:15px;box-shadow:0 2px 4px rgba(0,0,0,0.1);}.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:15px;margin-top:15px;}.stat-item{background:#f8f9fa;padding:15px;border-radius:6px;text-align:center;}.stat-value{font-size:24px;font-weight:bold;color:#667eea;}.stat-label{font-size:12px;color:#666;margin-top:5px;}</style></head><body><div class=\"header\"><h1>🤖 Claude Code Session Summary</h1><p>Project: $PROJECT_NAME | Session: $SESSION_ID</p><p>Completed: $SESSION_END | User: $USER@$HOST</p></div><div class=\"section\"><h2>📊 Development Statistics</h2><div class=\"stats\"><div class=\"stat-item\"><div class=\"stat-value\">$BRANCH</div><div class=\"stat-label\">Branch</div></div></div><p><strong>Modified Files:</strong> $FILES_LIST</p></div></body></html>"
SUBJECT="Claude Code Session Summary - $PROJECT_NAME"
if [ -n "$SENDGRID_API_KEY" ] && [ -n "$TEAM_EMAIL" ]; then
jq -n --arg to "$TEAM_EMAIL" --arg subject "$SUBJECT" --arg html "$HTML_CONTENT" '{"personalizations":[{"to":[{"email":$to}]}],"from":{"email":"claude@yourdomain.com","name":"Claude Code"},"subject":$subject,"content":[{"type":"text/html","value":$html}]}' | curl -X POST -H "Authorization: Bearer $SENDGRID_API_KEY" -H "Content-Type: application/json" -d @- "https://api.sendgrid.com/v3/mail/send" --silent >/dev/null 2>&1
fi
exit 0
Example team summary email generator configuration for customizing email behavior
{
"email": {
"team_email": "$TEAM_EMAIL",
"sendgrid_api_key": "$SENDGRID_API_KEY",
"from_email": "claude@yourdomain.com",
"from_name": "Claude Code",
"include_git_stats": true,
"include_test_results": true,
"include_build_status": true,
"test_timeout_seconds": 30,
"build_timeout_seconds": 60,
"max_files_listed": 10,
"recent_commits_count": 5
}
}
Set the TEAM_EMAIL environment variable before starting Claude Code: export TEAM_EMAIL=team@example.com. Add to .bashrc or .zshrc for persistence across sessions. Verify environment variable. Test with echo $TEAM_EMAIL.
Verify SENDGRID_API_KEY is valid and has Mail Send permissions. Create API keys at SendGrid dashboard. Test with curl command before troubleshooting hook. Check key is not expired or revoked. Verify API key format.
Your email client may not support HTML rendering. The hook sends multipart emails with HTML content. Check spam folder, or configure email client to render HTML. Use plain text fallback in email settings. Verify Content-Type header.
The hook uses 30-60 second timeouts to prevent hanging. For slower builds, adjust timeout values in the script or disable build checks. Results show 'No test results available' on timeout. Consider increasing timeout values. Test build duration separately.
The hook analyzes uncommitted changes using 'git diff'. Stage or commit changes to see them in git analysis. For committed work, check recent commits section which shows last 5 commits regardless of current diff. Verify Git repository state. Check git status.
Install mailutils package: apt-get install mailutils (Ubuntu/Debian) or brew install mailutils (macOS). Configure SMTP settings. Verify mail command availability. Test with: echo 'test' | mail -s 'Test' your@email.com.
SendGrid has rate limits based on plan. Check SendGrid dashboard for rate limit status. Implement retry logic with exponential backoff. Consider upgrading SendGrid plan. Monitor email sending frequency.
Use inline CSS instead of external stylesheets. Test email template in multiple email clients. Use email-safe HTML (avoid modern CSS features). Consider using email template frameworks. Verify HTML structure.
Show that Team Summary Email Generator - Hooks is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.
[](https://heyclau.de/entry/hooks/team-summary-email-generator)Team Summary Email Generator - Hooks side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
| Field | Generates and sends a comprehensive summary email to the team when session ends. Open dossier | Automatically generates or updates project documentation when session ends. Open dossier | Generates a comprehensive report when Claude Code workflow stops, including files modified, tests run, and git status. Open dossier | PostToolUse hook that extracts JSDoc and pydoc comments from modified API endpoint files and generates OpenAPI 3.1.0-compatible YAML documentation on every save. 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 at session end and may execute test or build commands before sending a summary. Sends email through SendGrid, mail, or sendmail when TEAM_EMAIL and a delivery method are configured. Test and build commands are time-limited but can still consume local CPU, disk, or network resources. | ✓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 after write or edit tool calls on route, controller, and API files. Invokes npx swagger-jsdoc or npx jsdoc to generate docs; executes python -m pydoc for Python files. Writes generated documentation files to ./docs/api/ in the project directory. |
| Privacy notes | ✓Email summaries include project name, user and host, working directory metadata, branch, changed file names, diff stats, recent commits, and test or build status. Sends summary content to the configured team address and, when used, the SendGrid API. Uses TEAM_EMAIL and SENDGRID_API_KEY environment variables without storing or rotating them. | ✓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 |
Source-backed guides for putting this to work.
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.