@codewithjuber/forgekit
v2.5.0
Published
Shared memory, impact analysis, and guardrail hooks for AI coding agents — authored once, emitted as native config for Claude Code, Codex, Cursor, Gemini, Aider, and more.
Maintainers
Readme
ForgeKit — shared memory and verification for AI coding agents
ForgeKit is an open-source Node.js CLI for developers working with Claude Code, Codex, Cursor and other coding agents. It keeps project knowledge in Git, shows which files an edit might affect and runs your repository’s tests to check the result.
Project website · Documentation · Host compatibility · Contribute · Get help
60-second quickstart
Install the CLI with Node.js 22 or newer, npm and Git on your path. The demo creates its own temporary Git repository and uses a real test. It works without a model account or API key.
npm install -g @codewithjuber/forgekit
forge demoLook for these three lines in the output:
green tree: PASS
broken tree: FAIL
fixed tree: PASSThe middle run changes addition to subtraction. The failing test catches it, and the last run confirms the repair.
To use ForgeKit in your own Git repository, run these commands from its root:
forge init --no-settings
git status --short
forge verifyinit generates instructions for the detected tools. The flag skips the user-wide Claude settings merge. Review the files Git lists. verify runs the suites it detects and reports NOT_CONFIGURED if the project has no test runner.
| What would you like to do next? | Start here | | --- | --- | | Choose a host or install its plugin | Host setup and coverage | | Try an impact check and save a project fact | Hands-on onboarding | | Follow a change from the first check through verification | Coding workflow | | Fix a bug or improve these docs | Contributor guide |
What it catches
- A failing test.
forge verifyruns the suites it detects and binds the result to the code it checked. The demo above shows the result of changing one line. - An overlooked caller.
forge impactaccepts a path or symbol and reports likely dependents. The prediction can miss files, so use the results alongside your tests. - A credential in a staged change.
forge precommitchecks the staged diff for recognizable credential patterns. The recording shows a synthetic example. - An unrecognized dependency.
forge vetchecks a package against its registry and available advisory data. The dependency hook can deny a confirmed missing or malicious package, or request review when a registry miss is inconclusive.
- An MCP server that changes its tools.
forge sources probereturns a digest of a server’s tool list. After you pin that digest in the source configuration, a later mismatch fails the probe. - An agent editing the same file in circles. After the 4th edit of one file the hooks tell
the model to re-read the error and the task and change approach; after each edit they return
the file's lint and type errors.
forge steer "<text>"redirects a running agent from another terminal. - The bug the agent fixed last month and brought back.
forge rememberand the ledger keep lessons in the repository, with references to their evidence, and teammates get them by pulling. - A team of agents that costs more than it is worth.
forge team laddergrades a team against independent agents spending the same tokens. It has to beat one agent, then a majority vote, then best-of-n. Team plans give each agent different facts to forward to the lead, because a team of agents that know the same things is not smarter. - The same failure, again, next week.
forge guidesturns a failure into a scoped rule. A round admits a candidate playbook only when GUARD's gate (Google Cloud, arXiv 2611.23476) shows its gain on a buffer of tasks outweighs its regressions. Mastered rules are pinned so automation cannot rewrite them, and admitted rules reachAGENTS.mdonforge sync.forge harness statsadds trip wires that fire when cost, tokens, tool calls, repairs, denials, JSON repairs or failures drift from their baseline. - A trend brief built on a viral rumor.
forge research recent "<topic>"counts only dated reports and collapses copies of one origin into a single provenance chain. Support is noisy-OR corroboration over independent chains, with reliability earned from recorded outcomes, and popularity is never counted as evidence. Contested, superseded and unverified stories are labelled as such. - An agent that grades its own app and always passes.
forge sprintruns a three-agent harness. A planner writes the spec, a generator builds one sprint against a contract the evaluator agreed, and the evaluator tests the running app. The gate refuses a grade from anyone but the evaluator, or for code that changed since the hand-off. Any score under the bar fails the sprint, and time and spend are tracked against a budget. - Build and test logs that fill the context window.
forge squeeze -- <command>keeps every error, failing test and summary, and folds the progress bars, repeats and passing tests. On its fixtures that saves 81–99% of tokens, and the command's exit status passes through. - A scrape that can't say where a claim came from.
forge crawl <url> --goal "<terms>"obeys robots.txt and Crawl-delay, and fetches the links that best match the goal first. It keeps each page's main content by text density and stamps every page with its final URL and the SHA-256 of the bytes. Instruction-like text is flagged, and a public crawl never touches a private address. - An agent config nobody reviewed.
forge scan --configaudits the settings your agents already run with: aBash(*)allow, bypass mode, a hook that pipes a download into a shell, an unpinnednpx -yMCP server, a literal token inenv. Each finding points at the exact entry and names the fix, and it exits 2 when one is critical. - "What did the agents actually do this month?"
forge recapcounts it from the records on disk: spend and sessions, commits, verify verdicts, harness runs and trip wires, sprint grades, lessons and earned guides. Each number is set against the month before, or shown asn/awhen there is no record, never a guess. - A prompt cache that quietly stops working.
forge cachereads Claude Code's logs and reports the cache hit ratio and what it saved. It shows every turn that re-wrote the cache, with the cause: compaction, model switch, TTL expiry, or a changed prefix.forge cache prefixchecks that the instruction files sync writes keep a byte-stable prefix. - Skills that cost tokens on every turn.
forge skill-auditmeasures what each skill costs to carry: its description on every turn, its body on each trigger. It names the sections an oversized body should move toreferences/, and the paragraphs repeated across skills. It also flags descriptions too vague to route on, each with an estimated saving. - The same memory paid for every session, relevant or not.
forge memoryputs a decision in each memory layer: what enters the context window, which past session is replayed, whether a fact is worth storing, which repeated verified work becomes a skill, and what is archived. Each is asked of Jev (TypeSafe System One) with a probability; without a key the existing rule decides, unchanged.forge memory admit "<task>"measures full memory against what was admitted.
The CLI checks work from a terminal. Automatic checks depend on the host, the installed hooks and the events the host forwards. The integration matrix records which paths were tested with a real client.
See it in action

