Help us improve
Share bugs, ideas, or general feedback.
From great_cto
Explains sub-agent cwd isolation and permission constraints in Claude Code. Guides workflows for bootstrapping projects without write denials outside parent cwd.
npx claudepluginhub avelikiy/great_ctoHow this agent operates — its isolation, permissions, and tool access model
Agent reference
great_cto:agents/-shared/sandbox-cwd-policyThe summary Claude sees when deciding whether to delegate to this agent
**Read this before writing prompts that spawn sub-agents to bootstrap a new project at an arbitrary path.** The constraint described here is part of Claude Code's design — it cannot be worked around in plugin code alone. Sub-agents launched via the `Agent` tool inherit the parent session's **permission grants**, but Claude Code subagents are **isolated** — `additionalDirectories` granted at run...
Guide for Claude Code subagents: explains architecture, delegation model, creation via Markdown YAML frontmatter in .claude/agents/, invocation (@guide or auto), and configuration for tasks like code review, debugging, data analysis.
Creates, improves, and analyzes Claude Code agents following Anthropic best practices. Delegate for explicit requests like 'create agent', 'new agent', 'improve agent', 'fix agent trigger', or 'agent doesn't trigger'.
Expert in Claude Code architecture for creating commands, agents, skills, rules, hooks, and settings. Delegate to build .claude/ structures, YAML frontmatter, prompts, and file formats.
Share bugs, ideas, or general feedback.
Read this before writing prompts that spawn sub-agents to bootstrap a new project at an arbitrary path. The constraint described here is part of Claude Code's design — it cannot be worked around in plugin code alone.
Sub-agents launched via the Agent tool inherit the parent session's
permission grants, but Claude Code subagents are isolated —
additionalDirectories granted at runtime in the parent do not propagate
to the sub-agent.
What this means in practice:
/Users/me/code/proj/ spawns architect → architect
can Write/Bash inside /Users/me/code/proj/ ✅/Users/me/code/proj/ spawns architect and asks it to
Write to /tmp/new-project/ → denied, even if the parent has
additionalDirectories: ["/tmp/new-project"] set ❌Source: code.claude.com/docs/en/permissions
("additional directories grant file access, not configuration. Most
.claude/ configuration is not discovered from additional directories").
The pipeline assumes you are running claude from inside the project root
(or about to be — see /start guard). When that holds, every agent in the
chain (architect → pm → senior-dev → qa → security) writes to cwd, which
is the project root, and everything works.
The constraint shows up only when:
claude from one repo and want to use /start against a
different external path passed as an argument.mkdir ~/code/my-new-saas
cd ~/code/my-new-saas
claude
# inside Claude Code:
/start "B2B billing platform"
cwd === project root. All sub-agents work without per-path grants.
Two options, neither perfect:
A. Inline-mode + parent-side persistence. Tell each sub-agent:
"Bash and Write may be denied for
<target>. Return all artefact bodies inline in your final text response. The harness will persist them."
Parent session reads sub-agent text output and uses its own Write tool to
persist files. This is what the great_cto QA harness does (see
docs/qa/runs/2026-05-09/E2E-SAAS-PIPELINE.md).
B. Pre-grant via .claude/settings.local.json. Run from inside the target:
cd /tmp/new-project
mkdir -p .claude
cat > .claude/settings.local.json <<'EOF'
{
"permissions": {
"additionalDirectories": ["./"]
}
}
EOF
claude
/start "..."
Even this is not guaranteed to propagate to all sub-agents (Claude Code subagent isolation is intentional). Approach A is the safer default.
--cwd parameters for the Agent tool — the public API
doesn't expose one (as of 2026-05).great_cto-j5f (QA-010) tracks the underlying limitation. It will stay
open until either (a) Claude Code adds a propagation mechanism for
additionalDirectories to subagents, or (b) we ship a built-in "harness
mode" wrapper that automates option A above for the standard pipeline.