New:Microsoft Teams Notifications Are Now Available in Socket.Learn more โ†’
Get Started

@harness-forge/cli

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@harness-forge/cli

Harness Forge: modular agentic AI workspace installer, catalog, and workflow runtime.

Source
npmnpm
Version
1.4.1
Version published
Weekly downloads
50
42.86%
Maintainers
1
Weekly downloads
ย 
Created
Source

version

๐Ÿ”จ Harness Forge

Make AI coding agents actually useful in your repository.
One command to set up Codex, Claude Code, or both โ€” with the right context, skills, and workflows for your codebase.

Build npm downloads downloads 18m

stars forks issues license node

๐Ÿš€ Get Started โ€ข โœจ What It Does โ€ข โŒจ๏ธ Commands โ€ข ๐Ÿ’ก Scenarios โ€ข ๐Ÿ”„ Updating โ€ข ๐ŸŽฏ Targets โ€ข โ“ FAQ

๐Ÿ“ˆ Project Activity

Star History Chart

๐Ÿ’ก What is Harness Forge?

Harness Forge turns any repository into a well-equipped workspace for AI coding agents like Codex and Claude Code.

Think of it as a setup tool that:

  • ๐Ÿ” Scans your repo and figures out what languages, frameworks, and tools you use
  • ๐Ÿง  Recommends the right configuration for your AI agent
  • ๐Ÿ“ฆ Installs skills, knowledge packs, and workflows that make the agent more effective
  • ๐Ÿ”ง Maintains everything organized and easy to update
Without Harness ForgeWith Harness Forge
๐Ÿง  ContextAgent guesses at project structureAgent knows your languages, frameworks, boundaries
๐Ÿ”ง SkillsGeneric, one-size-fits-allTailored to your stack and workflow
๐Ÿ“‹ WorkflowAd hoc, inconsistentStructured, repeatable, validated
๐Ÿ”„ ContinuityStarts from scratch each sessionPersistent runtime state across sessions
๐ŸŽฏ TargetingSame behavior for all toolsCodex, Claude Code, Cursor tuned separately

4 targets 14 languages 12 frameworks 45+ skills 50+ commands

๐Ÿš€ Get Started in 60 Seconds

Install and set up your repo

npx @harness-forge/cli

That's it. The CLI walks you through:

  • Which AI targets to set up (Codex, Claude Code, or both)
  • How deep to go (quick, recommended, or advanced)
  • Which optional features to include
  • A preview of exactly what files will be created

Tip: Already know what you want? Use the one-liner:

npx @harness-forge/cli init --root . --agent codex --setup-profile recommended --yes

Make hforge available everywhere

npx @harness-forge/cli shell setup --yes

Now you can use hforge directly instead of npx @harness-forge/cli.

Check that everything is healthy

hforge doctor --root . --json

โœจ What Does It Do?

๐Ÿ” It understands your repo

hforge recommend . --json        # What setup makes sense for this repo?
hforge cartograph . --json       # Map the repo structure
hforge scan . --json             # Detect languages, frameworks, tools

Harness Forge scans your codebase and recommends the right targets, profiles, and skill packs โ€” with evidence for each recommendation.

๐Ÿงฉ It equips your AI agent

After setup, your repo contains:

What gets createdWhat it does
AGENTS.mdEntry point that tells the AI agent how your workspace is organized
.agents/skills/Skills the agent can discover and use (code review, testing, debugging, etc.)
.hforge/Hidden runtime with knowledge packs, rules, templates, and workspace state
.codex/ or .claude/Target-specific configuration for your chosen AI agent

๐Ÿ›ก๏ธ It keeps things healthy over time

hforge status --root . --json     # What is installed?
hforge refresh --root . --json    # Regenerate runtime after changes
hforge review --root . --json     # Health check and readiness review
hforge next --root .              # What should I do next in this workspace?

โŒจ๏ธ Everyday Commands

๐Ÿ“ฅ Setup

What you want to doCommand
Set up a new repo (guided)npx @harness-forge/cli
Set up a new repo (one-liner)hforge init --root . --agent codex --setup-profile recommended --yes
Auto-detect and bootstraphforge bootstrap --root . --yes
Preview without writing fileshforge init --root . --agent codex --dry-run
Enable hforge on your PATHhforge shell setup --yes

๐Ÿ”„ Daily use

What you want to doCommand
What should I do next?hforge next --root .
Check workspace healthhforge doctor --root . --json
Refresh the runtimehforge refresh --root . --json
Review install statehforge status --root . --json
Check flow statushforge flow status --root . --json
Inspect target detailshforge target inspect codex --root .
Compare Codex vs Claude Codehforge target compare codex claude-code

๐Ÿ”ง Maintenance

What you want to doCommand
Update Harness Forge in placehforge update --root . --yes
Export runtime for handoffhforge export --root . --json
Audit install integrityhforge audit --root . --json
Check what driftedhforge diff-install --root . --json
Validate locally before pushnpm run validate:local
Validate for releasenpm run validate:release
Dry-run a releasenpm run release:dry-run

๐Ÿ’ก Real-World Scenarios

๐Ÿ“‚ Scenario 1: "I just cloned a repo and want AI help"

cd my-project
npx @harness-forge/cli
# Follow the guided setup
# Your AI agent now has full context about this repo

๐Ÿค Scenario 2: "I use both Codex and Claude Code"

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

Both agents share the same hidden runtime (.hforge/) but get their own configuration bridges. Run hforge target compare codex claude-code to see the differences.

