# SF
**The evolution of [Singularity Forge](https://github.com/sf-build/get-shit-done) — now a standalone autonomous repo operator.**
[](https://www.npmjs.com/package/singularity-forge)
[](https://www.npmjs.com/package/singularity-forge)
[](https://github.com/sf-build/SF)
[](https://discord.com/invite/nKXTsAcmbT)
[](LICENSE)
[](https://dexscreener.com/solana/dwudwjvan7bzkw9zwlbyv6kspdlvhwzrqy6ebk8xzxkv)
The original SF went viral as a prompt framework for Claude Code. It worked, but it was fighting the tool — injecting prompts through slash commands, hoping the LLM would follow instructions, with no actual control over context windows, sessions, or execution.
This version is different. SF is now a standalone CLI built on the [Pi SDK](https://github.com/badlogic/pi-mono), which gives it direct TypeScript access to the agent harness itself. That means SF can actually _do_ what v1 could only _ask_ the LLM to do: clear context between tasks, inject exactly the right files at dispatch time, manage git branches, track cost and tokens, detect stuck loops, recover from crashes, and auto-advance through an entire milestone without human intervention.
Forge is the product. The Unified Operation Kernel (UOK) is the internal runtime kernel. Core behavior is governed by purpose-driven TDD and the eight PDD fields: purpose, consumer, contract, failure boundary, evidence, non-goals, invariants, and assumptions.
We sharpen Forge against the best external ideas we can find — Claude Code and Codex for ergonomics, Aider and gsd-2 for execution, Plandex for workflow structure — but those are reference inputs, not the destination. Forge stays focused on autonomous single-repo execution. ACE Coder is the separate multi-repo and large-scale path.
One command. Walk away. Come back to a built project with clean git history.
npm install -g singularity-forge@latest
> SF now provisions a managed [RTK](https://github.com/rtk-ai/rtk) binary on supported macOS, Linux, and Windows installs to compress shell-command output in `bash`, `async_bash`, `bg_shell`, and verification flows. SF forces `RTK_TELEMETRY_DISABLED=1` for all managed invocations. Set `SF_RTK_DISABLED=1` to disable the integration.
> **Node runtime:** SF targets Node.js 26.1+. Use the repo `.mise.toml`, `.node-version`, or `.nvmrc` pins when developing from source.
---
## What's New in v2.71
### External Tooling
- **External MCP tool configs** — SF can connect to project-local MCP tool servers for third-party services and local integrations.
- **Stream ordering preserved** — external tool output now renders in the correct order, including MCP tool calls surfaced by model/runtime adapters.
- **Multi-round discuss questions** — new-project discuss phase supports multi-round questioning with structured question gates.
### Model Selection Hardening
- **Unconfigured models blocked** — models without a configured provider are filtered from selection surfaces, preventing dispatch failures.
- **Provider readiness required** — saved default model selection now verifies the provider is ready before accepting it.
- **Session override honored** — `/sf model` selection persists as a session override across all dispatch phases.
- **Minimal context guard** — model override logic is skipped in minimal command contexts where it doesn't apply.
### Auto-Mode Resilience
- **Credential cooldown recovery** — autonomous mode survives transient 429 rate-limit responses with structured cooldown errors and a bounded retry budget.
- **Fire-and-forget autonomous start** — autonomous startup is detached from active turns to prevent blocking.
- **Scoped forensics** — stuck-loop forensics are now scoped to auto sessions only, preventing false positives in interactive use.
### TUI Improvements
- **Overlay subscription fix** — resolved overlay subscription lifecycle and `Ctrl+Shift+P` shortcut conflict.
- **Improved overlays and shortcuts** — SF overlays, keyboard shortcuts, and notification flows redesigned for consistency.
- **Pinned output restored** — pinned output bar displays above the editor during tool execution again.
- **Turn completion cleanup** — pinned latest output is cleared on turn completion, preventing stale output from persisting.
- **Secure input masking** — extension input values are masked in interactive mode when collecting secrets.
### Provider Fixes
- **Full OAuth login URLs** — OAuth login URLs are now displayed in full instead of being truncated.
- **MiniMax bearer auth** — MiniMax Anthropic API requests use proper bearer authentication.
- **Case-insensitive tool rendering** — renderable tool matching is now case-insensitive, fixing missed tool output.
- **Machine-surface idle timeout** — idle timeout is kept off during interactive tool execution in `sf headless`.
### Reliability & Internals
- **TOCTOU file locking** — race conditions in event log and custom workflow graph file locking are fixed with proper atomic lock acquisition.
- **State derive refactor** — `deriveStateFromDb` god function extracted into composable, testable helpers.
- **Windows portability** — hardened cross-platform portability across runtime, tooling, and CI.
- **Model routing transparency** — dynamic routing is skipped for interactive dispatches; model changes are always shown in the banner.
- **Capability-aware routing (ADR-004)** — full implementation of capability scoring, `before_model_select` hook, and task metadata extraction.
- **Multi-model provider strategy (ADR-005)** — infrastructure for multi-provider model selection wired into live paths.
- **Anti-fabrication guardrails** — discuss prompts enforce turn-taking to prevent fabricated user responses.
- **Milestone worktree cleanup** — merged worktree cleanup uses the milestone branch instead of generic lookups.
- **Tool cache control** — `cache_control` breakpoints added to tool definitions for improved prompt caching.
See the full [Changelog](./CHANGELOG.md) for details on every release.