Skip to content
Projets

À propos

A Claude Code mod that tracks time, tokens and API cost per project. It also shows when your prompt cache goes cold and draws a yearly activity heatmap with 8 themes.

Outils de développement

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
0
in 7 days
+36
in 15 days
Historique en cours
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

Worklog

A Claude Code mod that tracks time, tokens and API cost per project. It also shows when your prompt cache goes cold and draws a yearly activity heatmap with 8 themes.

Claude Code mod MIT license Runs in the desktop app and the terminal

Worklog above the Claude Code prompt box: the time, the tokens and the streak, the cache status, a heatmap of the year, and the time of each name. The pointer points to Cache 56 min, and a box shows how long the cache stays warm and the price of the next message. Then it points to Tokens, and a box shows the tokens of each type and each model. Then it clicks Month and All. In the settings, it picks the Sakura theme and sets Show to Tokens and price. It clicks Day and points to the API price: the box now shows the price of each line. It clicks All, then goes back to the Aurora theme and to Time and tokens.

Quick start · Update · Usage · How the timer works · Breaks · Project names · Tokens and price · Prompt cache · Themes · Terminal · Settings · FAQ · Privacy


What it does

  • Counts your time while Claude works: answers, subagents, background commands, Ultracode and more.
  • Counts your tokens and shows what they would cost on the API.
  • Shows your whole year as a heatmap, with 8 themes to choose from.
  • Shows your prompt cache: warm or cold, and the price of your next message.
  • Includes your past work: at install, it reads your Claude Code history for the time, the tokens and the price.
  • Keeps your data on your computer.

Quick start

  1. Install Worklog:

    claude plugin marketplace add Abdoul-sudo/worklog
    claude plugin install worklog@worklog
    
  2. Restart Claude Code.

A small button then appears at the bottom of Claude Code, with your project and its time today, for example ⏱ mobile-app · 1h 12. This button, or the /worklog command, opens Worklog.

Worklog needs Claude Code 2.1.325 or later. Node.js is optional: with it, Worklog also imports your past work.

Update

By default, Claude Code does not update Worklog. You can turn on automatic updates one time:

  1. In Claude Code, type /plugin.
  2. Open the Marketplaces tab.
  3. Select worklog.
  4. Select Enable auto-update.

After that, each new version comes when you start a session.

You can also update by hand, with these commands:

claude plugin marketplace update worklog
claude plugin update worklog@worklog

Then restart Claude Code, or type /reload-plugins.

To hear about each new version, watch the releases of this repository: Watch > Custom > Releases.

Usage

Each line in the list is a name: a project or a task. The bright dot marks the name of this session.

Worklog with 7 numbered parts. 1: the Day, Week, Month, Year and All tabs, at the top right. 2: the back and forward arrows, next to Today. 3: the gear, at the top right. 4: the switch icon next to the name website. 5: Add item, under the list. 6: mobile-app, the name of this session, with a bright dot. 7: Cache 49 min, to the left of the tabs.

  1. Period. Day, Week, Month, Year and All change the period that you see.
  2. Back and forward. The arrows go to the period before or after.
  3. Settings. The gear opens the settings.
  4. Switch. Hover over another name and click ⇄ to move this session to it, from now on.
  5. New name. + Add item creates a name and moves this session to it.
  6. Rename. Hover over the name with the bright dot and click ✎. Past days get the new name too.
  7. Cache. The status of the prompt cache. See Prompt cache.

Hover over a day in the heatmap to see its numbers.

In the terminal, a click on a name moves this session to it, and ≡ opens the settings.

Command What it does
/worklog Shows or hides Worklog.
/worklog <name> Moves this session to <name>, from now on. For example: /worklog PROJ-142.

How the timer works

  • It starts with your first message. Opening a session does not count.
  • It runs while Claude works, even for hours without you.
  • It stops when Claude is done. A break starts. When you come back, Worklog decides if the break counts. See Breaks.
  • Background commands count while Claude waits for them. If you come back before one ends, for example a dev server that never stops, the wait becomes a break.
  • Many things at once in one project count once. 3 subagents that work for 10 minutes give 10 minutes, not 30.
  • Two projects at once each get their time. The total shows the overlap, for example "incl. 1h 00 in parallel".

Breaks

A break is the time between the end of Claude's work and your next message.

Break What Worklog does
Short: up to 1h Counts the break as work.
Long: from 1h to 4h Asks you if the break was work.
Very long: more than 4h Does not count the break as work, and does not ask.

One day with Worklog. Work always counts. A short 30 min break counts as work when you come back. For a long 2h break, Worklog asks you. The night is a very long break: it does not count.

For a long break, the question appears under Worklog:

Under Worklog, in a yellow frame, the question: 2h 08 break on website, from 9:12 to 11:20. Count it as work? Two buttons: Count and Ignore.

If you close Claude Code during a short break, the break counts as work up to the moment you close Claude Code.

You can change the 1h and the 4h in the settings.

Project names

Worklog puts the time of each session under one name. It picks the name in this order:

  1. The name that you choose, with /worklog <name> or in the list.
  2. An ID in your messages, for example PROJ-142. To stop this, see Privacy and access.
  3. An ID in the name of your Git branch, for example feature/PROJ-142-login.
  4. The name of the project folder. In a Git worktree, the name of the main project.

When Worklog finds the first ID of a session, the time before it also goes to this ID.

Tokens and price

If tokens matter more to you than time, set Show to Tokens and price in the settings. The API price then takes the place of the time.

Worklog with Show set to Tokens and price: 20.3M tokens and $20 today, and the tokens and the price of each name. Yellow frames mark the API price and the price of each name.

  • The price is what your tokens would cost on the Anthropic API.
  • On a Pro or Max plan, it is not what you pay. It shows what the same work would cost on the API.
  • Worklog always counts the price, even when it shows the time. So your past days have a price too.

