Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "timelog",
"version": "0.2.0",
"version": "0.3.0",
"description": "Automatic time tracking for Claude Code sessions. Logs project, ticket, and prompt data as JSONL for timesheet reconstruction.",
"license": "Apache-2.0",
"keywords": [
Expand Down
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Bug Report
about: Report a bug in claude-code-timelog
labels: bug
---

## Describe the Bug

A clear description of what the bug is.

## Steps to Reproduce

1. Step one
2. Step two
3. Step three

## Expected Behaviour

What you expected to happen.

## Environment

- OS: [e.g., macOS 14.2, Ubuntu 22.04]
- Node.js version: [e.g., 18.19.0, 22.0.0]
- Claude Code version: [e.g., 1.0.33]
- Plugin version: [e.g., 0.3.0]

## Logs

If applicable, include:

- Report output or error messages
- Contents of `~/.claude/timelog/` (redact
any sensitive prompt text)

```
Paste logs here
```

## Additional Context

Any other context about the problem.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature Request
about: Suggest a new feature for claude-code-timelog
labels: enhancement
---

## Problem Description

Describe the problem this feature would solve.
What are you trying to accomplish?

## Proposed Solution

Describe your proposed solution. How would
this feature work?

## Alternatives Considered

What alternative solutions or workarounds
have you considered?

## Additional Context

Any other context, screenshots, or examples.
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Description

Describe the changes in this pull request.

## Checklist

- [ ] Description of changes provided above
- [ ] Tests added or updated for new behaviour
- [ ] `npm test` passes
- [ ] `npm run lint` passes
- [ ] `CHANGELOG.md` updated under `[Unreleased]`
- [ ] Documentation updated if needed (README)

## Related Issues

Fixes #(issue number)
59 changes: 59 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Changelog

All notable changes to claude-code-timelog are
documented here. Format follows
[Keep a Changelog][kac].

[kac]: https://keepachangelog.com/en/1.1.0/

## [Unreleased]

### Added

- Default report: `claudelog` with no arguments
runs a weekly report instead of printing usage.
Configurable via `defaultReport` in config.json.
- `CONTRIBUTING.md` with setup, code style,
testing, and submission guidelines.
- `SECURITY.md` with vulnerability reporting
instructions.
- Issue templates for bug reports and feature
requests.
- Pull request template with checklist.
- `CHANGELOG.md` (this file).

## [0.2.0] — 2026-02-12

### Added

- `claudelog` CLI command for running reports
and backfills from any terminal without an
active Claude Code session.
- `bin` field in package.json.

## [0.1.0] — 2026-02-11

Initial release.

### Added

- Automatic time tracking via Claude Code hooks
(SessionStart, UserPromptSubmit, Stop).
- JSONL log files (one per day) with session,
project, ticket, and prompt data.
- Report generation with multiple views:
default (day x project x ticket), timesheet,
by-project, by-ticket, by-model, by-day.
- Date range filters: `--week`, `--month`,
`--from`/`--to`.
- Project and ticket filters.
- JSON output mode (`--json`).
- Backfill from existing Claude Code session
transcripts.
- Configurable project detection via
`projectPattern` regex.
- Configurable ticket patterns with
Jira/Linear/GitHub support.
- Break detection with configurable threshold.
- Event-level aggregation for accurate
mid-session project/ticket switching.
105 changes: 105 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Contributing to claude-code-timelog

## Prerequisites

- Node.js 18 or later
- Claude Code (for testing hooks)

## Setup

```bash
git clone https://github.com/RemoteCTO/claude-code-timelog.git
cd claude-code-timelog
npm install
npm test
npm run lint
```

## Project structure

```
hooks/ 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

Code style is enforced by ESLint and
editorconfig:

- 80-character line limit
- ESM modules (`.mjs` extension)
- `prefer-const`, `no-var`
- 2-space indentation
- LF line endings

Run `npm run lint` before submitting changes.

## Testing

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:

```bash
node --test test/lib/config.test.mjs
```

Use `CLAUDE_TIMELOG_DIR` to point at a temp
directory during development to avoid polluting
your real timelog data.

## Pull request process

1. Fork the repository
2. Create a feature branch from `main`
3. Make your changes
4. Write or update tests
5. Update `CHANGELOG.md` under an `[Unreleased]`
heading (see [Keep a Changelog][kac])
6. Run `npm test` and `npm run lint`
7. Submit a pull request

[kac]: https://keepachangelog.com/en/1.1.0/

Keep PRs focused on a single change. Include
clear descriptions of what changed and why.

## Commit messages

Follow conventional commit format where
appropriate:

- `feat:` new features
- `fix:` bug fixes
- `docs:` documentation changes
- `test:` test additions or changes
- `refactor:` code changes without behaviour
changes

Keep commit messages concise and descriptive.

## Questions

Open an issue for questions or clarifications
before starting significant changes.

## Licence

By contributing, you agree that your
contributions will be licensed under the
Apache 2.0 licence.
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ external services.

## Quick start

### From marketplace (recommended)
### From [marketplace][mkt] (recommended)

```
/plugin marketplace add RemoteCTO/claude-plugins-marketplace
Expand All @@ -45,6 +45,8 @@ git clone https://github.com/RemoteCTO/claude-code-timelog.git
claude --plugin-dir ./claude-code-timelog
```

[mkt]: https://github.com/RemoteCTO/claude-plugins-marketplace

That's it. The plugin starts logging
immediately with sensible defaults:

Expand Down Expand Up @@ -98,12 +100,24 @@ and backfills from any terminal — no active
Claude Code session needed.

```bash
claudelog report --week --by-project
claudelog report --month --timesheet --json
claudelog backfill
claudelog --help
claudelog # default report (--week)
claudelog report --month --timesheet # explicit flags
claudelog backfill # import history
claudelog --help # show usage
```

Running `claudelog` with no arguments runs
a default report. Configure the default via
`defaultReport` in `config.json`:

```json
{
"defaultReport": ["--month", "--timesheet"]
}
```

Falls back to `["--week"]` if not set.

### Adding to PATH

The plugin installs to a versioned cache
Expand Down Expand Up @@ -204,7 +218,8 @@ settings are optional.
],
"projectSource": "git-root",
"projectPattern": null,
"breakThreshold": 1800
"breakThreshold": 1800,
"defaultReport": ["--week"]
}
```

Expand Down
34 changes: 34 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Security Policy

## Reporting a Vulnerability

If you discover a security vulnerability in
claude-code-timelog, please report it via
GitHub Security Advisories:

https://github.com/RemoteCTO/claude-code-timelog/security/advisories/new

Do **not** open a public issue for security
vulnerabilities.

Alternatively, email security reports to:
edward@bannermedia.ltd

## What to Include

- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if you have one)

## Response Time

We aim to respond to security reports within
48 hours and provide a fix or mitigation plan
within one week for critical vulnerabilities.

## Disclosure Policy

Please allow us reasonable time to address the
vulnerability before public disclosure. We will
coordinate disclosure timing with you.
Loading