Harness Forge

Harness Forge enhances AI coding agents by continuously improving their performance and visibility.

<p align="center"> <img src="https://img.shields.io/badge/%F0%9F%94%A8_harness--forge-v1.5.2-6C3FC5?style=for-the-badge" alt="version" /> </p> <h1 align="center">πŸ”¨ Harness Forge</h1> <p align="center"> <strong>Your AI coding agent is only as good as its harness.</strong> <br /> One command to scan, equip, and continuously improve any AI coding agent in your repository. </p> <p align="center"> <img src="./assets/demo.gif" alt="Harness Forge demo" width="700" /> </p> <p align="center"> <a href="https://github.com/ldilov/harness-forge/actions/workflows/ci.yml"> <img alt="Build" src="https://img.shields.io/github/actions/workflow/status/ldilov/harness-forge/ci.yml?branch=main&style=for-the-badge&logo=githubactions&label=build&color=2ea44f" /> </a> <a href="https://www.npmjs.com/package/@harness-forge/cli"> <img alt="npm" src="https://img.shields.io/npm/v/@harness-forge/cli?style=for-the-badge&logo=npm&color=CB3837" /> </a> <a href="https://www.npmjs.com/package/@harness-forge/cli"> <img alt="downloads" src="https://img.shields.io/npm/dm/@harness-forge/cli?style=for-the-badge&logo=npm&label=downloads&color=0070f3" /> </a> <a href="https://github.com/ldilov/harness-forge/stargazers"> <img alt="stars" src="https://img.shields.io/github/stars/ldilov/harness-forge?style=for-the-badge&logo=github&color=f5c518" /> </a> <a href="./LICENSE"> <img alt="license" src="https://img.shields.io/badge/license-GPL--3.0-EF4444?style=for-the-badge" /> </a> <img alt="node" src="https://img.shields.io/badge/node-22+-339933?style=for-the-badge&logo=nodedotjs&logoColor=white" /> </p> <p align="center"> <a href="#-get-started-in-60-seconds">πŸš€ Get Started</a> &bull; <a href="#-the-living-loop--your-harness-gets-smarter">πŸ”„ Living Loop</a> &bull; <a href="#-real-time-dashboard">πŸ“Š Dashboard</a> &bull; <a href="#-your-daily-workflow">⌨️ Commands</a> &bull; <a href="#-real-world-scenarios">πŸ’‘ Scenarios</a> &bull; <a href="#-supported-targets">🎯 Targets</a> &bull; <a href="#-faq">❓ FAQ</a> </p>
<!-- LAYER 1: What is this? (5 seconds) --> <table> <tr> <td align="center" width="33%">

πŸ” Scans & Equips

Your AI agent gets your repo's languages, frameworks, and patterns from the first prompt

</td> <td align="center" width="33%">

πŸ”„ Self-Improves

A closed feedback loop learns what works, tunes itself, and gets smarter every session

</td> <td align="center" width="33%">

πŸ“Š Full Visibility

Real-time dashboard shows every decision, token spend, and compaction β€” no black boxes

</td> </tr> </table> <br />
Without Harness ForgeWith Harness Forge
🧠 ContextAgent guesses at project structureAgent knows your languages, frameworks, boundaries
⚑ PerformanceStarts fresh every sessionSelf-improves over time via the Living Loop
πŸ“Š VisibilityBlack box β€” no idea what the agent decidedReal-time dashboard with 20 live panels
πŸ’° CostWasted tokens on retries and wrong pathsCompaction + auto-tuning saves 20-40%
πŸ“€ PortabilityStuck on one machine, one setupExport & import learned patterns as .hfb bundles
<p align="center"> <img src="https://img.shields.io/badge/🎯_targets-4-6C3FC5?style=for-the-badge" alt="4 targets" /> <img src="https://img.shields.io/badge/🌐_languages-14-0070f3?style=for-the-badge" alt="14 languages" /> <img src="https://img.shields.io/badge/πŸ—οΈ_frameworks-12-2ea44f?style=for-the-badge" alt="12 frameworks" /> <img src="https://img.shields.io/badge/πŸ› οΈ_skills-45+-f97316?style=for-the-badge" alt="45+ skills" /> <img src="https://img.shields.io/badge/πŸ“Š_commands-50+-EF4444?style=for-the-badge" alt="50+ commands" /> </p> <p align="center"> <img alt="Loop" src="https://img.shields.io/badge/loop-self--improving-brightgreen?style=flat-square" /> <img alt="Patterns" src="https://img.shields.io/badge/patterns-auto--learned-blue?style=flat-square" /> <img alt="Tunings" src="https://img.shields.io/badge/tunings-guardrailed-orange?style=flat-square" /> </p>
<!-- LAYER 2: The differentiators (15 seconds) -->

