change-tracker — Claude Code hook: what it does, how to install
This hook logs file changes with timestamps. Use it when you need a simple record of Claude Code edits and file creation.
npx claude-code-templates@latest --hook development-tools/change-trackerWhat change-tracker does
change-tracker listens to PostToolUse events in Claude Code. After Edit or MultiEdit, it appends the modified file path to a log. After Write, it records the created file instead. Each entry includes the date, time, and action type.
The hook writes to ~/.claude/changes.log, so all activity goes into one fixed file. The log grows when the matching tools run. If ~/.claude/changes.log cannot be written, new entries will not be added.
Install it with npx claude-code-templates@latest --hook development-tools/change-tracker, then use .claude/settings.json for the configuration. The setup is intended for Claude Code.
What it helps with
- track files changed by Claude Code
- record when a file was edited
- separate created files from modified ones
- keep a plain activity log for agent actions
Example prompts for the agent
- Edit
src/app.jsand record the change in the activity log. - Create
config/local.json, then check that the event was logged. - Update several files with
MultiEditand show the change log.
How to install change-tracker
1claude-code-templates
npx claude-code-templates@latest --hook development-tools/change-tracker2Manually: put the files in place
.claude/settings.jsonThe hooks block: event (PreToolUse, PostToolUse, Stop…) → command. Personal ones go to ~/.claude/settings.json
Step by step, with commands for each platform: Claude Code hooks: what they are, where to configure them, how to block a risky command
Questions about change-tracker
How do I install change-tracker in Claude Code?
Run npx claude-code-templates@latest --hook development-tools/change-tracker, then use .claude/settings.json for the configuration.
What does change-tracker do?
The hook watches Edit, MultiEdit, and Write activity in Claude Code. It stores modified and created file paths with timestamps in ~/.claude/changes.log.
Which actions does change-tracker record?
It logs a modified file after Edit or MultiEdit, and a created file after Write. These handlers run on PostToolUse events.
Source text
change-tracker.json · MIT
{
"description": "Track file changes in a simple log. Records which files were modified and when for easy tracking of Claude Code activity.",
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|MultiEdit",
"hooks": [
{
"type": "command",
"command": "echo \"[$(date '+%Y-%m-%d %H:%M:%S')] File modified: $CLAUDE_TOOL_FILE_PATH\" >> ~/.claude/changes.log"
}
]
},
{
"matcher": "Write",
"hooks": [
{
"type": "command",
"command": "echo \"[$(date '+%Y-%m-%d %H:%M:%S')] File created: $CLAUDE_TOOL_FILE_PATH\" >> ~/.claude/changes.log"
}
]
}
]
}
}
© davila7 · MIT · davila7/claude-code-templates