- Node.js 18 or later
- Claude Code (for testing hooks)
git clone https://github.com/RemoteCTO/claude-code-timelog.git
cd claude-code-timelog
npm install
npm test
npm run linthooks/ Claude Code hook handlers
scripts/ CLI scripts (report, backfill)
lib/ Shared library code
bin/ CLI entry point (claudelog)
commands/ Plugin command definitions
test/ Tests (mirrors source layout)
Hooks run inside Claude Code sessions. Scripts run standalone from the terminal. lib/ is shared between both.
Code style is enforced by ESLint and editorconfig:
- 80-character line limit
- ESM modules (
.mjsextension) prefer-const,no-var- 2-space indentation
- LF line endings
Run npm run lint before submitting changes.
Tests use Node's native test runner
(node --test).
- Write tests first (TDD)
- Test behaviour, not implementation
- Use real objects, not mocks
- Keep tests focused and independent
Run tests with npm test. Run a single file:
node --test test/lib/config.test.mjsUse CLAUDE_TIMELOG_DIR to point at a temp
directory during development to avoid polluting
your real timelog data.
- Fork the repository
- Create a feature branch from
main - Make your changes
- Write or update tests
- Update
CHANGELOG.mdunder an[Unreleased]heading (see Keep a Changelog) - Run
npm testandnpm run lint - Submit a pull request
Keep PRs focused on a single change. Include clear descriptions of what changed and why.
Follow conventional commit format where appropriate:
feat:new featuresfix:bug fixesdocs:documentation changestest:test additions or changesrefactor:code changes without behaviour changes
Keep commit messages concise and descriptive.
Open an issue for questions or clarifications before starting significant changes.
By contributing, you agree that your contributions will be licensed under the Apache 2.0 licence.