CLI tool
hellodigua/code996 avatar
hellodigua/code996

code996: reading a team's working hours out of Git commit timestamps

统计 Git 项目的 commit 时间分布,进而推导出项目的编码工作强度。 Analyzes the commit time distribution of Git projects to infer coding work intensity.

2,144 stars85 forksTypeScriptMIT

At a glance

What is it?
A TypeScript CLI that turns the clock times of your commits into a workload report, a trend line across months and a local web page you can read without uploading anything.
Who is it for?
code996 is a small, opinionated CLI that takes one input, the commit history you already have, and turns it into a judgement about working hours. What makes it more than a histogram is the layer of interpretation on top: an index that compresses the picture into one number, a first commit quantile used to infer the standard working day, late evening activity treated as separate evidence, and a trend line that says whether the load is rising or settling.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 24 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 28, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What the tool actually measures

The premise is that commit timestamps do not lie the way self reported answers in an interview do. code996 reads the time distribution of commits in a Git repository and infers how intense the coding work behind them was. The repository description states this in both Chinese and English: it analyzes commit time distribution to derive a project's coding work intensity. The stated use case is joining a new company and finding out the real overtime culture before the probation period ends, rather than three painful months later. The feature list breaks that idea into pieces. There is a 996 index that turns a complicated overtime picture into a single number. There is a work time deduction step that uses the first commit quantile of each day to infer the standard working hours, and treats late evening activity as a separate diagnostic signal rather than folding it into the same average. There is monthly trend tracking, so you can see whether a project is getting busier or leveling off. There is a per member breakdown that shows which contributors carry the late commits. There is multi repository comparison, timezone detection, China holiday and make up workday handling, and privacy is handled by running purely locally on git log.

Running it: one command, or a global install

The quick start is a single line, and it requires Node.js 18 or newer on your machine:

bash
npx -y code996

Run that inside a repository or in a parent directory that contains one. The default behaviour is a terminal text report, plus a bilingual web report saved under `Downloads/code996-report/`, in a folder named with the date, the time and the project name, for example `Downloads/code996-report/2026-07-18_10-11-46_demo/`. The browser is deliberately not opened for you unless you ask, and the report stays readable after the command exits, so you can delete that directory later to remove it completely. Adding `--open` opens the page as soon as it is generated. If you would rather not fetch the package each time, install it globally and then call it by name:

bash
npm i -g code996

Neither path uploads repository data or starts a localhost server that has to be left running.

Smart mode picks between one repository and many

code996 decides what to do based on where you point it. Inside a single Git repository it performs a single repository deep analysis. In a directory holding several repositories it switches into multi repository mode on its own, which is what makes the parent directory invocation work without any flag. You can also name the targets explicitly, either one repository or a directory to scan:

bash
code996
code996 /path/to/repo
code996 /proj1 /proj2
code996 /workspace

The scan of a directory picks up the sub repositories inside it, and you can pair that with a year filter to compare the same set of projects across a single period. Restricting the run to your own commits with `--self` works in both modes, which matters when you are trying to answer a question about your own hours rather than the repository's. Multi repository comparison is the feature that turns this from a curiosity into something you can point at a portfolio of services and read side by side.

Time ranges, working hours and half hour granularity

By default the tool looks at the most recent year. The time range options let you change that in four ways. `--year <year>` takes a single year such as `2025` or a range such as `2023-2025`, and it is the option the documentation recommends. `--since <date>` and `--until <date>` take explicit `YYYY-MM-DD` boundaries, and `--all-time` covers the whole history. Working hours matter because the index is computed against a normal day, and here the documentation is unusually direct: it calls setting them yourself the recommended option, because it produces more accurate results than the inferred default. The `--hours <range>` flag takes a range such as 9-18, and decimal hours are supported, so `9.5-18.5` means a nine thirty to six thirty day. `code996 --hours 9.5-19 -y 2025` shows how to combine the two. Display granularity is separate: `--half-hour` switches the distribution from hourly buckets to half hour buckets, which the documentation presents as the more precise view:

bash
code996 --hours 9.5-18.5
code996 --half-hour
code996 -y 2025 --half-hour

Together these decide what counts as normal and how finely you can see the exceptions.

Filtering the noise that distorts a commit histogram

Any repository with continuous integration has commits that never came from a person typing. The filtering options exist to keep that out. `--ignore-author <regex>` drops commits whose author matches a pattern, and the documented examples cover bot accounts and dependency updaters, using `|` to separate alternatives such as a renovate or dependabot pattern. `--ignore-msg <regex>` drops commits by message, with the example pattern anchored at the start of the line for merge commits. Both can be combined with a year filter in a single invocation. The self flag narrows the analysis to the current Git user instead of widening it:

