tomwangowa

activity-logger

0
0
# Install this skill:
npx skills add tomwangowa/agent-skills --skill "activity-logger"

Install specific skill from multi-skill repository

# Description

Records work activities from the current session for cross-session aggregation and work log generation

# SKILL.md


name: activity-logger
description: Records work activities from the current session for cross-session aggregation and work log generation


Activity Logger Skill

Purpose

Records activities from the current Claude Code session to enable cross-session activity aggregation and work log generation. This skill is designed to work with multiple concurrent Claude Code instances across different projects.

When to Use

Automatic triggers:
- After completing a significant task or feature
- Before switching to a different project
- At the end of a work session

Manual triggers:
- "log this activity"
- "record what I just did"
- "save session activity"
- "log my work"

How It Works

When triggered, this skill will:

  1. Collect session information:
  2. Generate or retrieve session ID
  3. Record current timestamp
  4. Identify current project (from git repo or directory name)
  5. Get current working directory

  6. Gather activity details:

  7. Prompt user for activity description (if not provided)
  8. List recently modified files (from git status)
  9. Capture recent commits (if any)
  10. Record task context

  11. Save activity record:

  12. Create JSON file in ~/.claude/activities/
  13. Filename format: {session_id}_{timestamp}.json
  14. Ensure directory structure exists

  15. Confirm to user:

  16. Display saved activity summary
  17. Show file path where activity was saved

Activity Record Format

Each activity record is saved as a JSON file with the following structure:

{
  "session_id": "unique-session-identifier",
  "timestamp": "2026-01-13T14:05:30Z",
  "project_path": "/Users/username/projects/my-app",
  "project_name": "my-app",
  "git_branch": "main",
  "activities": [
    {
      "type": "task_completed",
      "description": "Implemented user authentication feature",
      "files_changed": ["src/auth.ts", "src/middleware.ts"],
      "commits": ["a1b2c3d4"]
    }
  ],
  "context": "Working on security improvements",
  "tags": ["authentication", "security"]
}

Activity Types

  • task_completed - Finished a specific task or feature
  • bug_fixed - Resolved a bug or issue
  • refactoring - Code refactoring work
  • research - Investigation or exploration work
  • documentation - Documentation updates
  • review - Code review activities

Usage Examples

Example 1: Simple activity logging

User: "log my work"
Claude: What activity would you like to log?
User: "Implemented OAuth2 login flow"
Claude: [Collects info and saves activity]

Example 2: Automatic logging after task completion

User: "I've finished implementing the dashboard"
Claude: [Completes implementation work]
        Great! Would you like me to log this activity? [logs automatically]

Configuration

Activity logger uses the following directory structure:

~/.claude/
β”œβ”€β”€ activities/           # Activity records
β”‚   β”œβ”€β”€ session_*.json   # Unprocessed activities
β”‚   └── processed/       # Processed activities (archived)
└── config/
    └── activity-config.json  # Configuration (optional)

Integration with work-log-analyzer

Activity records saved by this skill can be aggregated using the work-log-analyzer skill with the --aggregate flag:

User: "aggregate my activities"
Claude: [Uses work-log-analyzer to process all activity records]

Environment Variables

  • CLAUDE_ACTIVITIES_DIR - Override default activities directory (default: ~/.claude/activities)
  • CLAUDE_SESSION_ID - Provide custom session ID (auto-generated if not set)

Dependencies

Required

  • jq - JSON processor (install: brew install jq on macOS, apt-get install jq on Ubuntu)
  • git - Version control system (required for project context)

Optional

  • openssl - For secure random ID generation (falls back to /dev/urandom or $RANDOM if not available)

Implementation Notes

The skill implementation:
1. Creates directory structure if it doesn't exist
2. Generates a session ID based on timestamp + random string
3. Uses git commands when available to gather context
4. Falls back to directory scanning if not in a git repo
5. Validates JSON output before saving

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.