Skip to main content
interlace
Plugin: conventionsRules

subagent-declares-model

Require every .claude/agents/*.md subagent to declare a model and a tool allowlist in its frontmatter

Next step

subagent-declares-model ships in eslint-plugin-conventions, with 6 of its 20 rules in the recommended preset.

Install
npm install -D eslint-plugin-conventions
eslint.config.js
import { configs } from 'eslint-plugin-conventions';

export default [configs.recommended];

Plugin pagenpmSource on GitHub

Every subagent declares its model and its tool allowlist

Rule Details

A subagent with no model: inherits the parent session's model — usually the most expensive one, for a task picked precisely because it was narrow. One with no tools: inherits every tool, including the ones that write. Both are one frontmatter line each.

Examples

❌ Incorrect

---
name: reviewer
---

Review the diff.

✅ Correct

---
name: reviewer
model: haiku
tools: Read, Grep, Glob
---

Review the diff.

Use this rule

npm install -D eslint-plugin-conventions
eslint.config.js
import conventions from 'eslint-plugin-conventions';export default [  {    plugins: { 'conventions': conventions },    rules: {      'conventions/subagent-declares-model': 'error'    },  },];
npm install -D oxlint-plugin-conventions
.oxlintrc.json
{  "jsPlugins": ["oxlint-plugin-conventions"],  "rules": {    "conventions/subagent-declares-model": "error"  }}
vite.config.ts
import { defineConfig } from 'vite-plus';export default defineConfig({  lint: {    jsPlugins: ['oxlint-plugin-conventions'],    rules: {      'conventions/subagent-declares-model': 'error',    },  },});

oxlint-plugin-conventions re-exports eslint-plugin-conventions/oxlint: the same rules under the same IDs, and no ESLint install. Why oxlint.

Did this rule catch something? Star the repo to get new CWE coverage as we ship it — or follow the AI-code-security benchmarks behind these rules.