agentleFS
niksavisniksavis/basicly/.agents/skills/tier-injection/SKILL.md

tier-injection

Skill0 starsChanged 57 days agoMITView on GitHub

Installs the tier kit so a subagent runs on the model its tier names. Use when a host must pin the model of a spawn or a subagent ignores its tier.

The file

Files
SKILL.md
<!-- Generated by `basicly skills-build` from skill.yaml. Do not edit; edit the source. -->

Tier Injection

A subagent definition declares a portable tier: low, medium, high or maximum. The kit changes that tier into the model the spawn runs on, at spawn time.

Rules

  • Check CLAUDE_CODE_SUBAGENT_MODEL first when a spawn ignores its tier. It outranks the value the hook writes, and the hook stays silent.
  • Relaunch the whole CLI process after a first install. The host does not watch a directory that did not exist at startup. /clear reloads neither hooks nor agents.
  • Remove a model pin to let the tier decide. The hook leaves a definition that pins its own model, and a spawn that names one.
  • Commit .basicly/core/models/model-map.json in the repository. A repository with no map in its own tree gets no rewrite.

What the kit is

The kit is three files in .basicly/core/kit/tier/: install_hook.py, claude_tier_hook.py and tier_resolver.py. It needs no basicly import, nothing on PATH, no third-party package and no network. Copy the three files and .basicly/core/models/model-map.json into any repository, and the kit works there.

HostResult
Claude CodeA PreToolUse hook on the Agent tool
Copilot CLINothing. Copilot selects the model of a subagent in its configuration, and the kit does not write that configuration

Install

python3 .basicly/core/kit/tier/install_hook.py --dry-run
python3 .basicly/core/kit/tier/install_hook.py
python3 .basicly/core/kit/tier/install_hook.py --user
FlagEffect
(none)Writes the hook into .claude/settings.json of this repository
--userWrites the hook for every repository on this machine. The hook answers only in a tree that has its own committed map
--dry-runReports what it would write, and writes nothing
--host <host>Installs for one host. Repeatable. The default is every known host
--root <path>Installs into another repository
--interpreter <cmd>Sets the command that runs the hook, for a machine with no uv. Example: --interpreter "py -3" on Windows
--uninstallRemoves only the hook that this script installed

A second run changes nothing. It never duplicates the hook and never changes a hook that you wrote.

The two scopes get different commands. The repository file is committed and shared, so its command holds no machine-specific path. It names the hook through ${CLAUDE_PROJECT_DIR} and runs it under uv:

"command": "uv run --no-project --no-python-downloads python \"${CLAUDE_PROJECT_DIR}/.basicly/core/kit/tier/claude_tier_hook.py\""

The user file is local to the machine, so it keeps absolute paths and needs nothing on PATH.

Check a resolution without a spawn

python3 .basicly/core/kit/tier/tier_resolver.py --host claude --name my-agent

It exits 0 with a model and an alias, or exits 1 with the reason that nothing resolved. Other options: --definition <path>, --tier <tier>, --default-tier <tier>, --vendor <vendor>, --map <path> and --root <path>.

Behaviour to expect

  • The hook writes an alias such as opus, not a model id. The model field of the Agent tool takes an alias. The frontmatter of a definition takes a full model id.
  • A tier that the map marks unavailable resolves to nothing, never to the model of another tier.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.