[BUG] Custom subagents in .claude/agents/ not recognized by VS Code extension

Resolved 💬 4 comments Opened Feb 9, 2026 by hugo-bluecorn Closed Feb 9, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] I can reproduce this bug consistently

Bug Description

Custom subagents defined in .claude/agents/ work correctly in the CLI (claude command in terminal) but are completely unavailable in the VS Code extension. The Task tool in the VS Code extension only recognizes hardcoded built-in subagent types and rejects custom agent names.

Steps to Reproduce

  1. Create a custom subagent at .claude/agents/tdd-planner.md with valid YAML frontmatter:
---
name: tdd-planner
description: Use this agent for planning features using TDD methodology.
tools: Read, Grep, Glob, Bash, WebFetch, WebSearch, AskUserQuestion, TodoWrite
disallowedTools: Write, Edit, NotebookEdit, Task
---

You are a TDD Planning Agent...
  1. In the CLI (terminal): Run claude from the project directory and ask "Use the tdd-planner to plan a feature"
  • Result: Agent is detected, spawned, and executes correctly following the custom system prompt
  1. In the VS Code extension: Ask the same question
  • Result: The Task tool attempts subagent_type: "tdd-planner" and fails with:

``
Agent type 'tdd-planner' not found. Available agents: Bash, general-purpose, statusline-setup, Explore, Plan, claude-code-guide
``

  • There is also no automatic delegation based on the agent's description field

Expected Behavior

Custom subagents in .claude/agents/ should be available in the VS Code extension with the same behavior as the CLI:

  • Automatic delegation based on the agent's description field
  • Tool restrictions from YAML frontmatter (tools, disallowedTools) enforced
  • Custom system prompt used for the agent's behavior

Actual Behavior

The VS Code extension's Task tool only accepts hardcoded built-in subagent types. Custom agents are completely ignored.

Workaround

Spawning a general-purpose agent and instructing it to read the .claude/agents/*.md file and follow its instructions. This does not enforce YAML frontmatter tool restrictions — the agent has full tool access regardless of disallowedTools.

Impact

Teams cannot share project-specific subagents through version control and have them work consistently across both CLI and VS Code extension, which is the documented use case for .claude/agents/ (project-scoped agents checked into the repo).

Environment

  • Claude Code VS Code Extension
  • Platform: Linux (Ubuntu 24.04)
  • Model: Claude Opus 4.6
  • Claude Code CLI: Custom agents work correctly in CLI from the same project directory

Related

  • #23874 (Task tools disabled in VS Code extension due to isTTY check — possibly same root cause)
  • Subagents documentation

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