Metadata-Version: 2.5
Name: clickdust
Version: 0.4.2
Summary: Your Claude Code sessions grow an ink forest: a tree each session, a forest each month. Local-first.
Project-URL: Homepage, https://github.com/sanketsans/clickdust
Project-URL: Source, https://github.com/sanketsans/clickdust
Project-URL: Issues, https://github.com/sanketsans/clickdust/issues
Author: sanketsans
License-Expression: MIT
License-File: LICENSE
Keywords: claude-code,data-art,generative-art,keyboard,mouse,quantified-self
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Artistic Software
Requires-Python: >=3.9
Requires-Dist: pynput>=1.8; sys_platform != 'darwin'
Requires-Dist: pyobjc-framework-quartz>=10; sys_platform == 'darwin'
Requires-Dist: screeninfo>=0.8; sys_platform != 'darwin'
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == 'dev'
Description-Content-Type: text/markdown

# clickdust

Your Claude Code sessions grow an ink forest: a tree for each session, a new scene each month.
Drag the sun to travel through the year.

![A month of sessions as a maple forest](https://raw.githubusercontent.com/sanketsans/clickdust/main/docs/forest.png)

*All pictures here use made-up data (`clickdust landscape --demo`).*

## Quick start

```bash
pip install clickdust        # or: pipx install clickdust / uv tool install clickdust
clickdust start              # 1. start recording first (macOS asks once for Input Monitoring: click Allow)
clickdust landscape --open   # 2. then build your forest and open it in the browser
```

Just want to look first? `clickdust landscape --demo --open` uses made-up data and records nothing.
Run `clickdust` with no arguments any time for this guide.

## How to read it

| In the picture | Comes from |
|---|---|
| Tree | one Claude Code session |
| Name | made up from a hash of the session; the title reflects its shape (*the Boomerang*, *the One-Liner*) |
| Limb | a day you worked in that session; a new one grows from the fork each time you come back, in lighter bark |
| Cloud of leaves | one message you sent, on the limb of its day |
| **Red** leaves | your side: `3 + 4 × √(typed ÷ 100)` for each message |
| **Gold** leaves | Claude: `2 × √(output tokens ÷ 1,000)` for each answer |
| Left to right | day of the month |
| Trees, sky, ground | the season of the month: winter plum, cherry, willow, maple |
| Near and large | bigger sessions; small ones form the distant treeline |
| Dark mountains | your typing per day |
| Gold mountains behind | Claude's output tokens per day; each range is scaled to its own busiest day of the month |
| Sun | high in summer, low in winter; its flares are long pointer movements, each pointing the way you moved (months before tracking began have none) |
| Snow, rain, glow, falling leaves | weather for the season: decoration, not data |
| Dry leaves | mouse clicks that day |
| Bird | a day with 55 minutes of messages, no pause over 15 |
| Deer | a weekend without a message |
| Owl | lives in the tree whose session had a message between midnight and 5 am, on that day's limb; open the tree to meet it |

*Typed* is the key presses counted in the five minutes before a message. Where the tracker saw none,
it is the length of the message (long pastes capped at 2,000).

## Explore

![One tree with its history](https://raw.githubusercontent.com/sanketsans/clickdust/main/docs/tree.png)

Growth never moves what is already there: a tree keeps its shape as messages arrive, and its wood
thickens. Where it stands in the forest can change as bigger sessions arrive.

| Move | Mouse / trackpad | Keys |
|---|---|---|
| Open a tree | click it, or its dot under the picture | `←` `→` or `h` `l` |
| Reach a tree behind | scroll while pointing at it, or hover its dot | `b` |
| Travel | drag, or two fingers sideways | |
| Zoom | pinch, double-click, `+` `−` buttons | `+` `-` `0` |
| Change month | drag the sun, flick it, or scroll on it | `↑` `↓` or `k` `j` |
| Play the month | ▶ button, or drag the time line | `Space` |
| Close a tree | ✕ | `Esc` |

**Auto** shows ink by day and dusk by night. **Sound** plays a tree: ticks for your leaves, notes for Claude's.

![The same month at dusk](https://raw.githubusercontent.com/sanketsans/clickdust/main/docs/dusk.png)

## Install

```bash
uvx clickdust landscape --demo --open # try it without installing; records nothing
```

From source: `uv tool install git+https://github.com/sanketsans/clickdust`.
A live example, grown from the author's own sessions: <https://sanketsans.github.io/grove/>.

## What it needs from your computer

| Needs | Permission | What happens without it |
|---|---|---|
| **Claude Code logs** (`~/.claude/projects`, or `CLAUDE_CONFIG_DIR`) | None. They are ordinary files in your home folder, so there is no prompt and it works right after install. | No trees. clickdust has nothing else to grow them from. |
| **Keys and pointer** | **macOS asks once:** *System Settings → Privacy & Security → Input Monitoring*, for the terminal app you start clickdust from. The OS does not allow a program to grant this to itself, so `clickdust start` (or `clickdust doctor --request`) shows the prompt and you click Allow, then reopen the terminal and run `clickdust stop && clickdust start`. | Trees and the gold mountains still work. The typing mountain, ground leaves and sun flares stay empty, and a message's red leaves are sized by its length instead of by what you typed. |

Only Claude Code sessions are read (terminal, VS Code, or the desktop app's Code tab). Chats in the Claude app or claude.ai, and Cowork sessions, are not. If it says it found no sessions, `clickdust status` tells you which folder it looked in.

## Start

| Step | Command | |
|---|---|---|
| 1 | `clickdust start` | record keys and pointer, and keep saving session numbers (macOS asks for Input Monitoring once) |
| 2 | `clickdust landscape --open` | build your forest and open it; trees appear from your existing Claude Code logs straight away |
| 3 | `clickdust status` | is it recording, today's counts and how many trees are saved |
| 4 | `clickdust probe` | only if something looks empty: a 30-second live test that says why |

**Keep it running.** Claude Code deletes session logs after 30 days (its `cleanupPeriodDays`
setting). clickdust copies the numbers every 15 minutes while it runs, and whenever you run
`landscape`, `publish` or `harvest`. Recording does not restart after a reboot or logout.

**Upgrading:** `clickdust stop && pip install -U clickdust && clickdust start`

| Option | Effect |
|---|---|
| `start --no-claude` | do not read Claude Code logs (also on `landscape`, `publish`) |
| `start --no-keys`, `--no-trail` | leave out key counts or cursor movement |
| `landscape --trees maple` | maple all year (default: a tree for each season); also on `publish` |
| `--south` | southern hemisphere seasons |

## Put it on your website

```bash
clickdust publish --site ~/path/to/your-site        # writes your-site/forest/
```

```
up to last Sunday ──▶ reduced ──▶ forest/ ──▶ you review ──▶ git commit + push
```

`publish` only writes files and prints the git commands. It never runs git, never includes the current
week, and never deletes months already there. The folder is plain static files, so GitHub Pages
(including Jekyll) serves it at `/forest/`. Add a menu link yourself, or frame it in one of your pages.

| In the public files | Left out |
|---|---|
| each tree's day, red and gold leaves for each message, message order, which days had a message after midnight | clock times, typed and token counts for each tree |
| typing per day, rounded to 500; Claude's output tokens per day, rounded to 5,000 | active minutes, compactions, helper agents |
| dry leaves per day, sun flares as direction and distance (rounded, no screen position), animal days | session ids, prompts, replies, titles, project names |

Leaf counts follow the equation, so a reader can estimate the size of a message or answer, and sees
which days you were active and how much.

### Publish every week by itself (macOS)

`publish` only writes files. `autopublish` is the one command that runs git: it pulls your site, publishes the finished week, commits **only** the forest folder and pushes. It refuses to run if the site is not on the Pages branch.

```
clickdust schedule --site ~/path/to/you.github.io     # every Monday at 09:00 (a missed run happens when the Mac wakes)
clickdust autopublish --site ~/path/to/you.github.io  # the same job, once, right now
clickdust schedule --remove                            # stop it
```

The log is `autopublish.log` in the clickdust data folder. What goes public is the same reduced data as `publish`.

## Privacy

| Stored on your machine | Never stored |
|---|---|
| click and cursor positions, time, button | which keys you press, or their order |
| how many keys went down in each 10-second slot | the text you type or Claude writes |
| device class: built-in or external | window titles, application or project names, screenshots |
| for Claude Code: time and length of your messages, time and output tokens of replies, compactions, helper agents, a hash per session | session titles, file paths |
| monitor rectangles | |

- On macOS the key code is never read from the event; only whether it is an auto-repeat.
- Keys are ignored while macOS Secure Input is on (password fields).
- Session logs are read to count; message text is measured and discarded.
- There is no network code. `clickdust doctor` prints where the database lives.
- `clickdust purge --all` deletes the data, and older sessions are not read back in. Pages you already
  built or published stay as they are.

If this is a work computer, check that your employer allows input tracking and publishing activity data.

## Platforms

| | Keys and clicks | Claude Code logs |
|---|---|---|
| macOS | event tap | `~/.claude` or `CLAUDE_CONFIG_DIR` |
| Windows | through pynput, untested | same, untested |
| Linux X11 | through pynput, untested | same, untested |
| Linux Wayland | not supported | works without the tracker |

The log format is Claude Code's own and may change with its versions. Without Claude Code there are
no trees.

## Also included: single-day pictures

`clickdust render --style dots|constellation|ripples|trails --open` draws one day's pointer data as SVG.

## Develop

```bash
uv venv && uv pip install -e '.[dev]' && .venv/bin/pytest
```

```
src/clickdust/
  backends/    OS input → sink calls (macos.py, hid.py, generic.py)
  tracker.py   recording loop          claude.py   session log numbers
  store.py     SQLite
  landscape/   model.py → export.py → site.py
  web/         the page: viewer.js, viewer.css, index.html
  render/      the single-day SVG styles
```
