Skip to content
Open-source developer tooling for AI-assisted engineering, Software development tooling

Agent Factory for Claude Code

An open-source kit that turns one Claude Code session into a small engineering team of specialist subagents, with an approval gate on risky commands and a local dashboard for the work.

Local dashboard with pending approvals, running and finished agents, projects, sessions with estimated cost and errors
The local dashboard, shown with sample telemetry for example projects: pending approvals, agents, sessions and estimated cost.

Agent Factory is a public repository for developers who already use Claude Code every day and want review, testing and approval to happen by default instead of by reminder. It is built only from native Claude Code parts: one set of global rules, five subagents, one optional /factory skill, and two hooks with a local dashboard.

There is no orchestrator service, no LLM router and no mandatory ticket or command. You talk to the main session as usual. It decides whether to do a task directly or to delegate part of it, and it reports in the same chat.

It is open source on GitHub under the MIT licence. It was built and tested on Windows, with a PowerShell installer. No usage figures exist for it and none are claimed here.

Problem

A single AI session builds, reviews and ships its own work

When one coding session writes a change, checks it and runs the commands that publish it, nothing independent looks at the result. Reviews, tests and security checks depend on someone remembering to ask for them, and the same context that wrote the bug is asked to find it.

The risky part is not the code but the shell. A session with permission to run commands can push to a protected branch, merge a pull request, deploy to production or delete files outside the project. A developer approving prompts all day tends to stop reading them.

Session detail with token use and estimated cost for the main session and each subagent, above an event timeline
One session opened up, with usage per subagent and a timeline of events. Sample data.
Approach

Roles, hand-off contracts and a gate, with nothing extra to run

The kit stays inside what Claude Code already provides. Working rules live in a global instructions file, specialists are subagent definitions, and the only code that runs is two small hooks and a local dashboard. There is nothing to host and no service to keep alive.

Every agent replies in the same machine-checkable shape. Builders start with STATUS: READY or STATUS: BLOCKED. Reviewers start with VERDICT: PASS or VERDICT: CHANGES with file and line findings. If a reviewer asks for changes, the same engineer is resumed with the findings at most twice, then the session stops and asks the owner.

The approval gate fails safe. If anything errors, or git cannot name the current branch within five seconds, the command is treated as protected and falls back to Claude Code's own permission prompt. It never allows on error.

File tree of the repository beside an excerpt of the approval gate test output listing protected and allowed commands
The repository layout beside an excerpt of the gate test's output. A page rendered for this case study from the repository's real file list and test output, not a product screen.
Solution

Five subagents, one optional workflow, one gate

The main session follows four steps for every request: detect the project, understand the current state, decide whether to delegate, then execute and report with the check results quoted. A routing table sends small fixes to the main session, multi-file builds to the engineer, finished work to the code reviewer, user flows to QA, and anything touching money, auth, tokens or new dependencies to the security reviewer as well.

For a large multi-part feature, the optional /factory skill adds a job folder claimed with a plain mkdir, a git worktree outside the repo, a written spec with a verify step per requirement, a build, parallel reviews and bounded rework. The coordinator never merges.

The telemetry hook writes one JSON line per Claude Code event to a local file. A dashboard on the loopback address reads those files and the session transcripts to show running agents, sessions per project, tokens and an estimated cost, errors, pending approvals and a board of work by stage.

Key features
  • Five specialist subagents

    engineer builds a scoped change and runs the project's own gates. code-reviewer, qa and security-reviewer review without writing code. docs writes documentation only when asked or when a documented contract changed.

  • Approval gate on risky commands

    Pushes and merges to protected branches, force pushes, production deploys, terraform apply and destroy, hard resets, protected branch deletes and recursive deletes outside the repo are held for the owner. Single-use approvals expire after 24 hours.

  • Optional /factory workflow

    A job folder, an isolated worktree, a numbered spec with a verify step per requirement, parallel reviews and at most two rework rounds, ending in a hand-off. The owner does the merge.

  • Telemetry and a local dashboard

    Agents, sessions, tokens, estimated cost, errors and approvals on a page served from the developer's own machine. Cost is an estimate from list prices, not a bill.

  • Stage board

    A board tab with one column per stage, from queued through building, review, QA and fix-needed to done or blocked, fed by an append-only file that agents write with a one-line command.

  • Engineering standard built in

    The global rules require tests written first, unit and integration tests, a feature counted as done only when they pass, and a security break pass after each completed feature, reported without fixing until the owner approves.

Dashboard on a phone with approvals, agents and projects stacked in one column
The dashboard on a phone, with tables scrolling sideways. Sample data.
Under the hood
  1. 01

    Command parsing, not string matching

    The gate splits commands into segments on semicolons, and, or, pipes and newlines, strips wrappers such as sudo, env and git -C, expands nested bash -c strings, and checks each segment against rules in a protected.json file.

  2. 02

    Fails closed

    Branch-dependent rules treat the branch as protected when git cannot answer in time, the hook is registered to block on failure, and approvals are read only from the approval service's own state, never from a file the session can write.

  3. 03

    Zero dependencies

    The hooks and the dashboard use only Node.js built-ins. The dashboard binds to 127.0.0.1 and refuses other Host headers to resist DNS rebinding.

  4. 04

    Usage read from transcripts

    Tokens and cost come from the session transcripts and each subagent's own transcript, counted once per message id so streamed chunks are not double counted, with incremental reads so large files are not re-parsed.

  5. 05

    Idempotent installer

    A PowerShell script copies agents and the skill into the user's Claude folder, merges hook entries into settings after a one-time backup, and can remove them again. It never touches the user's own instructions file.

  6. 06

    Tested, with the platform gap stated

    Four Node test files cover the gate, the board, the server and the usage parser. On macOS the board, server and usage tests pass and the gate test fails on two Windows-path cases, as the README states.

Outcome
  • A developer can get an independent review, a QA pass and a security pass on a change without asking for each one, using only native Claude Code features.
  • Pushes to protected branches, deploys and destructive commands stop at an approval step instead of relying on the developer reading every prompt.
  • Work across agents is visible in one local page: who is running, what each session used, and what is waiting for approval.
  • The whole kit is public under the MIT licence, so a team can read the rules and the gate and change them.

Next project

Daily Planner AppPersonal Productivity