From green-code
Reads and updates green-code plugin settings: API key, planter ID, operating mode (auto/manual), CO2 threshold, and energy mix. Also triggers setup and bootstrap scripts when no config or usage data exists.
How this skill is triggered — by the user, by Claude, or both
Slash command
/green-code:configThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Read and modify the green-code plugin configuration.
Read and modify the green-code plugin configuration.
Location: ~/.claude/plugins/data/green-code/config.json
Fields:
treenation_api_key (string) -- Tree-Nation Bearer tokenforest_id (number) -- Tree-Nation forest ID (numeric)mode (string) -- "auto" or "manual"threshold_co2_kg (number) -- kg CO2 per tree, default 10co2_grams_per_kwh (number) -- carbon intensity, default 380 (US mix)pue (number) -- Power Usage Effectiveness, default 1.2If called without arguments (/green:config):
If called with arguments (e.g., /green:config mode auto):
key valuemode must be "auto" or "manual"threshold_co2_kg must be a positive numberco2_grams_per_kwh must be a positive numberpue must be between 1.0 and 2.0treenation_api_key and forest_id accept any non-empty stringRun the setup script:
"${CLAUDE_PLUGIN_ROOT}/scripts/setup.sh"
Or create the config directory and file manually by asking the user for each field.
If ~/.claude/plugins/data/green-code/usage.json does not exist, run the bootstrap script to perform an initial analysis of historical token usage:
"${CLAUDE_PLUGIN_ROOT}/scripts/bootstrap.sh"
This scans the session transcripts in ~/.claude/projects/, computes accumulated CO2 from all past usage still on disk, and creates usage.json. It can take up to a minute on large histories. Show the bootstrap output to the user.
green-code -- Configuration
API Key: abc1...xyz9
Planter ID: 12345
Mode: manual (track only, plant with /green:plant)
Threshold: 10 kg CO2 per tree
Energy mix: 380 gCO2/kWh (US average)
PUE: 1.2
To change: /green:config <key> <value>
Keys: mode, threshold_co2_kg, co2_grams_per_kwh, pue, treenation_api_key, forest_id
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub jeremiesamson/green-code --plugin green-code