greenbelt

skill
Security Audit
Pass
Health Pass
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 19 GitHub stars
Code Pass
  • Code scan — Scanned 4 files during light audit, no dangerous patterns found
Permissions Pass
  • Permissions — No dangerous permissions requested
Purpose
This tool is a set of Claude Code hooks that automatically tracks your AI token usage across sessions. Whenever your cumulative usage crosses a configurable threshold, it triggers a tree planting via the Ecologi API to help offset your carbon footprint.

Security Assessment
The tool executes locally via Python when Claude sessions start or end. It creates and reads a local SQLite database to track tokens and a local TOML configuration file. It does make external network requests, specifically to the Ecologi API to plant trees and fetch badge counts. You must provide your own Ecologi API key in the configuration file, meaning it only has access to the funds/credits linked to your specific Ecologi account. The codebase scan found no dangerous patterns, hardcoded secrets, or malicious shell executions. Overall risk: Low.

Quality Assessment
The project is fresh and actively maintained, with its last push occurring today. It uses the highly permissive MIT license and has a clear, well-documented README. While community trust is relatively early-stage at 19 GitHub stars, the transparent codebase and straightforward setup indicate a reliable and polished project.

Verdict
Safe to use.
SUMMARY

Greenbelt is Claude Code hooks that track token usage across Claude Code sessions and plants trees to reduce your CO2 impact

README.md

Greenbelt 🌱

Greenbelt tracks token usage across Claude Code sessions and plants trees whenever your token usage crosses a configurable threshold (1M tokens by default). It uses Ecologi API and runs as a Claude Code hook — no manual steps required after setup.

Ecologi is a climate action platform that helps individuals and businesses take measurable, credible action for climate and nature. Fund tree planting from €0.80 (£0.60) per tree. File a feature request if you want to use a different provider.

Get started

Copy and paste the AI prompt:

Clone https://github.com/mikhail-tokarev/greenbelt into the ~/.claude folder and add the hooks as described in README.md

1. Register the hooks

Add the following to your Claude Code settings (~/.claude/settings.json):

[!IMPORTANT]
Replace /path/to/greenbelt with the absolute path where you cloned the repo.

{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "python3 /path/to/greenbelt/session_hook.py"
          }
        ]
      }
    ],
    "SessionEnd": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "python3 /path/to/greenbelt/session_hook.py"
          }
        ]
      }
    ]
  }
}

2. Configure Ecologi

On the first run, Greenbelt creates ~/.claude/greenbelt.toml automatically:

provider = "ecologi"
threshold = 1_000_000   # plant trees every 1M tokens

[ecologi]
api_key = ""            # get it from https://app.ecologi.com/impact-api

Fill in your Ecologi API key. Adjust threshold to control how often trees are planted.

That's it. From this point on, Greenbelt runs silently in the background. At the start of each session it shows how many trees you've planted so far.

Uninstall

  1. Remove the hooks — delete the SessionStart and SessionEnd entries added in step 2 from your Claude Code settings file.

  2. Delete the data files:

rm ~/.claude/greenbelt.sqlite3
rm ~/.claude/greenbelt.toml
  1. Delete the repo (optional):
rm -rf ~/.claude/greenbelt

In Action

Screenshot 2026-03-18 at 11 43 08

Gallery

Add your badge here if you use Greenbelt.

Ecologi

Reviews (0)

No results found