ccam-productivity — Claude Code hook: session logging
ccam-productivity — a hook that writes session start and end timestamps from Claude Code into a log file. Handy when you want to measure how long you actually work on tasks.
MIT ★ 1,198 updated 2026-10-23
/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor
/plugin install ccam-productivity@claude-code-agent-monitor-pluginsWhat ccam-productivity does
The hook fires on SessionStart and SessionEnd. When a session begins, it appends a UTC timestamp to /tmp/ccam-session-timing.log; when it ends, another line lands in the same file. Those pairs of lines give you a rough time log: session length, start times, gaps between sessions.
Under the hood it's just two echo commands with date -u, both silencing errors with 2>/dev/null || true. If the file can't be written, the hook stays quiet. No API keys, no external services, just the local shell.
The repository description promises more: daily standups, weekly reports, sprint summaries built on Agent Monitor data. The hook itself only writes two lines per session. Reports are a separate job, this hook gives you raw timestamps and nothing else.
The log lives in /tmp, so a reboot wipes it. For anything persistent you'd need to point the commands somewhere else.
What it helps with
- log start and end times of Claude Code sessions
- collect raw data for tracking work time
- keep an activity log without external services
- measure session length with a simple local file
Example prompts for the agent
- Start a Claude Code session and let ccam-productivity log the start time
- Check
/tmp/ccam-session-timing.logafter the session ends - Show today's timestamps from the ccam log
How to install ccam-productivity
1Plugin marketplace
/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor/plugin install ccam-productivity@claude-code-agent-monitor-plugins2Manually: 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 ccam-productivity
How do I install ccam-productivity in Claude Code?
Add the marketplace first: /plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor. Then install the plugin: /plugin install ccam-productivity@claude-code-agent-monitor-plugins. Wire the hook up in .claude/settings.json.
What does the ccam-productivity hook do?
On SessionStart and SessionEnd it appends timestamped lines to /tmp/ccam-session-timing.log. Each line carries a [ccam-productivity] prefix and a UTC date.
Does it generate standups and reports?
No. The plugin description mentions daily standups, weekly reports and sprint summaries, but the hook has just two echo commands. It writes timestamps to a log; reports need to be built separately.
Source text
hooks.json · MIT
Hooks bundle shipped with the ccam-productivity plugin for Claude Code.
Productivity workflows for Claude Code — daily standups, weekly reports, sprint summaries, and intelligent workflow optimization powered by Agent Monitor session data.
Triggers on: SessionStart, SessionEnd.
```json
{
"hooks": {
"SessionStart": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "echo \"[ccam-productivity] Session started at $(date -u +%Y-%m-%dT%H:%M:%SZ)\" >> /tmp/ccam-session-timing.log 2>/dev/null || true"
}
]
}
],
"SessionEnd": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "echo \"[ccam-productivity] Session ended at $(date -u +%Y-%m-%dT%H:%M:%SZ)\" >> /tmp/ccam-session-timing.log 2>/dev/null || true"
}
]
}
]
}
}
```
© Son Nguyen · MIT · hoangsonww/Claude-Code-Agent-Monitor