Claude config
Extracted sections bind before their activity. Resolve with active Foundry’s
bin/resolve_plugin_root.py --plugin-name foundryhelper (registry preferred); setFOUNDRY_ROOTto the result in the same Bash call. Never select a different installed version by mtime. For repository maintenance only, use source-treeplugins/cc_foundry. Unreadable detail → stop and report.
Path Rules¶
- No hardcoded absolute user paths — use
.claude/,~/, orgit rev-parse --show-toplevel - Artifact dirs belong at project root, not inside
.claude/— seeartifact-lifecycle.md
Bash Timeouts¶
Every Bash call must include explicit timeout — 3× expected P90 duration. Never rely on default 120 s cap; fail fast, let caller retry.
- Use 3× fastest plausible time — not worst case
- Unknown-duration command → estimate P90 conservatively, 3× that, minimum
timeout: 15000 - Timed-out fast op = signal to investigate; frozen session is not
timeout: 120000only for test suites or builds, never network calls
Per-operation-class lookup table (gh commands, git, installs, test suites, build steps): _full/claude-config.md.
Turn Batching — one response, every independent call¶
Before applying, Read
_full/claude-config.md§Turn Batching — one response, every independent call; binding inline. If it cannot be read, stop and report the missing prerequisite.
Batch consecutive edits to one file and independent calls of every kind in one response. Only a genuine data dependency justifies another response; an edit depending on a preceding result is exempt. Per-fix narration still applies (quality-gates.md §Reporting Findings).
Directory Navigation Commands¶
Before applying, Read
_full/claude-config.md§Directory Navigation Commands; binding inline. If it cannot be read, stop and report the missing prerequisite.
Never combine navigation and a command in one Bash call: always two separate calls; CWD persists. Applies to every command, not only worktrees.
Literal Command Words in Git-Naming Bash Calls¶
A Bash call naming git or gh writes the program as literal text. A variable or $(…) as the command word (R=$(command -v ruff); git show … | "$R" check -) makes commit-guard fail closed: it cannot rule out a hidden push, so it asks the user to confirm. Write ruff or .venv/bin/ruff directly, or split into two Bash calls (git show … > "$F", then the tool on "$F"). A fixed assignment (R=.venv/bin/ruff) stays readable; a captured one does not.
Shipped Skill Blocks — Run As Written¶
Run a skill's fenced Bash block as its own call, exactly as shipped, feeding it only through its sentinel and Write-tool input files. Never copy fence text into a script file, loop over it or retype it: such a call misses the blueprint auto-allow and commit-guard cannot read a generated script, so each one prompts. Deviate only for a clear, major advantage, and state what changed and why.
TMPDIR Sentinel Scoping¶
Before applying, Read
_full/claude-config.md§TMPDIR Sentinel Scoping; binding inline. If it cannot be read, stop and report the missing prerequisite.
List Range Label Discipline¶
When editing file with lettered/numbered list range labels (e.g. **Close-scenario archetypes (A–G):**):
- After any edit adding/removing list items, update all range labels in file — not just edited section
- Non-contiguous letter ranges: use explicit form
A–C, F–G, notA–G, when items missing - Scan entire file after edits to catch stale range labels elsewhere
Agent/Skill Spawn Discipline¶
Before applying, Read
_full/claude-config.md§Agent/Skill Spawn Discipline; binding inline. If it cannot be read, stop and report the missing prerequisite.
For work-displacement only, estimate native tool-calls: under ~73 → inline; isolation-motivated dispatch (distinct role/system prompt, adversarial independence, different model tier, worktree) is exempt. Prefer an existing domain specialist once warranted. One agent per independent subtask; batch small related work only below the ~55-tool-call workload bound, otherwise split into parallel groups. Keep each agent near ~55 calls; past ~60 risks a missing envelope. Skill() overhead remains unverified, never inferred from the ~120,851 tok / ~12.0 s Agent() measurements.
Parallel Spawn Ceilings — by Model Tier¶
Before applying, Read
_full/claude-config.md§Parallel Spawn Ceilings — by Model Tier; binding inline. If it cannot be read, stop and report the missing prerequisite.
Lint/Format — Pinned Hooks, Not Bare Tools¶
Project pins lint/format tools via .pre-commit-config.yaml → never invoke them directly (ruff, eslint, mdformat, …; version/config drift vs CI); run pre-commit run <hook-id> --files <path>, ad-hoc checks included. Hook missing → add it to the config; no pin → direct tool use fine. Command forms: python-code.md §Lint/Format.
Instruction-File Compression Gate¶
Applies only to instruction files an LLM host loads (AGENTS.md, CLAUDE.md, rule, skill, or agent-definition files), never to ordinary docs or code. Compressing or structurally reformatting one = behavior-sensitive: byte-exact pre-change backup first, prove complete semantic preservation, restore the pre-change file on any loss; unresolved difference blocks completion. Five-step gate: markdown.md §Instruction-File Compression Gate (auto-loads on first access of any *.md) — Read before compressing.
Ask Before Acting on Unknown Cause¶
When user asks "why" about something (deleted content, unexpected state, missing items) and cause unknown:
- Never act — do not restore, revert, or modify anything
- State clearly cause unknown and why (e.g. "pre-session change not made by me")
- Call
AskUserQuestiontool directly — only an actual tool invocation counts; bracketed or narrated forms never do (communication.md§Interactive Questions)
Restoring without being asked = overstepping. "Why" = question, not request to fix.
Git Commit & Push — Hard Bans¶
Always on, format bullets included: the full commit rule (git-commit.md) is injected by rule-inject.js after the first commit-creating git call (add, commit, push, merge, …) of a session or subagent runs, beside that call's result — after the first message was drafted. Before drafting any commit message, Read ~/.claude/rules/foundry-git-commit.md and its _full/git-commit.md unless already in context.
- Never commit without authority: skill workflow step, explicit same-turn user request, local Git grant, or same-turn
git-approveanswer - Never
git add -A/git add .(stage by name); never--no-verify; never--no-gpg-signunless the user asks - Subject
type(scope): detailortype: detail≤50 chars naming the highest-tier change ingit diff HEAD+git diff --stat HEAD; never draft from session memory; omit redundant scope - Evidence-only body: every clause traces to a
+/-line ingit diff HEAD; no body line wrap; body in simplified Markdown (code,**bold**,-lists; no headings, tables, links, fences); no GitHub auto-links (#N,@name); no non-VCS paths (/tmp/,~/.claude/) - Force-push (
-f/--force/--force-with-lease) forbidden on any branch, always; regulargit pushasks viaAskUserQuestionevery time, skill workflows included - Detect the default branch dynamically, never hardcode
main/master; prefergit revertoverreset --hard, merge commits over rebase - Co-author trailer on every commit, after a
---separator:Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>; addCo-authored-by: Codex <codex@openai.com>when Codex shaped the outcome, or when the Codex-activity check finds Codex threads or.temp/bridgerecords since the last commit while this conversation and its subagents made no Codex call; run the Codex-activity check from_full/git-commit.md§Co-authors before drafting — replaces the host's default attribution line