Token details

Hover over Tokens, API price or the tokens of a name to see your tokens by type and by model. This works in the desktop app.

Worklog with Show set to Tokens and price. The pointer is on the API price of today, 20 dollars, and a box is open under it. On the left: input 33.4k tokens for 12 cents, output 361k for 6.19 dollars, cache write 1.6M for 10 dollars, cache read 18.3M for 3.17 dollars. On the right: Opus 5.5, 14.7M tokens for 16 dollars, Sonnet 5.5, 5.4M tokens for 3.45 dollars, and Haiku 5.5, 152k tokens for 2 cents.

Prompt cache

Claude Code keeps your conversation in a prompt cache, which makes each message cheaper. After some time without sending a message, the cache goes cold. The next message then writes the whole conversation again, at full price.

Worklog with the pointer on Cache cold, at the top, to the left of the tabs. A box is open under it: Cache cold, 76.1k tokens. It expired at 21:23, and the last call was at 20:23. The next message costs about $0.02, and less than $0.01 with a warm cache. Under it: The next message writes the whole context again.

Worklog shows the cache status at the top, to the left of the tabs:

  • Cache 42 min: the cache is warm for 42 more minutes.
  • In the last 10 minutes, the text turns yellow.
  • Cache cold: the next message writes the whole conversation again.

In the desktop app, hover over the cache status to see more: when the cache expires, how long it lives, the time of the last call, the size of the context, and the estimated price of the next message, warm or cold.

Worklog with the pointer on Cache 59 min, at the top, to the left of the tabs. A box is open under it: Cache warm, 76.6k tokens, 59 min left of 1h. It expires at 22:36, and the last call was at 21:36. The next message costs less than $0.01, and about $0.02 if the cache goes cold. Under it: Each message keeps the cache warm.

  • Each call to the model makes the cache warm again for its full time. Claude Code usually keeps the cache for 1 hour.
  • Each model has its own cache. When you change the model, the cache is cold.
  • Subagents have their own cache. Their calls do not change the status.
  • After /compact, the status comes back with the next answer.
  • Worklog estimates the status from the calls it sees. The API does not give the real status.

Themes

Worklog comes with 8 themes in the desktop app. You choose one in the settings.

Worklog in its eight themes: Default, Night, Aurora, Ember, Forest, Ocean, Dusk and Sakura.

In the terminal

Worklog works in the terminal too, with the same data.

Worklog in the terminal: the stats and the names on the left, the heatmap of the year on the right.

Clicks in the terminal need the fullscreen mode: /tui fullscreen.

Settings

The settings, with the Show menu open: Time and tokens, or Tokens and price. The eight themes on the right.

Setting Default What it does
Show the activity heatmap On Shows or hides the heatmap.
Show the cache status On Shows or hides the cache status.
Show Time and tokens Shows the time and the tokens, or the tokens and their API price.
Language English English or French.
Stay active during breaks Up to 1h A break up to this length is short: it counts as work.
Then ask Up to 4h Worklog asks you about a break up to this length. A longer break does not count. Never turns off the question.
Theme Night Desktop app only.

FAQ

Does Worklog use my Claude usage?

No, Worklog never uses tokens and does not count toward your plan limits. It only reads the files that Claude Code already writes on your computer.

Where does the API price come from?

Worklog takes the prices from the public LiteLLM price list. It gets the list again once a day. The settings show the date of the list.

Worklog checks each new list. If a price changes by more than 2 times, Worklog keeps the old list. This stops an error in the LiteLLM list from changing the price of your past days. To use the new list anyway, delete ~/.claude/worklog/prix.json, then restart Claude Code.

For your past work, Worklog reads the details of each answer in your Claude Code history. If Claude Code deleted an old conversation, the tokens of that conversation have no price.

Do all tokens have the same price?

No. The API gives a different price to each type of token, and Worklog uses each price:

  • Input tokens (what Claude reads): the normal price.
  • Output tokens (what Claude writes): about 5 times the input price.
  • Cache writes (Claude saves your conversation for later): 1.25 times the input price for 5 minutes, 2 times for 1 hour.
  • Cache reads (Claude reads the saved conversation again): only 0.1 times the input price.

In long sessions, most tokens are cache reads. They are cheap, so many tokens can still cost little.

Does a resumed or forked conversation count twice?

No. When you resume or fork a conversation, Claude Code can copy old messages into the new file. Worklog counts each message only once.

If I delete a conversation, do I lose its data?

No. Worklog keeps its own copy of your time and tokens in ~/.claude/worklog/. When you delete a conversation in Claude Code, this copy stays.

Privacy and access

Worklog runs on your computer and keeps its data there. This is everything it can access:

Access What Worklog does
Reads files Its own data in ~/.claude/worklog/. Your Claude Code history in ~/.claude/projects/, for the time, the tokens and the model of each answer.
Writes files Only its own data, in ~/.claude/worklog/.
Runs commands git branch --show-current, to find an ID in the branch name. node, to read your past history.
Network Once a day, it downloads the public LiteLLM price list. It sends nothing about you or your work.
Your messages It reads each message to find an ID, for example PROJ-142. It does not keep your messages.

These environment variables change this:

  • WORKLOG_PRICES=off stops the price download.
  • WORKLOG_MESSAGES=off stops the search for an ID in your messages. Worklog then names each session from its folder or its branch.
  • WORKLOG_DATA_DIR keeps the data in another folder.

Uninstall

claude plugin uninstall worklog@worklog

Your data stays in ~/.claude/worklog/. To remove it too, delete this folder.

License

MIT

Explorer des projets similaires

Chargement…