A missing module breaks the project's npm test. forge verify runs that test and reports a failed verdict.

forge precommit checks the staged diff and refuses the synthetic credential.

forge recall add saves a fact. A separate invocation of forge recall list retrieves it.
Start here: eight commands
These are what forge --help shows first. The other commands are still there:
forge --help --all lists every one, and the full table is below.
| Command | What it does |
| ----------------- | ----------------------------------------------------------------- |
| forge init | set up ForgeKit for the coding agents this repo uses |
| forge doctor | check that hooks, providers and MCP wiring work (--fix repairs) |
| forge sync | rewrite every agent's config after you edit the shared rules |
| forge remember | save a fact for every agent (run sync to deliver it) |
| forge impact | list the files an edit to a symbol will probably touch |
| forge verify | run the repo's test suites and report what passed verification |
| forge precommit | stop a commit that leaks a secret or changes code without docs |
| forge vet | check a package is real and not known malicious before installing |
Slash commands in Claude Code
Every command is also a slash command. Add the marketplace with
/plugin marketplace add CodeWithJuber/forgekit, then /plugin install forge@forge.
/forge:impact src/x.js runs forge impact src/x.js and reports the output; /forge:help
lists them all. They run only when you type them, and need forge on your PATH.
Works with
forge sync writes one shared AGENTS.md. Four hosts also get a rules file of their own. Every
other host reads the shared AGENTS.md, and ForgeKit only warns when something would hide it or
the file is too long. The "Project rules" column says which case each host is.
| Tool | Project rules | MCP server entry | Automatic hooks |
|---|---|---|---|
| Claude Code | Own file: CLAUDE.md importing AGENTS.md | ✅ | Plugin or project hooks |
| Local Codex | Shared AGENTS.md; warns past 32 KiB | ✅ | Trusted plugin or project hooks |
| Cursor | Shared AGENTS.md; warns about a legacy .cursorrules | ✅ | Project hooks |
| Gemini CLI | Own file: .gemini/settings.json points to AGENTS.md | ✅ | Project hooks |
| Copilot | Shared AGENTS.md | ✅ | Project hooks |
| Zed | Shared AGENTS.md; warns about files that shadow it | ✅ | — |
| Continue | Own file: .continue/rules/00-forge.md | ✅ | — |
| Windsurf / Devin | Shared AGENTS.md; warns past about 12k characters | — | Devin can use trusted Claude project hooks |
| Kimi Code | Shared AGENTS.md | Project MCP | Native user plugin |
| OpenCode | Shared AGENTS.md | Project MCP | Generated JavaScript plugin |
| Aider | Own file: .aider.conf.yml reads AGENTS.md | — | — |
| OpenClaw | Shared AGENTS.md | Operator registration or bundle | — |
| Hermes Agent | Shared AGENTS.md; warns about files that shadow it | Profile registration (hermes mcp add) | — |
| Pi | Shared AGENTS.md; warns about files that shadow it | Project MCP (after project trust) | — |
| Roo Code, VS Code | — | ✅ | — |
The host integration matrix distinguishes generated files, adapter tests and recorded native-client runs. The host setup guide walks through choosing tools for a project.
How it works
Run forge substrate to check a task before editing. It can ask for missing information or return a plan with likely affected files. After the edit, tests, CI results and human review can supply evidence for the project ledger.
Explore the interactive coding workflow
Hosts that load the project instructions receive a short working method in AGENTS.md: check the goal and the means, act
on evidence, change one thing at a time, prove the result, fix without breaking anyone. Longer
protocols for debugging, research, building and security fixes ship as skills, and the prompt
hook names the right one for the task. The working method
For a task that needs approval gates, spending limits and a signed verification result, use the supervised harness.
Measured, with limits
Each number below names the place it comes from. They do not all come from one command.
- Timings and impact quality come from
npm run bench, recorded with the machine in reports/benchmarks.md. The run quoted here is from 2026-11-30 on a 16-core AMD EPYC 7282 that was shared, with a 1-to-15-minute load average of 2.8 to 7.6, so the timings are slower than a quiet machine would give. Re-runnpm run benchon your own hardware.- A full pre-action gate in 2815 ms (row
substrate / substrateCheck, median of 3, warm graph, no model call, one repository). - Blast radius in 7.36 ms (row
atlas / impact("claimText") (warm adjacency), median of 30, with the graph index already built). - Impact quality: precision 0.12, recall 1.00 on six hand-labelled cases (table
Impact-oracle quality). Read this as a conservative blast-radius list that rarely misses a direct user of a symbol but names many files that do not need a change. It is not a precise predictor. Looking only at the edited file reaches recall 0.24.
- A full pre-action gate in 2815 ms (row
- 20.2% more cost than always-premium and the refuted 62.1% saving come from the pre-registered study in research/empirical-refutation/. The white paper's 62.1% routing saving did not hold on 80 held-out tasks.
- 40% of the test files that broke comes from
bench/impact_mutation.mjs(12 functions made to throw, the whole suite run each time), reported in docs/EVIDENCE.md. - 81-99% fewer tokens from
forge squeezecomes from its test fixtures, listed in the guide, not fromnpm run bench.
Refutations, boundaries and the research prototypes are in docs/EVIDENCE.md.
Honest limits
- Beta. Releases follow Semantic Versioning, and support is best effort with no SLA. What is stable today, the deprecation policy and the criteria for dropping the label are in docs/STABILITY.md.
- Impact is heuristic. A regex-derived code graph, not a sound call graph: it can miss
files and it over-warns a lot (precision about 0.12 at recall 1.00 on six labelled cases, see
above). On this repository it named 40% of the test files that broke when a
function broke;
forge impact --recordadds the tests that actually run the code, which named all of them, but only for code some test runs. - Guardrails are defence in depth, not a sandbox. Commands are normalized the way the shell reads them (quotes, variables, substitutions, inline programs) before they are judged. It is static analysis: a program the guard cannot evaluate can still get past it.
- Memory is external state. Facts live in files and are retrieved into context; no model is
retrained. A policy a program can test can instead be compiled into a commit check
(
forge know --enforce), which holds whether or not a model read it. - Thresholds are hand-set. The values that decide when to ask, when to run the full suite
and which model tier to use are not calibrated on data. They live in one registry with their
provenance;
forge doctor --paramslists them and how many are uncalibrated, and the guide shows how to change one.
The full list is in docs/OVERVIEW.md.
Teams
The ledger merges over plain git: forge ledger sync keeps it under refs/forge/ledger, and two
teammates' copies converge whoever syncs first. forge cloud and forge relay sync encrypted
workspace evidence through a receiver you run, which stores only ciphertext.
Team memory
All commands
| Group | Command | Does |
| ----------------------- | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Core | forge init | scaffold this repo's config — emits the tools it uses (detected hosts, or --tools) from one shared source |
| | forge sync | recompile the canonical source into each tool's native config files |
| | forge doctor | health-check installed tools, guards, MCP auth, and config drift |
| | forge tools | primary-tool config — gitignore secondary-tool artifacts (.cursor/.gemini/…) for tools this repo doesn't use (forge tools <name> sets it, --reset clears) |
| | forge catalog | Start Here — list every tool, crew, and guard with a one-line why |
| | forge docs | docs↔code drift — check (registry reconcile) / render (regenerate machine-owned tables + diagrams) / sync (diff-driven stale-docs sweep) / impact (reusable doc-reference graph: which docs mention what THIS diff changed) |
| | forge update | self-update — --check reports if a newer version is available, bare applies it, --to <version> pins/downgrades |
| | forge config | provider setup — show / switch / add providers, set default model |
| | forge dash | open a local project dashboard to inspect runs, check agent setup and review project memory |
| | forge report | emit a static, self-contained HTML snapshot of .forge/ — opens offline, no server, no script |
| | forge recap | a month of agent work counted from records on disk — spend, sessions, commits, verify verdicts, harness runs and trip wires, sprint grades, lessons, ledger claims, guides — each vs the window before (n/a when that window has no record); empty sources left out and listed; writes nothing but --out |
| Substrate | forge substrate | one pre-action gate: assumptions, route, impact, scope, memory, verify |
| | forge preflight | assumption check — what a task names that the repo doesn't define |
| | forge evidence | find existing code, cached source excerpts and public research candidates before editing or debugging |
| | forge team | plan independent read-only agents for complex work and optionally run them with a shared budget |
| | forge develop | assemble a development plan, search prior solutions, assess security and select verification for the current change |
| | forge sources | sync scoped project sources privately and search, route live reads or aggregate local tables |
| | forge impact | hazard-aware blast radius — SCC-aware propagation + data-driven threshold from PageRank centrality and ledger incident history |
| | forge scope | decompose files into independent clusters (+ coupled files you didn't name) |
| | forge context | budgeted context assembly + completeness gate — what an edit NEEDS known, delivered or owed |
| | forge route | recommend the cheapest capable model for a task (+ gateway config); route universal: any provider's models, lowest expected cost for the success asked for, learned from outcomes |
| | forge orchestration | agent-orchestration rule pack (no polling, parallel cap, CI for heavy checks, fresh sub-agents, model routing, risk review, isolated envs, lean lead), the working-method pack (goal and means, evidence first, isolate, proof of done, fix without breaking) and the unattended routing policy — list, switch rules on/off, set routing mode/gates, per repo or --global |
| | forge harness | run host-neutral supervised tasks with policy, budgets, verification and replayable evidence |
| | forge steer | redirect a running agent from another terminal — the next tool call it makes in this project receives your message, once |
| | forge sprint | three-agent app harness — a planner writes the spec, a generator builds one sprint against a contract the evaluator agreed, the evaluator grades the running app against hard thresholds; the gate refuses self-grading and tracks time and spend against a budget; persona lists, shows and checks the fictional users the evaluator can play |
| | forge guides | earned guides — a failure proposes a scoped rule; a GUARD round admits the best candidate only when its gain on the gated buffer outweighs its regressions; mastered rules are pinned and only ratchet forward; admitted rules reach AGENTS.md on forge sync |
| | forge research | what happened on a topic recently, weighed by evidence: dated reports only, copies collapsed into independent provenance chains, support by noisy-OR corroboration, reliability earned from recorded outcomes, popularity never counted as evidence, contested and superseded stories shown as such |
| | forge crawl | polite best-first crawler — robots.txt groups and longest-match rules, per-host Crawl-delay, a BM25 frontier toward --goal, main content by text density as Markdown, SimHash near-duplicates, and per-page provenance (status, final URL, SHA-256 of the bytes); a public crawl never requests a private or loopback address; page text is labelled untrusted and instruction-like spans are flagged |
| | forge squeeze | compress a command's output for an agent — a filter per command (git, gh, cargo, jest/vitest, pytest, go, tsc, eslint, ruff/mypy, docker, kubectl, terraform, package installs, ls/find/grep, curl, psql, aws …) before the generic rules (ANSI and progress stripped, repeats folded, errors and failing tests kept, JSON pruned); kept only when it cuts 20%, never longer than the raw output, the full output recallable (secrets redacted), savings logged; the exit status passes through |
| | forge advisor | Claude Code's advisor tool — a stronger second model consulted at decision points: set the advisor per repo (emitted into .claude/settings.json by sync, with an Advisor rule section in AGENTS.md) or --global, check a main/advisor pairing before Claude Code refuses it, list accepted pairings, or make one live API call with the pair (test) |
| | forge verify | independent verification gate — tests + hallucinated-symbol + provenance (--deep: multi-lens consensus) |
| | forge demo | scripted scenario — a throwaway repo goes green → broken → green while forge verify watches (the README hero, runnable) |
| | forge precommit | commit-level gate — staged code w/o docs + secret scan (FORGE_COMMIT_GATE=block|warn|0) |
| | forge test-select | smart test selection — the tier contract as a command: which tests this change owes (selection only, never runs them) |
| | forge ship | from a working tree to a green pull request: gate, commit, push, open the PR, review it, watch CI and fix failures — resumable |
| | forge imagine | consequence simulation — predicted breaks and the smallest test suite for a task, optionally run in an isolated checkout |
| | forge lean | scope-minimality check — measure the working diff's footprint against what the task asked for |
| | forge anchor | goal-drift check — are your actual (git) changes still on the stated goal? set/show/clear keep the goal across sessions |
| | forge diagnose | doom-loop check — record a failure; the same signature three times mints a diagnosis and an escalation |
| | forge collide | parallel-session conflict radar — who else recently touched the files (or their import neighbors) you are editing
