Skip to content

feat: last turn, today and cache share in the status line; release binaries and one-step setup - #6

Merged
cyphalle merged 4 commits into
mainfrom
feat/statusline-turn-today
Oct 19, 2026
Merged

cyphalle merged 4 commits into
mainfrom
feat/statusline-turn-today

Conversation

@cyphalle

Copy link
Copy Markdown
Contributor

Review src/cache.rs, the --wrap subprocess and install_statusline(), which rewrites the user's settings.json.

⚡ 2.3 kWh  💧 12.3 L  🏭 670 gCO₂e ≈ 🚗 2.7 km  🌱 0.13–0.22 PDF·m²·yr ≈ 📄 2.8 A4  ↳ last turn +199 gCO₂e · ♻️ 97% cache
📅 today ⚡ 10.5 kWh  💧 55.4 L  🏭 3.0 kgCO₂e ≈ 🚗 12 km  🌱 0.60–0.97 PDF·m²·yr ≈ 📄 13 A4  17 sessions
  • Status line: CO₂e since the last human prompt, the cache share, and a line for today (since local midnight, jiff).
  • Speed: a day is about 100 MB of transcripts. The scan of each file is cached by length and modification time: 455 ms cold, 65 ms after.
  • statusline --wrap CMD and install-statusline: an existing status line stays on top. There is a backup, and running it twice does nothing.
  • Distribution: on each v* tag, the workflow builds 4 targets (macOS arm64/x86_64, Linux musl). install.sh checks the SHA-256. /nature-footprint:setup does both steps.
  • Version 0.2.0. New dependency: jiff (local midnight). serde_json gets preserve_order, so the key order of settings.json stays the same.

Methodo & data decisions

  • Last turn = requests after the last line with origin.kind = human, or the last string prompt. Tool results and meta lines do not count.
  • Cache share = cache reads / (input + cache writes + cache reads).

Tests: 12 green, clippy clean, claude plugin validate OK.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QUg7CcESDGqbwXB484UeRx

…naries and one-step setup

- statusline: a second line for today, the CO₂e of the last turn, the cache share
- statusline --wrap keeps an existing status line on top; install-statusline writes settings
- scans of transcript files are cached in ~/.cache/claude-nature
- release workflow builds macOS and Linux binaries on each v* tag; install.sh fetches them
- /nature-footprint:setup installs the binary and the status line

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUg7CcESDGqbwXB484UeRx
@cyphalle cyphalle self-assigned this Oct 19, 2026
@cyphalle
cyphalle requested a review from ilaborie October 19, 2026 13:03
feat: hardware manufacturing CO₂e and cooling water at the watershed
@cyphalle
cyphalle merged commit e4ce119 into main Oct 19, 2026
1 check passed
@cyphalle
cyphalle deleted the feat/statusline-turn-today branch October 19, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant