session-setup · git:20261103.4b77e0e · 2026-11-03 · sha256 ad2bf557b4ddfc6e
session-setup git:20261103.4b77e0eA
Immutable. This exact content never changes and is served at /api/v1/blob/ad2bf557b4ddfc6e.
No tool to install first
claude plugin marketplace add https://markdownregistry.com/mp/a/art_wa4u5ubloktwngl5/ad2bf557b4ddfc6ec36611630628173ffe62b82e0ebf97427258e9f8c765eb5e.json
Then /plugin install session-setup@markdownregistry-wa4u5ubloktwngl5 in Claude Code. It installs this exact version, the one graded A here, pinned to the commit it was graded at, and leaves it there.
--- name: session-setup description: Configure the project's Claude Code settings for Software Factory runs. Sets the auto-compact threshold and an allowlist of exact read-only and stack commands, after showing the diff and asking. Claude Code only. argument-hint: "[auto-compact percent]" disable-model-invocation: true --- # Session setup (Claude Code only) Act as the Team Lead. Goal: fewer permission prompts and a safe auto-compact threshold, written to the PROJECT's `.claude/settings.json`. Merge into the existing file and keep every existing key. Show the diff and ask the user before writing. Never touch user-level settings. 1. **Auto-compact.** Set `env.CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` to the user's choice (the argument, or the `Auto-compact` preference in `docs/architecture/project-facts.md`), default `"30"`. It is a percent of the auto-compact window (range 1-100), it can only lower the threshold, it applies to the main session and subagents, and the session continues after compaction. Write it to the `.claude/settings.json` of the folder the user starts Claude Code from: when that is a parent of the project (a multi-repo workspace), the project's own settings file is not loaded. It takes effect in sessions started after the change. 2. **Exact-command allowlist** in `permissions.allow`, built from the stack's exact commands: test, lint, typecheck, build, format-check. Detect them from `package.json` scripts (use the runner the lockfile implies), `pyproject.toml`, `go.mod`, `Cargo.toml`, the Gradle wrapper and Makefile targets. Add: - read-only git: `git status`, `git diff:*`, `git log:*`, `git show:*`, `git worktree list` - read-only gh: `gh issue list:*`, `gh issue view:*`, `gh pr view:*`, `gh project item-list:*`, `gh project view:*`, `gh project field-list:*`, `gh label list:*`, `gh repo view:*` - the contract section 5 issue writes, only when `Tracking: github`: `gh issue create:*`, `gh issue comment:*`, `gh issue edit:*`, `gh issue close:*`, `gh issue reopen:*`, `gh label create:*`, `gh project item-add:*`, `gh project item-edit:*` 3. **Never allow** wildcards over script runners (`npm run:*`, `python:*`, `bash:*`) and never any command the gate hook asks on (push, deploy, apply, publish, recursive force delete, and so on). 4. Project `env` and `allow` take effect after the user trusts the folder. 5. **Tell the user:** - Start the Team Lead in auto mode: `claude --agent software-factory:team-lead --permission-mode auto`. (`defaultMode: auto` only works in user settings.) Auto mode drops broad allow rules, and the gate hook's ask still prompts. - After a few tasks, run the built-in `/fewer-permission-prompts` to harvest more exact read-only rules. 6. Record the chosen `Auto-compact` value in `project-facts.md` Preferences if it is not there.