Install command
Provided
Tracks all Claude Code activities in real-time and logs them for monitoring and debugging.
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 5 risk areas. Review closely: credentials & tokens.
#!/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 // ""')
TOOL_ACTION=$(echo "$INPUT" | jq -r '.tool_action // "unknown"')
echo "📊 Real-time Activity Tracker - Logging activity..."
# Create .claude directory if it doesn't exist
mkdir -p .claude
# Create daily activity log
ACTIVITY_LOG=".claude/activity-$(date +%Y%m%d).log"
ACTIVITY_JSON=".claude/activity-$(date +%Y%m%d).json"
# Current timestamp
TIMESTAMP=$(date --iso-8601=seconds 2>/dev/null || date -Iseconds 2>/dev/null || date)
# Log in human-readable format
echo "[$TIMESTAMP] Tool: $TOOL_NAME | File: $FILE_PATH | Action: $TOOL_ACTION" >> "$ACTIVITY_LOG"
# Log in JSON format for programmatic analysis
cat >> "$ACTIVITY_JSON" << EOF
{
"timestamp": "$TIMESTAMP",
"tool_name": "$TOOL_NAME",
"file_path": "$FILE_PATH",
"action": "$TOOL_ACTION",
"session_id": "$(date +%Y%m%d_%H%M%S)_$$"
},
EOF
# Keep only last 100 entries in activity log to prevent it from growing too large
if [ -f "$ACTIVITY_LOG" ]; then
tail -n 100 "$ACTIVITY_LOG" > "$ACTIVITY_LOG.tmp" && mv "$ACTIVITY_LOG.tmp" "$ACTIVITY_LOG"
fi
# Keep only last 100 entries in JSON log
if [ -f "$ACTIVITY_JSON" ]; then
tail -n 100 "$ACTIVITY_JSON" > "$ACTIVITY_JSON.tmp" && mv "$ACTIVITY_JSON.tmp" "$ACTIVITY_JSON"
fi
# Activity statistics
if [ -f "$ACTIVITY_LOG" ]; then
TOTAL_ACTIVITIES=$(wc -l < "$ACTIVITY_LOG")
echo "📈 Session Activity Count: $TOTAL_ACTIVITIES"
# Show recent activity summary
echo "🕒 Recent Activities:"
tail -n 3 "$ACTIVITY_LOG" | while read -r line; do
echo " • $line"
done
# File operation summary
WRITE_COUNT=$(grep -c "Write\|Edit" "$ACTIVITY_LOG" 2>/dev/null || echo 0)
read_COUNT=$(grep -c "Read" "$ACTIVITY_LOG" 2>/dev/null || echo 0)
echo "📊 Today's Summary:"
echo " • Write/Edit operations: $WRITE_COUNT"
echo " • Read operations: $READ_COUNT"
fi
# Weekly activity archive (every Sunday)
if [ "$(date +%u)" = "7" ]; then
ARCHIVE_DIR=".claude/archive/$(date +%Y-%m)"
mkdir -p "$ARCHIVE_DIR"
# Move old logs to archive
find .claude -name "activity-*.log" -mtime +7 -exec mv {} "$ARCHIVE_DIR/" \;
find .claude -name "activity-*.json" -mtime +7 -exec mv {} "$ARCHIVE_DIR/" \;
echo "📦 Weekly archive created in $ARCHIVE_DIR"
fi
echo "✅ Activity logged to $ACTIVITY_LOG"
exit 0{
"hooks": {
"notification": {
"script": "./.claude/hooks/real-time-activity-tracker.sh",
"matchers": [
"*"
]
}
}
}.claude/settings.local.json~/.claude/settings.json.claude/settings.json{
"hooks": {
"notification": {
"script": "./.claude/hooks/real-time-activity-tracker.sh",
"matchers": ["*"]
}
}
}
#!/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 // ""')
TOOL_ACTION=$(echo "$INPUT" | jq -r '.tool_action // "unknown"')
echo "📊 Real-time Activity Tracker - Logging activity..."
# Create .claude directory if it doesn't exist
mkdir -p .claude
# Create daily activity log
ACTIVITY_LOG=".claude/activity-$(date +%Y%m%d).log"
ACTIVITY_JSON=".claude/activity-$(date +%Y%m%d).json"
# Current timestamp
TIMESTAMP=$(date --iso-8601=seconds 2>/dev/null || date -Iseconds 2>/dev/null || date)
# Log in human-readable format
echo "[$TIMESTAMP] Tool: $TOOL_NAME | File: $FILE_PATH | Action: $TOOL_ACTION" >> "$ACTIVITY_LOG"
# Log in JSON format for programmatic analysis
cat >> "$ACTIVITY_JSON" << EOF
{
"timestamp": "$TIMESTAMP",
"tool_name": "$TOOL_NAME",
"file_path": "$FILE_PATH",
"action": "$TOOL_ACTION",
"session_id": "$(date +%Y%m%d_%H%M%S)_$$"
},
EOF
# Keep only last 100 entries in activity log to prevent it from growing too large
if [ -f "$ACTIVITY_LOG" ]; then
tail -n 100 "$ACTIVITY_LOG" > "$ACTIVITY_LOG.tmp" && mv "$ACTIVITY_LOG.tmp" "$ACTIVITY_LOG"
fi
# Keep only last 100 entries in JSON log
if [ -f "$ACTIVITY_JSON" ]; then
tail -n 100 "$ACTIVITY_JSON" > "$ACTIVITY_JSON.tmp" && mv "$ACTIVITY_JSON.tmp" "$ACTIVITY_JSON"
fi
# Activity statistics
if [ -f "$ACTIVITY_LOG" ]; then
TOTAL_ACTIVITIES=$(wc -l < "$ACTIVITY_LOG")
echo "📈 Session Activity Count: $TOTAL_ACTIVITIES"
# Show recent activity summary
echo "🕒 Recent Activities:"
tail -n 3 "$ACTIVITY_LOG" | while read -r line; do
echo " • $line"
done
# File operation summary
WRITE_COUNT=$(grep -c "Write\|Edit" "$ACTIVITY_LOG" 2>/dev/null || echo 0)
read_COUNT=$(grep -c "Read" "$ACTIVITY_LOG" 2>/dev/null || echo 0)
echo "📊 Today's Summary:"
echo " • Write/Edit operations: $WRITE_COUNT"
echo " • Read operations: $READ_COUNT"
fi
# Weekly activity archive (every Sunday)
if [ "$(date +%u)" = "7" ]; then
ARCHIVE_DIR=".claude/archive/$(date +%Y-%m)"
mkdir -p "$ARCHIVE_DIR"
# Move old logs to archive
find .claude -name "activity-*.log" -mtime +7 -exec mv {} "$ARCHIVE_DIR/" \;
find .claude -name "activity-*.json" -mtime +7 -exec mv {} "$ARCHIVE_DIR/" \;
echo "📦 Weekly archive created in $ARCHIVE_DIR"
fi
echo "✅ Activity logged to $ACTIVITY_LOG"
exit 0
Complete hook script that tracks Claude Code activities in real-time
#!/bin/bash
INPUT=$(cat)
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name')
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
ACTIVITY_LOG=".claude/activity-$(date +%Y%m%d).log"
ACTIVITY_JSON=".claude/activity-$(date +%Y%m%d).json"
mkdir -p .claude
echo "[$TIMESTAMP] Tool: $TOOL_NAME | File: $FILE_PATH" >> "$ACTIVITY_LOG"
cat >> "$ACTIVITY_JSON" << EOF
{
"timestamp": "$TIMESTAMP",
"tool_name": "$TOOL_NAME",
"file_path": "$FILE_PATH"
}
EOF
exit 0
Complete hook configuration for .claude/settings.json to enable real-time activity tracking
{
"hooks": {
"notification": {
"script": "./.claude/hooks/real-time-activity-tracker.sh",
"matchers": ["*"]
}
}
}
Enhanced hook script with proper JSON array handling using jq
#!/bin/bash
INPUT=$(cat)
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name')
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
ACTIVITY_LOG=".claude/activity-$(date +%Y%m%d).log"
ACTIVITY_JSON=".claude/activity-$(date +%Y%m%d).json"
mkdir -p .claude
if [ ! -f "$ACTIVITY_JSON" ]; then
echo '[' > "$ACTIVITY_JSON"
fi
jq -s '. + [{"timestamp": "'$TIMESTAMP'", "tool_name": "'$TOOL_NAME'", "file_path": "'$FILE_PATH'"}]' "$ACTIVITY_JSON" > "$ACTIVITY_JSON.tmp" && mv "$ACTIVITY_JSON.tmp" "$ACTIVITY_JSON"
exit 0
Enhanced hook script with file locking for concurrent writes
#!/bin/bash
INPUT=$(cat)
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name')
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
ACTIVITY_LOG=".claude/activity-$(date +%Y%m%d).log"
mkdir -p .claude
(flock -x 200; echo "[$TIMESTAMP] Tool: $TOOL_NAME" >> "$ACTIVITY_LOG"; ) 200>.claude/activity.lock
exit 0
Example configuration for activity tracker settings
{
"activity_log": ".claude/activity-20251206.log",
"activity_json": ".claude/activity-20251206.json",
"retention_days": 30,
"max_log_size_mb": 10,
"archive_enabled": true,
"archive_directory": ".claude/archive"
}
ISO-8601 date varies by platform. Replace 'date --iso-8601=seconds' with portable: 'date -u +"%Y-%m-%dT%H:%M:%SZ"'. Works on both Linux and macOS without fallback. Verify date command. Test with various date formats.
Each append adds trailing comma creating invalid JSON. Wrap in array: initialize with '[', append without trailing comma, close ']' on end. Or rebuild: 'jq -s . file.json'. Verify JSON structure. Test with various JSON formats.
macOS date lacks %u for weekday. Replace with: 'if [ "$(date +%w)" = "0" ]; then' (Sunday=0). Or use portable: '[ $(date +%A) = "Sunday" ]' for name-based check. Verify date command. Test with various date formats.
Current sessionid uses timestamp+PID but PID can conflict. Add random suffix: "$(date +%Y%m%d%H%M%S)$$$RANDOM" or use UUID: "$(uuidgen 2>/dev/null || echo $RANDOM$RANDOM)". Verify session ID generation. Test with various session scenarios.
Concurrent writes from parallel Claude sessions. Use flock: '(flock -x 200; echo ".." >> log; ) 200>/var/lock/activity.lock' for atomic append operations. Verify file locking. Test with various concurrent scenarios.
Implement log rotation with size limits and automatic cleanup. Use tail -n 100 to keep only recent entries. Configure log retention policies. Archive old logs. Verify log rotation. Test with various log sizes.
Optimize logging operations with asynchronous logging or buffering. Use efficient file operations. Minimize JSON parsing overhead. Consider background logging. Verify performance. Test with various activity volumes.
Verify notification hook matchers include all activities (* matcher). Check file write permissions. Ensure activity data is properly captured. Verify hook execution. Test with various activity types.
Show that Real Time Activity Tracker - 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/real-time-activity-tracker)Real Time Activity Tracker - Hooks side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
Next steps differ across entries — use the actions in the table below to copy install commands and source links per resource.
| Field | Tracks all Claude Code activities in real-time and logs them for monitoring and debugging. Open dossier | Tracks error patterns and alerts when error rates spike. This Notification hook provides comprehensive error rate monitoring across log files, Docker containers, and application logs, automatically detecting error patterns and alerting when error rates exceed configurable thresholds. Open dossier | A Claude Code hook that flags files exceeding complexity thresholds after you edit them — estimating cyclomatic complexity, line and function counts, and nesting depth (via ESLint's complexity rule and Radon). Open dossier | A PostToolUse hook that reminds you to enable native query logging for PostgreSQL, Prisma, Sequelize, and TypeORM, and flags possible N+1 patterns when you edit SQL or data-access files. Open dossier |
|---|---|---|---|---|
| Next stepsDiffers | ||||
| 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-10-19 |
| Platforms | Claude Code | Claude Code | Claude Code | Claude Code |
| Source repo | — | — | — | — |
| Safety notes | ✓Runs on notification events and writes daily activity logs under .claude in the current project. Rotates logs to the last 100 entries and may archive older activity files under .claude/archive. Uses local file operations only but can add persistent project files if .claude is not ignored. | ✓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 after edits to JS/TS/Python files and prints advisory warnings only; the line/function/brace counts are heuristics, not a substitute for ESLint or Radon run on the full project. | ✓Runs automatically after bash, write, or edit activity and inspects files that look like query, model, repository, DAO, or SQL files. Creates .claude/logs/query-performance.log and appends database command or file-analysis events. Uses grep-based heuristics for query warnings and should not be treated as proof of a performance defect. |
| Privacy notes | ✓Records tool names, file paths, tool actions, timestamps, and generated session IDs. Stores human-readable and JSON activity logs under .claude. Prints recent activity summaries to local hook 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. | ✓Reads the contents of files you edit to compute complexity locally; it prints warnings to hook output and does not transmit code, but those messages can reveal file structure. | ✓Reads query-related source files and may print file paths, query patterns, and database command strings to local hook output. Stores analyzed file paths and database command text in .claude/logs/query-performance.log. Database command text may include connection names, database names, or other operational details if typed directly into the command. |
| 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.
Debug web apps with Claude in Chrome and Claude Code together.
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.