claude-code - 💡(How to fix) Fix [FEATURE] Per-project agent configuration (whitelist/blacklist) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47907Fetched 2026-04-15 06:38:58
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Timeline (top)
labeled ×2commented ×1

Fix Action

Fix / Workaround

Current workarounds:

  1. Accept performance warnings (soft limit, not blocking)
  2. Manually delete/reinstall agents when switching project types
  3. Maintain minimal global agent set (limiting capabilities in specialized repos)

Code Example

{
  "mode": "whitelist",
  "agents": ["brain-dump-organizer", "session-journalist", "content-writer"]
}

---

{
  "agents": {
    "mode": "blacklist",
    "list": ["mobile-developer", "kubernetes-specialist", "blockchain-developer"]
  }
}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

Previously raised in #16836 (auto-closed and locked).

Agents are managed globally in ~/.claude and apply to all projects. This causes performance warnings when the cumulative agent descriptions exceed ~15k tokens, even though many agents are only relevant to specific projects.

A developer working across multiple domains (mobile, infrastructure, documentation, blockchain, AI) accumulates 200+ agents globally. A documentation repo doesn't need Kubernetes or blockchain agents. An embedded systems project doesn't need React or Django agents. But today the only option is to delete agents entirely, removing them from all projects.

Proposed Solution

Add per-project agent configuration, similar to how CLAUDE.md provides project-specific instructions.

Option A: Project-level .claude/agents.json

{
  "mode": "whitelist",
  "agents": ["brain-dump-organizer", "session-journalist", "content-writer"]
}

Option B: Setting in .claude/settings.json (project-level)

{
  "agents": {
    "mode": "blacklist",
    "list": ["mobile-developer", "kubernetes-specialist", "blockchain-developer"]
  }
}

Either approach:

  1. Only loads relevant agents per project, reducing token overhead
  2. Falls back to global configuration if no project config exists
  3. No breaking changes

Alternative Solutions

Current workarounds:

  1. Accept performance warnings (soft limit, not blocking)
  2. Manually delete/reinstall agents when switching project types
  3. Maintain minimal global agent set (limiting capabilities in specialized repos)

None of these are satisfactory for users with large agent libraries working across diverse projects.

Priority

Medium - Would be very helpful

Feature Category

Performance and speed

Use Case Example

  1. Developer has 220+ agents across categories (DevOps, mobile, data, content, security, etc.)
  2. Opens a documentation-only repository
  3. Claude Code loads all 220 agent descriptions (~15k+ tokens), triggering performance warning
  4. With per-project config: only 5-10 relevant agents load, no warning, faster context
  5. Switching to an infrastructure repo loads a different agent subset automatically

Additional Context

  • References: #35017 and #16836 (same request, auto-closed/locked)
  • This is a scaling problem: the more productive you are with agents, the worse the performance tax in unrelated projects
  • The existing .claude/settings.json per-project override mechanism could be extended naturally to support this

extent analysis

TL;DR

Implement per-project agent configuration to reduce token overhead and improve performance.

Guidance

  • Consider using a project-level configuration file, such as .claude/agents.json or a setting in .claude/settings.json, to specify relevant agents for each project.
  • Evaluate the two proposed options: a whitelist approach, where only specified agents are loaded, or a blacklist approach, where certain agents are excluded.
  • Assess the potential impact of falling back to global configuration if no project config exists, to ensure a smooth user experience.
  • Review the existing .claude/settings.json per-project override mechanism to determine if it can be extended to support per-project agent configuration.

Example

// .claude/agents.json (whitelist example)
{
  "mode": "whitelist",
  "agents": ["brain-dump-organizer", "session-journalist", "content-writer"]
}

Notes

The proposed solution aims to address a scaling problem, where the cumulative agent descriptions cause performance warnings. The approach should be evaluated to ensure it does not introduce breaking changes or negatively impact the user experience.

Recommendation

Apply workaround by implementing per-project agent configuration, as it addresses the performance issue and provides a more scalable solution.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING