Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Claude loads one when your task matches it, or you run it by name.
1 marketplace, most starred first
file-size, fan-out, token-limit, import-boundaries, import-linter, dependency-cruiser, lefthook, git-hooks ·
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Keeps a repo easy for agents to read. Two checks, an editor hook and import rules:
Each failure says how to fix it along a deep module (John Ousterhout, "A Philosophy of Software Design"): a small interface over much hidden work. Never by line count, never into a utils/ bucket.
This plugin was called file-size up to 0.1.0.
/structure:setting-up-the-checks: Sets up both checks in a repo. Copies check-file-size, check-fan-out and structure-hook to scripts/ (CI and fresh clones cannot see a plugin install path), lists today's offenders, writes .fan-out-baseline, and wires the checks into lefthook pre-commit on staged files, pre-push and GitHub Actions on the whole repo, and the Claude Code PostToolUse hook in .claude/settings.json. A repo without lefthook gets versioned git hooks in .githooks/ instead./structure:setting-up-import-boundaries: Surveys a repo's modules and writes import-linter contracts (Python) or dependency-cruiser rules (TypeScript) with the user, then wires them into mise run lint and CI.All in skills/setting-up-the-checks/assets/.
check-file-size checks the paths it gets as arguments, as staged, or with no arguments every file in HEAD's tree. It skips symlinks, submodules, lockfiles, binaries, fonts, PDFs and license texts; a repo adds globs in .file-size-excludes, where a line over 512 bytes or with more than 4 **, and every glob after the 1024th, are skipped, as in .fan-out-excludes.
check-fan-out counts the files and folders in each folder, from git's list of tracked and untracked files (never ignored ones). It skips the repo root and names that start with ..
check-fan-out <path>... checks every folder above each path.check-fan-out --all checks every folder.check-fan-out --update-baseline lowers or drops lines in .fan-out-baseline, never raises or adds one. With no file, it writes one from today's overages.A folder fails when it holds more than 7 entries and more than its line in .fan-out-baseline. .fan-out-excludes lists folders it skips, one glob per line with a comment above it that says why.
structure-hook reads Claude Code's hook JSON on stdin, runs both checks on tool_input.file_path (the size on disk), and exits 2 with their message on a failure. A file in a repo with no copy of the hook at the same path, such as a nested repo the project ignores, passes untouched, and a symlinked scripts/ counts as scripts/; the hook ignores GIT_DIR and GIT_WORK_TREE, so the file's path alone picks its repo; a file in another repo or worktree with a copy meets that repo's baseline and excludes, and the hook never runs that copy. The hook runs no code from the edited file's repo: git asks that repo only where its top and info/exclude are, and every other git runs against a throwaway git dir. So that repo's config, hooks, filters and objects stay out of it; references/editor-hook.md in the skill lists what that costs. The hook also does not hang on that repo: the checks read their settings only from regular files and only the first MiB, git runs under a 4 GiB memory limit, and a job kills everything still running after 30 s, or at once when the hook's bash gets SIGTERM; then the hook exits 1 with a message. It drops every PATH entry that does not start with /, so . or an empty entry cannot run that repo's tools. It also drops mise's shim folder, since a shim runs a path: tool that the mise config of its folder names, trusted or not. An absolute entry stays, even inside that repo, so with such a folder on PATH the hook runs its tools: that is the user's own setting, and references/editor-hook.md says why. It needs git on PATH and jq, on PATH or in mise's global config; without them, or with a jq that fails or an event over 16 MiB, it exits 1 with a message.
The fallback git hooks ship beside them as pre-commit and pre-push.
check-file-size, check-fan-out and structure-hook start with a comment that names this folder as the canonical copy. Copies of all three in other repos (the pgoell/project-template Copier template holds each in its template/scripts) stay byte-identical.
tests/run.sh builds throwaway git repos and runs the scripts, the fallback pre-commit hook and the editor hook (with fake JSON) against them. No network. Run it from the repo root:
bash plugins/structure/tests/run.sh
Last run, 2026-10-20: 56 passed, 0 failed.
MIT, see LICENSE.
npx claudepluginhub pgoell/pgoell-claude-tools --plugin structurePlugins from other owners that cover similar ground
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.