๐Ÿ”™ Scenario 3: "I come back to a repo after a while"

hforge next --root .
# Harness Forge tells you the most useful action right now
# Usually: refresh the runtime, run a health check, or review stale artifacts

๐Ÿ‘ฅ Scenario 4: "I want to standardize AI setup across my team's repos"

# Same command in every repo, same result
hforge init --root . --agent codex --setup-profile recommended --yes
hforge doctor --root . --json   # Verify it's healthy
hforge export --root . --json   # Share the runtime state

๐Ÿงฌ Scenario 5: "A task is really hard and needs structured recursive analysis"

Use structured recursive analysis to break down complex investigations:

hforge recursive plan "investigate the billing retry flow" --task-id TASK-001 --json
hforge recursive capabilities --root . --json

For a full walkthrough, see ./docs/recursive-rlm-guide.md.

Or let your AI agent decide when to escalate:

/hforge-recursive-investigate investigate the billing retry flow across API and worker boundaries

๐Ÿ”„ Updating

Update Harness Forge to the latest version

hforge update --root . --yes

This downloads the latest published version and refreshes all managed surfaces while keeping your workspace state (task artifacts, decision records, recursive sessions, and observability data).

Preview what an update would change

hforge update --root . --dry-run --yes

Update globally

npm install -g @harness-forge/cli@latest

๐ŸŽฏ Supported Targets

TargetSupport LevelBest for
CodexFullDefault choice โ€” full install, maintenance, and runtime support
Claude CodeFullWhen you need native hooks and plugin support
CursorPartialDocs and manifests work; runtime features are limited
OpenCodePartialDocs and manifests work; runtime features are limited

โš–๏ธ Codex vs Claude Code

Both are first-class targets. The main difference is hook support:

CodexClaude Code
Runtimeโœ… Fullโœ… Full
Maintenanceโœ… Fullโœ… Full
Hooks๐Ÿ“„ Documentation-drivenโœ… Native
Plugins๐Ÿ“„ Manual wiringโœ… Native
Shared .hforge/โœ… Yesโœ… Yes

Use both together when your team works with multiple tools. They share the same .hforge/ runtime.

hforge target compare codex claude-code        # See all differences
hforge target compare codex claude-code --json  # Machine-readable comparison

๐Ÿ“ฆ What's Included

๐ŸŒ Language packs (14 languages)

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

๐Ÿ—๏ธ Framework packs (12 frameworks)

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

๐Ÿ› ๏ธ Skills (45+ packaged skills)

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.

โš™๏ธ How It Works

Your Repo
  |
  |-- npx @harness-forge/cli
  |
  |-- Scans repo (languages, frameworks, targets)
  |-- Recommends setup (targets, profile, packs)
  |-- Installs runtime
  |       |
  |       |-- AGENTS.md              (visible to AI agents)
  |       |-- .agents/skills/        (discoverable skills)
  |       |-- .codex/ or .claude/    (target config)
  |       |-- .hforge/               (hidden canonical runtime)
  |              |-- library/        (skills, rules, knowledge)
  |              |-- runtime/        (state, indexes, findings)
  |              |-- generated/      (command catalog, launchers)
  |              |-- templates/      (workflow templates)
  |
  |-- hforge next                    (what to do now?)
  |-- hforge doctor                  (is everything healthy?)
  |-- hforge refresh                 (regenerate after changes)

The key idea: visible bridges where AI agents need discovery, hidden canonical layer where runtime content should stay authoritative.

๐Ÿงช Advanced Features

๐Ÿงญ hforge next โ€” Your daily starting point

Instead of wondering which command to run, just ask:

hforge next --root .

It checks your workspace state and recommends the single most useful action โ€” with a reason and confidence level.

hforge next --root . --json              # Machine-readable output
hforge next --root . --apply-safe-fixes  # Auto-run if the action is safe
hforge next --root . --verbose           # Show full reasoning

๐Ÿงฌ Recursive runtime โ€” For hard problems

When a task is complex enough to need structured investigation:

hforge recursive plan "investigate billing retry behavior" --task-id TASK-001 --json
hforge recursive execute RS-123 --file bundle.json --json
hforge recursive score RS-123 --json

This creates a durable session with working memory, checkpoints, typed action bundles, and replay capability.

๐Ÿ”ฌ Repo intelligence

hforge recommend . --json                  # Evidence-backed setup recommendations
hforge cartograph . --json                 # Map repo structure and boundaries
hforge classify-boundaries . --json        # Identify service boundaries
hforge synthesize-instructions . --target codex --json  # Generate target-specific guidance

โ“ FAQ

Do I need to install anything globally? No. npx @harness-forge/cli works without any global install. Run hforge shell setup --yes if you want the shorter hforge command.

Does it modify my source code? No. Harness Forge only creates its own managed files (AGENTS.md, .agents/, .hforge/, .codex/, .claude/). Your application code is never touched.

Can I use it in CI? Yes. Use --yes and --json flags for non-interactive, machine-readable output:

hforge init --root . --agent codex --setup-profile recommended --yes
hforge doctor --root . --json

How do I remove it from a repo? Delete the managed directories: .hforge/, .agents/, .codex/, .claude/, AGENTS.md.

Does it send telemetry? No. All observability data stays local under .hforge/observability/. Nothing is sent anywhere.

What Node.js version do I need? Node.js 22 or newer.

๐Ÿค 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.

Make your AI agents better at their job.
npx @harness-forge/cli

FAQs

Package last updated on 04 Apr 2026

Related posts