Feature Request: Per-Agent Directory Access Control for Sub-Agents

Resolved 💬 4 comments Opened Jul 30, 2025 by silver-ben Closed Jan 5, 2026

Feature Request: Per-Agent Directory Access Control

Currently, sub-agents in Claude Code inherit the project's global .claudeignore file, which limits optimization for specialized workflows.

Use Case Example: A web application with:

  • Frontend code in /src/frontend
  • Backend API in /src/backend
  • Database migrations in /db
  • Documentation in /docs
  • Test files in /tests

Problem: A frontend-specialist agent loads backend files, database schemas, and test fixtures into its context, wasting valuable context window space on irrelevant code.

Proposed Solution: Allow sub-agents to specify accessible directories:

Option 1 - Custom .claudeignore per agent:
.claude/agents/frontend-agent/.claudeignore

Option 2 - Directory field in agent definition:
name: frontend-specialist
directories: ["/src/frontend", "/src/shared", "/docs/frontend"]
tools: Read, Edit, Grep

Benefits:

  • More efficient context usage
  • Larger effective working memory per agent
  • Better separation of concerns
  • Faster agent performance on large codebases

Impact: Enable complex multi-agent workflows on enterprise-scale projects without context exhaustion.

View original on GitHub ↗

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