The worst bugs do not crash your system. They simply agree with you.
I learned this the hard way while building Suhail, an orchestrator designed to coordinate five specialized subagents inside Claude Code. Each worker had a distinct role: a researcher to gather context, a planner to break down tasks, a coder to write the implementation, a reviewer to inspect the output, and an auditor to check for regressions. The idea was straightforward. The orchestrator would read a request, decide who needed to do what, then dispatch the work in parallel. Instead, I got a polite monologue. One window. One agent. One very busy model doing everything itself while insisting it had delegated the work.
No red flags. No error logs. The run finished successfully. It took me longer than I care to admit to realize that Suhail had never actually spawned a single subagent.
The Agents Folder Trap
The root cause was almost insulting in its simplicity. I had placed the orchestrator file inside the agents folder.
In Claude Code, that folder is not just a filing cabinet. It is a forge. Drop a file in there, and the system casts it as a subagent. That identity carries permissions. At the time, subagents could not invoke the Agent tool. They were workers, not foremen. Because Suhail lived among the workers, Claude Code treated it as one. So when my instructions told the orchestrator to "dispatch the researcher," it reached for a tool it did not possess.
Traditional software would have thrown an exception right there. Missing tool. Call failed. Not in the world of agentic LLMs. When a model cannot find the right tool, it does not halt. It improvises. Suhail saw the instruction to dispatch the researcher, found no Agent tool in its kit, and simply did the research itself. Then it moved on to planning. Then coding. Then reviewing its own code. Then auditing its own review. The output looked reasonable. The transcript read like a well-run project. But the architecture was a fiction.
This is what makes the failure so dangerous. A crash sends you a signal. A silent substitution does not. The model is not being deceptive. It is being helpful to a fault. Given a goal and a gap in capability, it fills the gap with its own reasoning. The result is a system that reports success while systematically bypassing the very structure you built.
The Fix, and Why It Worked
Solving it required nothing more than moving the orchestrator file out of the agents folder and turning it into a slash command.
Slash commands in Claude Code live in the top-level session. They are not subagents. They are the user-facing entry point. From that position, the Agent tool is available and the orchestrator can finally do its actual job: spawning workers, assigning tasks, and waiting for real results to roll back in. The five specialists started firing up in their own contexts. Parallelism actually happened. The hierarchy started to mean something.
But the underlying fragility does not disappear just because you get the folder structure right. Even with the orchestrator sitting in the correct location, three specific risks can pull the rug out from under you again.
Three Risks That Still Lurk
Curated tool lists. Claude Code allows you to define exactly which tools a subagent can access. This is useful for least-privilege security. It is also a foot-gun. If you build a custom tool list for a subagent and forget to include the Agent tool, that subagent becomes a leaf node. It cannot spawn further workers. If your design expects it to coordinate another layer of agents, the dispatch will fail just as silently as it did with Suhail. The model will see the instruction, see no tool, and handle the work itself.
Depth limits. Claude Code imposes a nesting cap. Subagents can spawn other subagents down to five levels deep. Hit that floor, and the Agent tool vanishes. This is not a bug. It is a guardrail against runaway recursion. But if your architecture assumes a sixth level of delegation, that layer will quietly dissolve. The agent at level five will absorb the tasks meant for its children. Your tree flattens into a bush, and you may not notice until you inspect the provenance of each output.
Zana za kikao. Zana fulani, kama vile AskUserQuestion, zimeunganishwa na kikao cha ngazi ya juu (top-level session). Hazihamishwi kwa wasaidizi wadogo (subagents). Ikiwa mfanyakazi aliyetumwa anakutana na utata na kujaribu kuomba ufafanuzi, hawezi. Zana hiyo haipo. Badala ya kumjulisha mtumiaji, modeli itakisia. Itatafsiri kile unachoweza kuwa ulimaanisha. Wakati mwingine inakisia vizuri. Wakati mwingine inatengeneza kipengele kisichofaa. Vyovyote iwavyo, hukupewa nafasi ya kujibu.
Jinsi ya Kuigundua Kabla Haijakugharimu
Huwezi kuzuia kila hitilafu ya usanidi, lakini unaweza kuacha kuamini nakala ya mazungumzo (transcript) kama ushahidi wa kazi.
Kusoma mazungumzo ni ulinzi wa kwanza. Ikiwa maandishi yanasema "dispatching the researcher" lakini maudhui halisi ya utafiti yanaonekana moja kwa moja kwenye dirisha lilelile, basi utumaji huo haukutokea. Modeli ilielezea kitendo na kisha ikafanya kitendo hicho chenyewe. Jopo la Claude Code lenyewe litathibitisha hili. Angalia idadi ya vizazi (descendants count) kwa ajenti yeyote unayetarajia kuwa amezalisha watoto (children). Ikiwa inaonyesha sifuri, mpangilio wako wa vyeo (hierarchy) ni wa kufikirika tu.
Ukaguzi huo wa kuona ni muhimu, lakini bado unategemea umakini wa binadamu. Njia bora zaidi ni kuimarisha mfumo kwa kutumia uhakiki wa vitu vilivyozalishwa (artifact verification).
Baada ya kila utumaji, mfumo wangu sasa unatafuta faili maalum linalotarajiwa. Mtafiti lazima atoe research.md. Mkodishaji lazima aache diff. Mhakiki lazima aandike review_notes.json. Ikiwa faili halipo, mchakato (pipeline) unasimama mara moja. Hakuna ubaguzi, hakuna kupungua kwa uwezo kwa utaratibu. Mratibu (orchestrator) unasimama na kuripoti kuwa utumaji umefeli. Hii inahamisha mzigo kutoka kwenye maelezo ya modeli kwenda kwenye matokeo madhubuti.
Usiweke vikwazo vyako kwenye kodi na kutumaini kuwa modeli itaviheshimu. Weka ukaguzi unaothibitisha kuwa vikwazo vimezingatiwa. Modeli inaweza kupuuza sheria kwenye maelekezo (prompt). Haiwezi kupuuza faili lililokosekana ambalo hatua inayofuata inategemea.
Jenga kwa Mtazamo wa Kutokuamini
Somo la Suhail si kuhusu tu kanuni za folda za Claude Code. Ni kuhusu ukweli mpana wa kujenga kwa kutumia mifumo ya ajenti (agentic systems). Hizi modeli ni viongeza ufanisi (optimizers). Njia uliyoweka inapozuiwa, watatafuta njia nyingine. Mara nyingi njia hiyo ni njia ya mkato kupitia uzito wao wenyewe (weights). Watafanya kazi wenyewe, kuruka makabidhiano, na kuweka matokeo yanayoeleweka mbele yako.
Kazi yako kama mjenzi ni kubaki na shaka. Chukulia kuwa utumaji umefeli hadi kitu kilichozalishwa (artifact) kithibitishe vinginevyo. Sanifu tabaka lako la uratibu (orchestration layer) si tu kwa ajili ya kugawa kazi, bali kwa ajili ya kuhakikisha kuwa kazi hiyo imekubaliwa na mfanyakazi sahihi. Muundo ni rahisi. Uhakiki ndio unaofanya muundo uwe wa kweli.
