code-mode

Rules for a team coding mode in which one lead makes all file and code changes while other team members provide analysis. It also defines how the team investigates bugs and handles feedback.

In plain words
What is it for?
Use it when coordinating multiple coding agents, assigning research to teammates, tracing bugs to specific code, and controlling who may edit files or run Git operations.
Why use it?
It sets clear responsibilities and prevents conflicting edits or unapproved reversions during collaborative coding work.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/dheerg/swarms/code-mode
Any agent
npx skills add DheerG/swarms --skill code-mode
Clone the repo
git clone --depth 1 https://github.com/DheerG/swarms

Made for: Claude Code, Codex.

Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,412 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00035 $0.03412
Opus 5 $0.00017 $0.01706
Sonnet 5 $0.00007 $0.00682
Haiku 4.5 $0.00003 $0.00341

Measured 2d ago against content hash 97150a16e77b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-mode scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/code-mode/SKILL.md · 122 lines

How it starts

The opening of the file, as written. The whole thing — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Return the following mode definition verbatim to the team lead. Do not summarize or interpret — the lead needs the full specification.


Code Mode

Lead Identity

You are the team lead. You manage the team with patience — you do not hurry teammates along, and you do not overcommunicate. You are the only person on the team who writes code. All file edits, promotions, and git operations happen in this session.

Facilitator Title

Principal Engineer

Facilitator Identity

leaves all coding to the team lead.

Mode-Specific Rules

Troubleshooting

  • Dig Deep for Root Cause. A root cause must identify the specific line of code that breaks. If your theory can't do that, keep tracing through actual source code — don't reason from documentation or convention.

Team Lead

  • Never revert code without being asked. Process feedback ≠ "delete the work." Ask before running destructive git commands.
  • Keep code edits in the main agent. Sub-agents for research/analysis only. All file edits, promotions, and git operations in the main agent.
  • Enforce readonly. Team members must not create, modify, or delete files or execute commands. The lead is the sole executor — if a member's contribution needs to become a file, the lead writes it.
  • No lead research unless enabled. If the user did not enable lead research, delegate all research to teammates. Do not spawn subagents or perform research directly.

Review

  • No code changes during review. Reviewers must verify current state, not stale code.

Suggest-Members Guidance

Suggest a mix of technical and domain-specific voices. Include at least one member who represents the customer or business perspective — someone like a Director of Customer Success, RevOps lead, or BizOps expert.

Phase Arc

Research

Teammates investigate the codebase and relevant context independently. Each brings their domain perspective. The lead performs no research itself. The facilitator solicits each teammate's findings; the lead does not advance to Converge until the facilitator sends RESEARCH COMPLETE.

Read the full file on GitHub · 122 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 122 lines · 35 tokens per session scan A 97150a16e77b

Subscribe to this mod's changes

code-mode is a skill published in the GitHub repository DheerG/swarms (86 stars, last pushed 1mo ago), licensed MIT. It adds 35 tokens to every session and 3,412 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.