{
  "slug": "pi-tools-cannot-mix-modifiers",
  "url": "https://insidetheloop.dev/fixes/pi-tools-cannot-mix-modifiers",
  "markdown_url": "https://insidetheloop.dev/fixes/pi-tools-cannot-mix-modifiers.md",
  "title": "Pi coding agent: \"Error: --tools: tool names cannot be mixed with +name or -name entries\"",
  "description": "pi 1.1.0 rejects mixing plain tool names with +name/-name modifiers in --tools. Pass either a full plain allowlist or modifier entries alone.",
  "tool": {
    "id": "pi",
    "name": "Pi coding agent",
    "long_name": "Pi coding agent (pi)",
    "url": "https://insidetheloop.dev/tools/pi",
    "latest_version": "1.1.0"
  },
  "error": "Error: --tools: tool names cannot be mixed with +name or -name entries",
  "variants": [
    "Error: -t: tool names cannot be mixed with +name or -name entries"
  ],
  "output": "Error: --tools: tool names cannot be mixed with +name or -name entries",
  "exit_code": 1,
  "command": "pi --tools read,+codemode -p \"test\"",
  "versions": {
    "affected": "1.1.0 and later",
    "first_bad": "1.1.0",
    "last_good": "1.0.4",
    "fixed_in": null,
    "tested": [
      "1.0.4",
      "1.1.0"
    ]
  },
  "cause": "Pi 1.1.0 (released 2026-10-07) added `+name` and `-name` tool modifiers to `--tools` to adjust default tools instead of replacing them, but requires an argument to be either entirely plain tool names or entirely modifiers.",
  "fix": {
    "summary": "Pass either a full comma-separated list of plain tool names or only +name/-name modifier entries.",
    "commands": [
      "# replace default tools with an explicit allowlist",
      "pi --tools read,bash,codemode -p \"<prompt>\"",
      "",
      "# or modify default tools by adding or removing individual tools",
      "pi --tools +codemode -p \"<prompt>\"",
      "pi --tools -bash -p \"<prompt>\""
    ],
    "note": "When `--tools` contains any entry starting with `+` or `-`, Pi treats the flag as modifier mode and applies additions and deletions to its default tool selection (`read`, `bash`, `edit`, `write`). Mixing plain tool names (an allowlist) with modifier entries in the same `--tools` or `-t` flag is rejected by argument validation."
  },
  "reproduction": {
    "ran_at": "2026-10-10T12:47:26Z",
    "environment": "A fresh Debian 13 VM from `bin/sandbox-run` (Node.js 24, root, online, no credentials for any service), destroyed after the run.",
    "steps": [
      {
        "label": "Before: plain list allowed (without modifiers, +codemode treated as literal name)",
        "version": "1.0.4",
        "command": "pi --tools read,+codemode -p \"test\"",
        "output": "No API key found for the selected model.\n\nUse /login to log into a provider via OAuth or API key. See:\n  /opt/pi-1.0.4/lib/node_modules/@earendil-works/pi-coding-agent/docs/providers.md\n  /opt/pi-1.0.4/lib/node_modules/@earendil-works/pi-coding-agent/docs/models.md",
        "exit": 1
      },
      {
        "label": "After: mixed tool names and modifiers rejected",
        "version": "1.1.0",
        "command": "pi --tools read,+codemode -p \"test\"",
        "output": "Error: --tools: tool names cannot be mixed with +name or -name entries",
        "exit": 1
      },
      {
        "label": "Short flag form: -t produces the same error",
        "version": "1.1.0",
        "command": "pi -t read,+codemode -p \"test\"",
        "output": "Error: -t: tool names cannot be mixed with +name or -name entries",
        "exit": 1
      },
      {
        "label": "Fix verified (allowlist): full plain list accepted and passes argument parsing",
        "version": "1.1.0",
        "command": "pi --tools read,bash,codemode -p \"test\"",
        "output": "No API key found for the selected model.\n\nUse /login to log into a provider via OAuth or API key. See:\n  /opt/pi-1.1.0/lib/node_modules/@earendil-works/pi-coding-agent/docs/providers.md\n  /opt/pi-1.1.0/lib/node_modules/@earendil-works/pi-coding-agent/docs/models.md",
        "exit": 1
      },
      {
        "label": "Fix verified (modifiers): +name modifier accepted and passes argument parsing",
        "version": "1.1.0",
        "command": "pi --tools +codemode -p \"test\"",
        "output": "No API key found for the selected model.\n\nUse /login to log into a provider via OAuth or API key. See:\n  /opt/pi-1.1.0/lib/node_modules/@earendil-works/pi-coding-agent/docs/providers.md\n  /opt/pi-1.1.0/lib/node_modules/@earendil-works/pi-coding-agent/docs/models.md",
        "exit": 1
      },
      {
        "label": "Fix verified (modifiers): -name modifier accepted and passes argument parsing",
        "version": "1.1.0",
        "command": "pi --tools -bash -p \"test\"",
        "output": "No API key found for the selected model.\n\nUse /login to log into a provider via OAuth or API key. See:\n  /opt/pi-1.1.0/lib/node_modules/@earendil-works/pi-coding-agent/docs/providers.md\n  /opt/pi-1.1.0/lib/node_modules/@earendil-works/pi-coding-agent/docs/models.md",
        "exit": 1
      }
    ]
  },
  "why": {
    "text": "Pi 1.1.0 added `+name` and `-name` entries to `--tools` to adjust default tools instead of replacing them (such as `pi -t +codemode`). Validation in `getToolListError` enforces that any list containing modifier entries must contain only modifiers and no wildcard patterns.",
    "url": "https://github.com/earendil-works/pi/releases/tag/v1.1.0",
    "source": "Pi coding agent 1.1.0 release notes"
  },
  "tool_page": "https://insidetheloop.dev/tools/pi#gotcha-mixing-plain-tool-names-with-name-or-name-in-tools-fails-with-validation-error",
  "related": [
    {
      "slug": "pi-unknown-provider-azure-openai-responses",
      "error": "Error: Unknown provider \"azure-openai-responses\". Use --list-models to see available providers/models.",
      "url": "https://insidetheloop.dev/fixes/pi-unknown-provider-azure-openai-responses"
    }
  ],
  "sources": [
    {
      "title": "Pi coding agent 1.1.0 release notes",
      "url": "https://github.com/earendil-works/pi/releases/tag/v1.1.0",
      "read": "2026-10-10"
    },
    {
      "title": "earendil-works/pi commit ddaa0a03: accept +name/-name entries in --tools",
      "url": "https://github.com/earendil-works/pi/commit/ddaa0a0341a84b073a087a3d89b9b9e7fbdaf6ba",
      "read": "2026-10-10"
    },
    {
      "title": "Pi settings-manager source at v1.1.0",
      "url": "https://github.com/earendil-works/pi/blob/v1.1.0/packages/coding-agent/src/core/settings-manager.ts",
      "read": "2026-10-10"
    },
    {
      "title": "Pi CLI args parser source at v1.1.0",
      "url": "https://github.com/earendil-works/pi/blob/v1.1.0/packages/coding-agent/src/cli/args.ts",
      "read": "2026-10-10"
    },
    {
      "title": "Pi coding agent 1.0.4 release notes",
      "url": "https://github.com/earendil-works/pi/releases/tag/v1.0.4",
      "read": "2026-10-10"
    }
  ],
  "date_published": "2026-10-10T12:48:30Z",
  "date_modified": "2026-10-10T12:48:30Z",
  "verified": {
    "date": "2026-10-10",
    "versions": [
      "1.0.4",
      "1.1.0"
    ]
  }
}