πŸ”„ The Living Loop β€” Your Harness Gets Smarter

Most tools configure once and forget. Harness Forge keeps learning.

<p align="center">
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ πŸ”       β”‚    β”‚ 🧠       β”‚    β”‚ ⚑       β”‚    β”‚ πŸ“€       β”‚    β”‚ πŸ“₯       β”‚
  β”‚ OBSERVE  │───▢│  LEARN   │───▢│  ADAPT   │───▢│  SHARE   │───▢│  IMPORT  β”‚
  β”‚          β”‚    β”‚          β”‚    β”‚          β”‚    β”‚          β”‚    β”‚          β”‚
  β”‚ Tracks   β”‚    β”‚ Finds    β”‚    β”‚ Auto-    β”‚    β”‚ Export   β”‚    β”‚ Bootstrapβ”‚
  β”‚ sessions β”‚    β”‚ patterns β”‚    β”‚ tunes    β”‚    β”‚ bundles  β”‚    β”‚ anywhere β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β–²                                                              β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
</p> <table> <tr> <td width="50%">

πŸ“… Day 1 β€” You install

npx @harness-forge/cli

Scans your repo. Installs skills, rules, knowledge packs. Default settings. Everything works out of the box.

</td> <td width="50%">

πŸ“… Day 3 β€” After ~10 sessions

🧠 Pattern found: "Summarize" saves 40% more tokens
   than "Trim" in this repo (confidence: 82%)

⚑ Auto-tuned: compaction threshold 75% β†’ 65%
   Result: 20% fewer budget warnings
</td> </tr> <tr> <td width="50%">

πŸ“… Day 5 β€” Share with your team

hforge export --bundle my-team.hfb
# Send to a teammate β†’
hforge import my-team.hfb
# They get your learned patterns instantly
</td> <td width="50%">

πŸ“… Ongoing β€” Dashboard shows it all

hforge dashboard

Loop health ring, effectiveness scores, pattern list, tuning log β€” live in your browser.

</td> </tr> </table>

The more you use it, the better it gets. After ~10 sessions, Harness Forge has learned your repo's patterns and tuned itself for optimal performance. No manual configuration needed.

<details> <summary><strong>πŸ›‘οΈ Guardrails β€” auto-tuning is safe</strong></summary>
  • Every tunable parameter has hard min/max bounds β€” the tuner can't go wild
  • Every change is logged with before/after values and the pattern that triggered it
  • If the next 3 sessions score worse, the tuning is automatically reverted
  • Your manual config overrides are sacred β€” the tuner won't touch them
  • The dashboard shows every tuning with a one-click revert button
</details>

πŸ“Š Real-Time Dashboard

hforge dashboard β€” see everything, live in your browser.

<p align="center"> <img src="./assets/dashboard.jpeg" alt="Harness Forge Dashboard" width="700" /> </p> <p align="center"> <img src="https://img.shields.io/badge/πŸ“Š_dashboard-20_live_panels-6C3FC5?style=for-the-badge" alt="20 panels" /> <img src="https://img.shields.io/badge/πŸ””_notifications-desktop_alerts-2ea44f?style=for-the-badge" alt="notifications" /> <img src="https://img.shields.io/badge/πŸ”Œ_connection-websocket_realtime-0070f3?style=for-the-badge" alt="realtime" /> </p> <table> <tr> <td align="center" width="25%">

πŸ”„ Loop Ring

Live status of each loop stage with health score

</td> <td align="center" width="25%">

πŸ“ˆ Effectiveness

Session score trend β€” are things getting better?

</td> <td align="center" width="25%">

🧠 Insights

Discovered patterns with confidence bars

</td> <td align="center" width="25%">

⚑ Tuning Log

Policy changes with one-click revert

