KnowledgeForge · Open Source
The model picks the wrong kind of thinking for the problem in front of it — brainstorming when it should be debugging, hedging when it should be deciding, inventing structure when it should be following one — and the whole chain degrades from there.
Swap GPT-5 for Opus 4.7 and the same problem shows up wearing different syntax.
KnowledgeForge is the layer that fixes that.
A reasoning harness for AI coding assistants. It classifies each request by decision type and routes it to a mode built to prevent that type’s typical failure.
KnowledgeForge started in 2023 as a stack of instruction files. By late 2025 it had 43 modules. A Pareto pass cut it to nine — the other 34 existed because of coverage anxiety, not measurable results. What survived: nine modes, each one addressing a real, recurring failure. Nothing in the list exists for completeness.
Runs on Claude Code, Claude Projects, ChatGPT, and Codex CLI.
After the same failure mode appears three consecutive times, KnowledgeForge pauses instead of looping.
Every failed attempt is logged and stays in context. The next diagnosis must differ from everything already eliminated. The model cannot re-enter a hypothesis it has already ruled out.
Looping on the same error is the most expensive failure mode in agentic work. It compounds across sessions, burns context, and produces no new information. The circuit breaker kills the loop, forces a different angle, and surfaces the pattern so you can see it.
KF patches the model's weaknesses. It doesn't scaffold its strengths.
Deterministic first. Before invoking LLM judgment, exhaust deterministic checks. Before fixing, reproduce. Before acting, triage.
Most agent frameworks try to make the LLM do more. KF makes it do less, better. Every module exists because something specific was failing in production — hypothesis-skipping, hidden trade-offs, hallucinated groundings, runaway scope, stale knowledge surfacing as fact.
KF is a stack of modules — each one a targeted patch for a known failure mode in LLM reasoning. Six worth describing:
Every request gets sorted into one of four types — Reckoning (verifiable answer, give it directly), Evaluative (judgment against existing criteria), Predictive (future state), or Novel (no precedent, requires reasoning expansion). The classifier is the gate that decides whether the LLM should think hard or shut up and answer.
Six runtime checks that watch the agent watch itself — stuck detection, hypothesis fixation, scope drift, premature closure. When a check trips, the monitor injects an intervention rather than letting the run rot quietly.
Every claim the model makes carries a grounding score. Low-grounding claims get flagged before they propagate. Accretion to long-term memory is gated on grounding — bad reasoning doesn't get to become institutional knowledge.
Eight hard limits on what an agent can do per mode — token spend, tool calls, scope expansion, autonomy level. Two-layer safety so a single jailbroken prompt doesn't blow up a deployment.
Facts decay. KF tracks the staleness window for every piece of stored knowledge and refuses to surface it as current when it's past its half-life. Importance-weighted — high-stakes facts expire faster than low-stakes ones.
Three-tier risk classification with mode-specific capability profiles. The Critic mode can read anything but can't write. The Builder can write but can't ship. The Debugger can run scripts in sandbox but not in prod. Permissions are structural, not vibes.
26 underlying modules (M00–M25) implement those nine modes plus cross-cutting infrastructure: memory architecture, decision classification, knowledge accretion, and grounding scores.
Nine modes. The orchestrator routes automatically based on what the request needs:
The orchestrator routes between them based on what the request actually needs — most don't need any mode at all, which is part of the point.
NOW OPEN SOURCE
KnowledgeForge is publicly available on GitHub. Explore the modules, install it in your preferred AI coding environment, open an issue, or contribute a better reasoning pattern.
The full story of how 43 modules became nine: Private Tools Don’t Export →
Explore KnowledgeForge on GitHub →