The Problem
Every developer merges code every day. Nobody knows the carbon cost of that code.
A single N+1 query in production can trigger thousands of unnecessary database calls per minute. A poorly configured CI/CD pipeline wastes compute on every single commit. No tool today measures this automatically inside GitLab. Developers have zero visibility into the environmental cost of their work and zero incentive to change.
What CARBIDE Does
CARBIDE is a custom AI agent built on the GitLab Duo Agent Platform, powered by Anthropic Claude. It embeds carbon awareness directly into the software development lifecycle automatically, without interrupting the developer's workflow.
When a developer merges code, CARBIDE wakes up and:
- Reads the changed files and scans for energy anti-patterns
- Analyses the CI/CD pipeline for wasted compute jobs
- Calculates a Carbon Score from 0 to 100
- Posts a Green Code Review comment directly on the MR with exact file and line references
- Gives exactly 3 prioritised actions to reduce the carbon impact
- Enforces sustainability as a hard requirement MRs with a Carbon Score below 60 are blocked by the Carbon Gate
Every Monday, CARBIDE generates a full Green Finance Report as a GitLab Issue including Sprint ESG Score, cost-per-carbon-unit, and carbon efficiency trend. These are financial sustainability metrics applied to software development sprints a concept unique to CARBIDE and directly aligned with the GrYEN sustainability intelligence platform.
The Carbon Score Algorithm
CARBIDE v2 uses a deterministic, reproducible scoring engine (tools/carbon_scorer.py) not AI-guessed numbers. It detects 7 types of energy anti-patterns with specific penalties:
| Anti-Pattern | Penalty |
|---|---|
| N+1 Queries | -20 |
| Memory Leaks | -18 |
| Polling Loops | -15 |
| Unindexed Search | -14 |
| Sync Blocking Calls | -12 |
| Heavy Dependencies | -8 |
| Inefficient Loops | -5 |
The final Carbon Score combines three signals:
- Code energy patterns (35%) N+1 queries, polling loops, memory leaks, blocking calls, heavy dependencies
- Pipeline efficiency (35%) wasted jobs, retries, duplicate stages, unconditional jobs
- AI usage efficiency (30%) inefficient Duo sessions, repeated prompts, sessions producing no commit
Final Score = (code × 0.35) + (pipeline × 0.35) + (AI × 0.30)
- 🟢 80–100 = Green — excellent sustainability
- 🟡 60–79 = Improving — some issues to address
- 🔴 0–59 = Action required — significant waste detected
What Makes CARBIDE Unique
CARBIDE is the only agent in this hackathon that combines three signals into a single Carbon Score. Every other tool measures one thing. CARBIDE measures everything.
CARBIDE v2 goes further with a Carbon Gate a real CI/CD enforcement layer that blocks merges when sustainability standards are not met. This makes carbon awareness not just a suggestion, but a production requirement.
It also introduces Green Finance metrics to software development Sprint ESG Score and cost-per-carbon-unit concepts borrowed from financial sustainability reporting and applied to development sprints. No other developer tool does this.
Unlike GitGreen (the only comparable submission), CARBIDE works on any GitLab project on any cloud or on-premise runner. No Google Cloud required. No API keys. No setup. Just enable and go.
How We Built It
CARBIDE v2 is built on the GitLab Duo Agent Platform with the following structure:
agent.yml— defines CARBIDE's identity, the Carbon Score algorithm, all output formats, and 16 GitLab Duo toolsflow.yml— defines two automated steps: Green Code Review (triggers on MR) and Pipeline Green Audit (triggers on pipeline completion)tools/carbon_scorer.py— deterministic carbon scoring engine with 7 anti-pattern detectorstools/carbon_gate.py— CI/CD gate that enforces a minimum Carbon Score of 60carbon-history.json— persistent score tracking across sprints for trend analysissample_app/data_processor.py— demo app with 6 intentional energy anti-patterns for testingAGENTS.md— gives CARBIDE context about every project it runs in
No backend. No server. No deployment. Claude (via GitLab's built-in Anthropic integration) is the reasoning engine.
Challenges
The biggest challenge was moving from AI-estimated scoring to a deterministic, reproducible Carbon Score engine. The scoring had to be honest never claiming exact CO2 values, but providing relative, actionable scores that developers can trust and measure over time.
The second challenge was understanding the exact GitLab Duo Agent Platform v1 schema for flows. The schema requires a specific structure with definition, components, prompts, routers, and flow sections and the validator is strict. Multiple iterations were needed to get the YAML exactly right.
Accomplishments
- CARBIDE is live in the GitLab AI Catalog (catalog ID:
gid://gitlab/Ai::Catalog::Item/1006097) - The flow is live (catalog ID:
gid://gitlab/Ai::Catalog::Item/1006098) - CARBIDE successfully posted a real Carbon Score of 52/100 on the sample app with a detailed three-signal breakdown, exact file and line references, and Green Finance metrics
- Carbon Gate CI/CD enforces sustainability as a hard merge requirement
- Carbon history tracking enables sprint-over-sprint trend analysis
- Zero setup required works on any GitLab project instantly
What We Learned
- The GitLab Duo Agent Platform is genuinely powerful a system prompt and tool configuration is enough to create a sophisticated sustainability analysis agent
- Deterministic scoring matters developers trust numbers more when they can trace exactly why a score changed
- Green Finance metrics (ESG scoring, cost-per-carbon-unit) are the right language to make sustainability relevant to business stakeholders, not just environmentally conscious developers
- The hardest part of building an AI agent is not the code it is the system prompt design
What's Next — GrYEN
CARBIDE is not a standalone hackathon project. It is the first module of GrYEN a full sustainability intelligence platform that fuses carbon footprint tracking with financial decision-making.
Every metric CARBIDE produces maps directly to GrYEN:
| CARBIDE Metric | GrYEN Equivalent |
|---|---|
| Carbon Score | GrYEN Green Score™ per user and business |
| Sprint ESG Score | GrYEN business ESG dashboard |
| Weekly Green Finance Report | BRSR/GRI compliance reporting |
| Cost-per-carbon-unit | GrYEN financial sustainability layer |
| Carbon history tracking | Lifetime sustainability trend per developer |
After the hackathon, businesses using GrYEN can connect their GitLab projects to track how their development process contributes to their overall ESG score. Developers earn GrYEN sustainability tokens for clean code. The hackathon is the proof of concept. GrYEN is the destination.
Built With
- GitLab Duo Agent Platform
- Anthropic Claude (via GitLab built-in)
- GitLab CI/CD
Log in or sign up for Devpost to join the conversation.