</td> </tr> </table> <details> <summary><strong>πŸ“‹ All 20 dashboard panels</strong></summary>
PanelWhat it shows
πŸ”’ KPI CardsTotal events, tokens, enforcement level, budget gauge
πŸ“ˆ Event TimelineScatter plot of all events over time, color-coded by category
πŸ’Ύ Memory PressureToken usage line chart with threshold marklines
πŸ“Š Budget BreakdownDonut chart of budget allocation (hot-path, output, tools, safety)
πŸ“‹ Live Event FeedSearchable, expandable table of every harness decision
πŸ€– Subagent BriefsDelegated tasks, their context, and outcomes
πŸ“Š Brief MetricsSubagent activity summary and success rates
πŸ”‡ Suppression GaugeHow many duplicate context items were removed
πŸšͺ Expansion GateHistory access requests β€” granted vs denied
βš™οΈ Config EditorEdit memory-policy, context-budget, load-order live
πŸ”„ Loop Health RingSelf-improvement cycle status with stage counts
πŸ“ˆ Effectiveness TrendSession score sparkline (last 20 sessions)
🧠 Insights PanelDiscovered patterns with confidence and "NEW" badges
⚑ Tuning LogPolicy changes with before/after and revert button
πŸ“Š Event DistributionBar chart of top event types
⏱️ Event RateEvents per minute over time
πŸ—ΊοΈ Event HeatmapCategory Γ— time heatmap
πŸ’° Tokens SavedRunning counter of tokens saved by compaction
πŸ“Š Profile DistributionOutput profile selection breakdown
ℹ️ Session InfoSession ID, uptime, version, connection status
</details>

πŸ”” Desktop notifications for critical events β€” budget exceeded, memory rotation, tuning applied, pattern discovered.

🏒 Multi-project support β€” switch between projects in one dashboard. Your project list is saved in the browser.


<!-- LAYER 3: Getting started and daily use (1 minute) -->

πŸš€ Get Started in 60 Seconds

<table> <tr> <td width="55%">
npx @harness-forge/cli

The CLI walks you through:

  1. 🎯 Which AI targets (Codex, Claude Code, or both)
  2. πŸ“Š How deep (quick / recommended / advanced)
  3. πŸ‘€ Preview of exactly what gets created
  4. βœ… One confirmation and you're done

Then make hforge available on your PATH:

npx @harness-forge/cli shell setup --yes
</td> <td width="45%" align="center">

One-liner for CI / scripts:

hforge init \
  --root . \
  --agent codex \
  --agent claude-code \
  --setup-profile recommended \
  --yes

Verify everything is healthy:

hforge doctor --root . --json
</td> </tr> </table>

⌨️ Your Daily Workflow

Commands organized by when you use them β€” not alphabetically.

πŸŒ… Starting a session

CommandWhat it does
πŸ’‘hforge nextRecommends the single most useful action right now
πŸ₯hforge doctorFull health check with evidence
πŸ”„hforge refreshRegenerate runtime after code changes
πŸ“‹hforge statusReview what's installed

πŸ”„ While working

CommandWhat it does
πŸ“Šhforge dashboardOpen the real-time browser dashboard
πŸ“ˆhforge scoreShow recent session effectiveness scores
🧠hforge insightsBrowse learned patterns with confidence
⚑hforge adaptView/manage auto-tunings
πŸ”hforge traceView recent session traces
πŸ”„hforge loopLiving Loop health summary

πŸ“€ Sharing & maintenance

CommandWhat it does
πŸ“¦hforge export --bundle team.hfbExport tuned harness as portable bundle
πŸ“₯hforge import team.hfbBootstrap from a shared bundle
πŸ”§hforge updateUpdate harness to latest version in place
πŸ”¬hforge auditVerify install integrity
πŸ”Žhforge diff-installCheck what drifted since last install
🧹hforge pruneClean up unused artifacts

🧬 Advanced

CommandWhat it does
πŸ—ΊοΈhforge cartographMap repo structure and boundaries
πŸ”hforge recommendEvidence-backed setup recommendations
🧬hforge recursive plan "..."Structured recursive analysis for hard problems
🎯hforge target compare codex claude-codeSide-by-side target comparison

πŸ’‘ Real-World Scenarios

<table> <tr> <td width="50%">

πŸ“‚ "Just cloned a repo, want AI help"

cd my-project
npx @harness-forge/cli
# Done β€” AI assistant understands this project
</td> <td width="50%">

🀝 "I use both Codex and Claude Code"

hforge init --agent codex --agent claude-code --yes
hforge target compare codex claude-code

Both agents share .hforge/ but get their own config bridges.

</td> </tr> <tr> <td width="50%">

πŸ”™ "Coming back to a project after a break"

hforge next
# Tells you: refresh runtime, review stale artifacts
</td> <td width="50%">

πŸ‘₯ "Standardize AI setup across my team"

hforge export --bundle our-team.hfb
# Teammate runs:
hforge import our-team.hfb
# Same learned patterns, instant bootstrap
</td> </tr> </table>

🎯 Supported Targets

