Skip to main content

Zero-configuration background tool that automatically tracks developer activity and generates structured daily work logs.

Project description

codechron

Zero-configuration developer activity tracker.

codechron runs silently in the background, watches your project for file changes, extracts Git diffs, groups activity into sessions, and generates structured Markdown daily logs — all with zero setup.

Developed and maintained by Nilen Patel, a Developer. The goal of this package is to provide a minimal, reliable, and automated system for tracking development activity without disrupting the coding process, emphasizing simplicity, performance, and usability.


Features

  • Automatic file tracking — monitors creates, modifications, and deletions using watchdog
  • Git integration — captures lines added/removed per file via git diff --numstat
  • Session grouping — clusters activity into sessions based on configurable inactivity thresholds (default: 15 minutes)
  • Structured Markdown logs — generates daily work logs with summaries, session breakdowns, and per-event detail
  • Event debouncing — suppresses duplicate events from autosave and IDE churn
  • SQLite storage — lightweight, fast, local-only data persistence with WAL mode
  • Background daemon — runs as a detached process with PID-based lifecycle management
  • Cross-platform — works on Linux, macOS, and Windows
  • Fully offline — no APIs, no AI, no telemetry, no network access

Installation

pip install codechron

From source

git clone https://github.com/nilenpatel/codechron.git
cd codechron
pip install .

Dependencies

  • Python >= 3.9
  • watchdog >= 3.0.0
  • Git (optional, for diff tracking)

Quick Start

# Initialize codechron in your project
cd /path/to/your/project
codechron init

# Start tracking
codechron start

# Check status
codechron status

# View today's activity
codechron today

# Generate a daily log file
codechron log

# Stop tracking
codechron stop

CLI Reference

codechron [--version] [--directory DIR] [--verbose] <command>

Commands

Command Description
init Initialize codechron in the current project directory
start Start the background tracker
start -f Start in the foreground (useful for debugging)
stop Stop the running tracker
status Show tracker status and today's summary
today Print today's activity log to stdout
log Generate a Markdown log file in .codechron/logs/
log --date 2026-03-20 Generate a log for a specific date
log --stdout Print the log to stdout instead of writing to file

Global Options

Option Description
-d, --directory DIR Project directory to track (default: auto-detected)
-v, --verbose Enable debug logging to stderr
--version Show version and exit

How It Works

  1. codechron init creates a .codechron/ directory in your project root containing configuration, the SQLite database, and generated logs.

  2. codechron start launches a background daemon that:

    • Watches all files recursively using watchdog
    • Filters out ignored paths (.git, __pycache__, node_modules, hidden files, binary extensions)
    • Debounces rapid-fire events (default: 2 seconds)
    • Extracts Git diff stats for modified files
    • Groups events into sessions based on inactivity (default: 15 minutes)
    • Stores everything in a local SQLite database
  3. codechron log reads from the database and generates a structured Markdown report for the requested day.

Configuration

Configuration is stored in .codechron/config.json and can be edited directly:

{
  "debounce_seconds": 2.0,
  "session_timeout_minutes": 15,
  "ignore_patterns": [
    ".git", "__pycache__", "node_modules", ".venv",
    "venv", "env", ".env", ".tox", ".mypy_cache",
    ".pytest_cache", ".ruff_cache", "dist", "build",
    "*.egg-info", ".codechron"
  ],
  "ignore_extensions": [
    ".pyc", ".pyo", ".o", ".so", ".dylib", ".dll",
    ".class", ".exe", ".bin", ".lock", ".log",
    ".db", ".db-journal", ".sqlite", ".sqlite-journal"
  ],
  "ignore_hidden": true,
  "verbose": false
}

Project Structure

codechron/
├── __init__.py          # Package metadata
├── __main__.py          # python -m codechron entry point
├── cli.py               # CLI argument parsing and command handlers
├── config.py            # Configuration management
├── daemon.py            # Background process lifecycle
├── git_integration.py   # Git diff extraction
├── log_generator.py     # Markdown report generation
├── session.py           # Session grouping engine
├── storage.py           # SQLite database layer
├── utils.py             # Shared utilities
└── py.typed             # PEP 561 marker

Example Output

See examples/2026-03-26.md for a sample daily log.

Data Storage

All data is stored locally in .codechron/:

.codechron/
├── config.json       # User configuration
├── codechron.db      # SQLite database (WAL mode)
├── codechron.pid     # Background process PID
└── logs/
    └── 2026-03-26.md # Generated daily logs

Add .codechron/ to your .gitignorecodechron init does this automatically.

License

MIT — Nilen Patel

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codechron-1.0.0.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codechron-1.0.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file codechron-1.0.0.tar.gz.

File metadata

  • Download URL: codechron-1.0.0.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for codechron-1.0.0.tar.gz
Algorithm Hash digest
SHA256 34509a32ddd9c1eab50cee56c985e85624f4ac6856c721026e7cfae6f6be60f9
MD5 b4bb257607134ac87b333891880e2efa
BLAKE2b-256 cbaf29e3740dd16f4216f230d52ebbed6a70a4f1dc01110d36459a41d47843bc

See more details on using hashes here.

File details

Details for the file codechron-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: codechron-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for codechron-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 094079a153ec17d234ef150331a10c8876667b950bf4616c2d83ea13b469825f
MD5 31ff1030abd6f8c558c55a80ecfee987
BLAKE2b-256 c923d21c5200b8f859862037aedb0a51f0d8fe83903ef27496ee6d76d8f973ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page