Spiritual fork of https://github.com/adriancooney/agent-worklog
A lightweight system for tracking, logging, and analyzing work performed by AI coding agents.
Once installed, Agent Worklog works automatically across all your projects. Here's how to use it:
Simply include <work> in any prompt to your AI coding agent. The agent will:
- Complete your requested task
- Create a git commit
- Log the work to a central database
Examples:
<work> Add user authentication to the API #feature #security
<work> Fix the pagination bug in the search results #bugfix
<work> Refactor database queries for better performance #refactor #performance
Hashtags help categorize and search your work later:
| Tag | Use For |
|---|---|
#feature |
New functionality |
#bugfix |
Bug fixes |
#refactor |
Code refactoring |
#docs |
Documentation |
#test |
Test additions |
#api |
API changes |
#ui |
User interface |
#security |
Security-related |
Use the CLI to review past work:
# See recent work across all projects
agent-worklog list
# Filter by project
agent-worklog list -r my-project
# Filter by tag
agent-worklog list --tag "#bugfix"
# Get statistics
agent-worklog stats --since 2026-01-01The worklog database lives at ~/.agent-worklog.db (in your home directory), so:
- Works across all your git repositories
- Survives fresh clones and new projects
- No per-project setup needed
Agent Worklog provides a structured way to maintain an audit trail of AI agent contributions across coding sessions and projects. It enables:
- Work Logging: Record completed tasks with git metadata and code change statistics
- Summarization: Generate performance reviews and summaries over any timeframe
- Querying: Search historical work using natural language questions
Clone the repo and run the installer:
git clone https://github.com/your-username/agent-worklog.git
cd agent-worklog
./install.shThe installer will:
- Initialize the SQLite database
- Create a Cursor rule at
~/.cursor/rules/always-agent-worklog.mdc - Add the
bin/directory to your PATH in~/.zshrc
If you prefer manual setup:
# 1. Clone the repository
git clone https://github.com/your-username/agent-worklog.git
cd agent-worklog
# 2. Initialize the database
python3 init_db.py
# 3. Add to PATH (add this to ~/.zshrc or ~/.bashrc)
export PATH="$PATH:/path/to/agent-worklog/bin"
# 4. Reload shell
source ~/.zshrcOpen a new terminal and run:
agent-worklogYou should see the help output with configuration paths.
After installation, AI agents using Cursor will automatically have access via the .mdc rule. For other setups, point your agent to the AGENTS.md file.
./install.sh --uninstallagent-worklog/
├── AGENTS.md # LLM instructions index
├── README.md # This file
├── PRD.txt # Product requirements document
├── progress.txt # Development progress tracker
├── install.sh # Installation script
├── schema.sql # Database schema
├── init_db.py # Database initialization script
├── bin/
│ └── agent-worklog # CLI tool
└── skills/
├── do_work.md # Skill: Complete workflow with auto-logging
├── log_work.md # Skill: Log completed work
├── summarize_work.md # Skill: Generate summaries
└── query_work.md # Skill: Query historical work
~/.agent-worklog.db # SQLite database (in home directory, survives fresh clones)
The agent-worklog CLI provides commands for managing work entries:
agent-worklog # Show help and configuration
agent-worklog init # Initialize database
agent-worklog log [OPTIONS] # Log a work entry
agent-worklog list [OPTIONS] # List work entries
agent-worklog show <id> # Show entry details
agent-worklog stats [OPTIONS] # Show statistics# Auto-detect git info from current directory
agent-worklog log -t "Implemented user authentication" -H "#feature,#auth"
# Specify project path
agent-worklog log -t "Fixed login bug" -p /path/to/project -H "#bugfix"
# Manual entry (no git)
agent-worklog log -t "Code review" --no-git -H "#review"# List recent entries
agent-worklog list
# Filter by tag
agent-worklog list --tag "#feature"
# Filter by date range
agent-worklog list --since 2026-01-01 --until 2026-01-31
# Output as JSON
agent-worklog list --json# Overall stats
agent-worklog stats
# Stats for a time period
agent-worklog stats --since 2026-01-01
# Stats for a specific project
agent-worklog stats -p /path/to/projectTriggered when a prompt contains <work>. Executes the complete workflow:
- Parse task and extract hashtags from prompt
- Execute the coding task
- Create git commit
- Log work to database
Example prompt:
<work> Add input validation to signup form #feature #validation
Hashtags are automatically extracted from the prompt (excluding code blocks and non-tags like #123 or CSS selectors).
Records a work entry at the end of a coding task.
Fields captured:
- Task description
- Project root path
- Git ref (branch)
- Commit hash
- Lines added/removed
- Commit message
- Hashtags for categorization
- Timestamp
- Worktree path
Example usage (by agent):
import sqlite3
from datetime import datetime
conn = sqlite3.connect('worklog.db')
cursor = conn.cursor()
cursor.execute('''
INSERT INTO worklog (task, project_root, git_ref, commit_hash,
lines_added, lines_removed, commit_message,
hashtags, timestamp, worktree)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
''', (
"Implemented user authentication",
"/Users/dev/myproject",
"main",
"abc123def",
150,
20,
"feat: add user auth system",
"#feature,#auth,#security",
datetime.utcnow().isoformat() + "Z",
"/Users/dev/myproject"
))
conn.commit()
conn.close()Generates summaries and performance reviews for a timeframe.
Outputs:
- Tasks completed count and list
- Total commits and code changes
- Performance review narrative
- Breakdown by hashtags
- Commit hashes for diff retrieval
Example query:
SELECT
COUNT(*) as tasks,
SUM(lines_added) as added,
SUM(lines_removed) as removed
FROM worklog
WHERE timestamp BETWEEN '2026-01-01' AND '2026-01-31';Retrieves relevant work entries via natural language queries.
Example queries:
- "What authentication work was done last month?"
- "Show me all bugfixes in the API project"
- "Find the largest code changes this week"
- "What did I work on yesterday?"
CREATE TABLE worklog (
id INTEGER PRIMARY KEY AUTOINCREMENT,
task TEXT NOT NULL,
project_root TEXT NOT NULL,
repo TEXT NOT NULL, -- Repository name (from git remote or directory)
project TEXT NOT NULL, -- Project/directory name
worktree TEXT,
git_ref TEXT,
commit_hash TEXT,
commit_message TEXT,
lines_added INTEGER DEFAULT 0,
lines_removed INTEGER DEFAULT 0,
hashtags TEXT,
timestamp TEXT NOT NULL,
created_at TEXT DEFAULT CURRENT_TIMESTAMP
);Indexes: timestamp, project_root, repo, project, hashtags, commit_hash
Views:
worklog_stats: Daily statisticsproject_stats: Per-project summaries
Use consistent hashtags to categorize work:
| Tag | Use For |
|---|---|
#feature |
New functionality |
#bugfix |
Bug fixes |
#refactor |
Code refactoring |
#docs |
Documentation |
#test |
Test additions |
#config |
Configuration changes |
#deps |
Dependency updates |
#security |
Security-related |
#performance |
Performance improvements |
#ui |
User interface changes |
#api |
API changes |
#database |
Database changes |
- Read
AGENTS.mdfirst - It provides an overview and links to all skills - Use the appropriate skill for the task at hand
- Follow the step-by-step instructions in each skill file
- Always use ISO 8601 timestamps (e.g.,
2026-01-21T14:30:00Z) - Include relevant hashtags for better querying later
You can query the database directly for quick lookups:
# Open database
sqlite3 worklog.db
# View recent entries
SELECT task, timestamp, hashtags FROM worklog ORDER BY timestamp DESC LIMIT 10;
# View daily stats
SELECT * FROM worklog_stats LIMIT 7;
# View project summary
SELECT * FROM project_stats;- Python 3.6+
- SQLite3 (included with Python)
No additional dependencies required.
MIT