<p align="center"> <img src="https://img.shields.io/badge/Codex-full_support-2ea44f?style=for-the-badge" alt="Codex" /> <img src="https://img.shields.io/badge/Claude_Code-full_support-6C3FC5?style=for-the-badge" alt="Claude Code" /> <img src="https://img.shields.io/badge/Cursor-partial-f97316?style=for-the-badge" alt="Cursor" /> <img src="https://img.shields.io/badge/OpenCode-partial-f97316?style=for-the-badge" alt="OpenCode" /> </p> <table> <tr> <td width="50%">
CodexClaude Code
Runtimeβœ… Fullβœ… Full
Maintenanceβœ… Fullβœ… Full
HooksπŸ“„ Docs-drivenβœ… Native
PluginsπŸ“„ Manualβœ… Native
Shared .hforge/βœ… Yesβœ… Yes
</td> <td width="50%">

Use both together β€” they share the same .hforge/ runtime.

hforge target compare codex claude-code
</td> </tr> </table>

πŸ“¦ What's Included

<p align="center"> <img src="https://img.shields.io/badge/🌐_languages-14-0070f3?style=for-the-badge" alt="14 languages" /> <img src="https://img.shields.io/badge/πŸ—οΈ_frameworks-12-2ea44f?style=for-the-badge" alt="12 frameworks" /> <img src="https://img.shields.io/badge/πŸ› οΈ_skills-45+-f97316?style=for-the-badge" alt="45+ skills" /> </p> <details> <summary><strong>🌐 14 Language packs</strong></summary>

TypeScript, Python, Java, Go, Kotlin, Rust, C++, .NET, PHP, Perl, Swift, Shell, Lua, PowerShell

</details> <details> <summary><strong>πŸ—οΈ 12 Framework packs</strong></summary>

React, Next.js, Vite, Express, FastAPI, Django, ASP.NET Core, Spring Boot, Laravel, Symfony, Gin, Ktor

</details> <details> <summary><strong>πŸ› οΈ 45+ Skills</strong></summary>

Language engineering, workflow orchestration, operational helpers, and specialized skills like incident triage, dependency upgrades, API contract review, database migration review, release readiness, and token-budget-optimizer for context-aware compaction.

</details>

βš™οΈ How It Works Under the Hood

<details> <summary><strong>πŸ—‚οΈ What gets created in your repo</strong></summary>
Your Repo
  β”‚
  β”œβ”€β”€ AGENTS.md              ← AI agents read this first
  β”œβ”€β”€ .agents/skills/        ← Discoverable skills
  β”œβ”€β”€ .codex/ or .claude/    ← Target-specific config
  └── .hforge/               ← Hidden canonical runtime
         β”œβ”€β”€ library/        ← Skills, rules, knowledge packs
         β”œβ”€β”€ runtime/        ← State, indexes, traces, insights
         β”œβ”€β”€ generated/      ← Command catalog, launchers
         └── templates/      ← Workflow templates

Visible bridges where AI agents need discovery. Hidden canonical layer where runtime content stays authoritative.

</details>

❓ FAQ

<details> <summary><strong>Do I need to install anything globally?</strong></summary>

No. npx @harness-forge/cli runs directly. For the shorter hforge command, run hforge shell setup --yes once.

</details> <details> <summary><strong>Does it change my source code?</strong></summary>

Never. Harness Forge only creates its own files (AGENTS.md, .agents/, .hforge/, .codex/, .claude/). Your application code is untouched.

</details> <details> <summary><strong>Can I use it in CI/CD?</strong></summary>

Yes. Add --yes for non-interactive and --json for machine-readable output:

hforge init --root . --agent codex --setup-profile recommended --yes
hforge doctor --root . --json
</details> <details> <summary><strong>How do I remove it?</strong></summary>

Delete: .hforge/, .agents/, .codex/, .claude/, AGENTS.md. Your project is back to normal.

</details> <details> <summary><strong>Does it send data anywhere?</strong></summary>

No. Everything stays local under .hforge/. Nothing is ever sent to the internet. Inspect, delete, or back up anytime.

</details> <details> <summary><strong>What Node.js version?</strong></summary>

Node.js 22 or newer. Check with node --version.

</details>

πŸ“ˆ Project Activity

<p align="center"> <a href="https://star-history.com/#ldilov/harness-forge&Date"> <img src="https://api.star-history.com/svg?repos=ldilov/harness-forge&type=Date" alt="Star History Chart" width="700" /> </a> </p>

🀝 Contributing

See CONTRIBUTING.md for development setup and guidelines.

πŸ™Œ Acknowledgements

Harness Forge was inspired by github/spec-kit. Credit to the GitHub team for shaping cleaner workflow models.

πŸ“„ License

GPL-3.0 β€” see LICENSE.


<p align="center"> <strong>Your AI agent deserves a better harness.</strong> <br /> <code>npx @harness-forge/cli</code> </p>