bash
code996 --ignore-author renovate
code996 --self
code996 --all-time

Timezone handling sits in the same group of concerns. `--timezone <offset>` restricts the analysis to one offset, which matters for a team spread across regions, and `--cn` forces the China holiday and make up workday logic on for projects that are not in that timezone. That holiday handling is built into the tool rather than left to the user, and it switches on by itself when the main timezone is detected as plus eight.

Output shapes, interface language and what stays local

There are two output families and they do not mix. The default is the terminal text report plus a saved web report that is not opened. `--open` keeps both and opens the browser. `--json` and `--md` produce stable structured output instead, and they skip the web report entirely; `--output [path]` redirects them to a file you name. The documentation is specific that `--json` and `--md` are mutually exclusive, and that `--open` cannot be combined with either structured format. Language selection follows a six step priority order: the `--lang` flag first, then the `CODE996_LANG` environment variable, then the operating system language, then the terminal locale through `LC_ALL`, `LC_MESSAGES` or `LANG`, then the Node.js Intl locale, and English as the fallback. Explicit values cover the usual Chinese and English spellings, and asking for an unsupported language is an error rather than a silent fallback. The web report can switch between Chinese and English from the page itself, with `--lang` only setting the initial state:

bash
code996 --lang en
code996 --json --output report.json
code996 --md --output report.md

On the privacy side the claim is specific: everything runs locally, offline, on git log, with no upload and no resident local service.

How the package is built and released

The repository is TypeScript with a Vue based web report, and the scripts in `package.json` show how the two halves are kept separate. `build:cli` runs the TypeScript compiler through a clean and finalize pair of scripts around it, while `build:web` type checks the Vue code with `vue-tsc` and then runs a Vite build against the web configuration. A separate `build:website` target covers the documentation site, and `npm run build` chains the CLI and web builds for publishing, because `prepublishOnly` points at the same script. Testing is split three ways: Jest for the CLI, Vitest against the web config for the report, and Node's own test runner against a release script. Version 1.4.0 is the current package version, and the release notes for it are small and specific: an anonymous benchmark export added to the CLI, benchmark collection that tolerates zero input, and a fix stabilising date only ranges. The two releases before it, 1.3.1 and 1.3.0, corrected work time boundaries and the confidence value, streamlined the bundled AI assistant skill, and added a current report preview to the website. The repository is MIT licensed with about 2,144 stars, and its last recorded push is dated 2026-09-12.

Editorial conclusion

code996 is a small, opinionated CLI that takes one input, the commit history you already have, and turns it into a judgement about working hours. What makes it more than a histogram is the layer of interpretation on top: an index that compresses the picture into one number, a first commit quantile used to infer the standard working day, late evening activity treated as separate evidence, and a trend line that says whether the load is rising or settling. The flags matter as much as the scoring, because a bot committing at midnight or a merge commit from a release branch will distort any of it if left in. It runs entirely on your machine against local git log, so nothing has to be uploaded and no local server has to stay resident after the CLI exits. Read it as a conversation starter for a team rather than a verdict on individuals, and pair the number with the monthly trend before drawing conclusions.

Frequently asked questions

Does code996 send my repository anywhere?

No. The analysis is described as running purely locally and offline on git log, with no upload of repository data and no localhost service that has to stay resident. The generated web report is written to a folder under `Downloads/code996-report/` and you delete that folder to remove it.

How do I stop automated accounts from skewing the numbers?

Use `--ignore-author <regex>` to drop commits from matching authors, for example a renovate or dependabot pattern, with alternatives separated by `|`. Use `--ignore-msg <regex>` to drop commits by message, and anchor the pattern at the start of the line for merge commits. `--self` goes the other way and restricts the analysis to the current Git user.

Why does code996 recommend setting working hours by hand?

The documentation marks `--hours <range>` as recommended because it produces more accurate results than the inferred standard working day. Without it the tool estimates the day from the first commit quantile for each day, which is a reasonable guess but not your actual schedule. Decimal hours work, so `code996 --hours 9.5-18.5` covers a nine thirty to six thirty day.

Can I use the JSON or Markdown output together with the web report?

Not in one run. The default behaviour prints a terminal report and saves the web report without opening it, and `--open` adds the browser launch. `--json` and `--md` produce stable structured output instead and do not generate the web report, they are mutually exclusive with each other, and `--open` cannot be combined with either. Use `--output [path]` to write the structured result to a chosen file.

Official sources

  1. hellodigua/code996 on GitHub
  2. License: MIT
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/hellodigua-code996.svg)](https://hysenlabs.com/projects/hellodigua-code996)