Inherited flags for spawned teammates

From ychampion/cskill-agents · View interactive version

Inherited flags for spawned teammates is an AI agent skill from the GitHub repository ychampion/cskill-agents. Propagate CLI flags/environment variables from the leader into tmux teammates so they share permission mode, plugins, and env configuration.

How to use this skill

Skill file

SKILL: Inherited Flags For Spawned Teammates

Domain: multi-agent

Trigger: Apply whenever a teammate or tmux-based sub-agent is spawned and it must inherit the parent’s CLI flags and environment to stay aligned.

Source Pattern: Distilled from reviewed multi-agent coordination and child-runtime patterns.

Core Method

Collect the leader’s active CLI options (permission mode, model override, settings path, inline plugins, teammate-mode, chrome override) via buildInheritedCliFlags, rendering them into --flag value strings that the spawned command receives. Parallelly, spool key environment variables (provider overrides, upstream proxy, credential markers) into buildInheritedEnvVars, giving the new process CLAUDECODE=1, CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, and any configured provider/proxy keys so the teammate shares the same backend references. Apply both sets when composing the tmux env + command invocation so the teammate behaves identically to its leader.

Key Rules

Example Application

When a coordinator spawns a tmux teammate for claude backup, reuse this skill by calling the helper functions, appending the resulting --flag arguments and env KEY=VAL string to the tmux new-session command so the teammate shares flags, models, plugins, and upstream proxy configuration.

Anti-Patterns (What NOT to do)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.