foundry
A local Claude Code plugin that runs software work through a fixed chain: owner → foreman → line-lead / shop-boss →
hand. The foreman is a background session that turns the owner's instructions into units of work. Each unit gets its
own git worktree and its own claude --bg lead session; hands are subagents inside the lead. Hooks enforce the chain
and answer permission requests in tiers, all state lives in append-only files under ~/.local/state/foundry/, and a
side pane shows the board.
Quickstart
Requirements: Claude Code, python3 (stdlib only), git, gh (logged in), and lsof for housekeeping. macOS or
Linux.
-
Install the plugin from its marketplace (this repository's root is a single-plugin marketplace named foundry:
.claude-plugin/marketplace.json beside plugin.json):
claude plugin marketplace add JeongJaeSoon/foundry
claude plugin install foundry@foundry
then, in a Claude Code session, type /foundry setup: it creates what install.sh below creates (state,
foreman and worktree directories, config.json, the foreman directory's trust entry, preflight and the
~/.local/bin/foundry shim) and is safe to re-run. Until it has run, each session starts with the one line
foundry is not set up: run /foundry setup; no hook sets anything up by itself.
Or install from a clone, from a plain terminal, not a shell escape inside a Claude session:
git clone https://github.com/JeongJaeSoon/foundry && sh foundry/install.sh
install.sh creates the state, foreman and worktree directories, writes config.json (mode 600), adds the
marketplace it sits in (by the name in that marketplace's marketplace.json) and installs the plugin from it,
trusts the foreman directory, runs foundry preflight, and installs ~/.local/bin/foundry, a shim that runs the
enabled plugin version from any terminal. It is idempotent. Rollback: sh .../uninstall.sh (state and worktrees
stay).
-
Set up with foundry init (re-runnable; values already set are kept unless their flag is given):
foundry init --repo app=~/src/app --tracker none # --dry-run shows the plan first
It discovers your GitHub login (gh api user) and the machine's timezone, takes --worktree-root,
--foreman-dir, --tracker jira|linear|github|none, --repo NAME=PATH (repeatable) and optional Slack ids
(--owner-slack-user U... --owner-dm D...), and prints the foreman start command and what is still missing.
-
Restart open Claude Code sessions (or /reload-plugins), then, from a plain terminal, start the foreman, attach,
and send foundry up as its first prompt:
foundry foreman start # refuses while a foreman is already running or idle, and names it
claude attach foreman # then, in the foreman: foundry up
foundry foreman start --prompt "foundry up" sends the first prompt at launch. Fallback: foundry foreman line
prints the same start line to run by hand:
cd ~/work/foundry && claude --bg -n foreman --agents "$(foundry mcp agent foundry:foreman 2>/dev/null || echo {})" --agent foundry:foreman --model opus --effort medium --permission-mode auto --settings '{"advisorModel":"claude-fable-5-2","env":{"FOUNDRY_ROLE":"foreman"}}'
-
Open the board with /foundry-board.
--agents hands the foreman its agent definition with this install's MCP server names (foundry mcp agent): a
--bg session takes its main agent from the agent file, whose generic names (mcp__atlassian__…) match no server,
before the plugin re-registers it. To restart a running foreman with it: in the foreman, write its handoff (the
foundry-handoff skill), then claude stop <id> with the current foreman's short id (the board's "foreman restart
needed" hint prints the command; claude stop foreman is ambiguous once stale sessions share the name), then run
the start line above.
Nothing is installed as a system service. The foreman arms foundry watch stream --kind github|sessions|pressure|sync|stalls
under the Monitor tool; CronCreate is used only for prefs schedules. foundry up prints what to arm.
Configuration
Preferences are defaults/prefs.json deep-merged with ~/.local/state/foundry/prefs.json
(foundry prefs show|validate|set). An invalid file is refused and the last valid merge is used. The shipped
defaults carry no people, organization or service values; set yours: