Module 5: Sub-Agents and Skills

MGMT 675: Generative AI for Finance

Kerry Back, Rice University

Sub-Agents

What Is a Sub-Agent?

When Claude Code handles a complex task, it can spin up sub-agents — separate Claude instances that work on subtasks in parallel or in sequence, then report back.

Orchestrator

  • The main Claude session you are talking to
  • Breaks the task into pieces
  • Delegates to sub-agents and synthesizes results

Sub-Agent

  • A fresh Claude instance with its own context
  • Receives a specific subtask and tools
  • Returns its result to the orchestrator

Sub-agents allow Claude to work in parallel and to keep each subtask focused — the orchestrator stays high-level while sub-agents do the detailed work.

Spontaneous Sub-Agents

Claude Code decides on its own when a task warrants sub-agents. You do not have to ask.

  • Parallel research: fetching data from multiple sources simultaneously
  • Multi-file analysis: reviewing several documents at once and comparing findings
  • Iterative workflows: one agent drafts, another critiques, another revises
  • Long computations: splitting a large dataset across agents to stay within context limits

You will see a notice when Claude spawns a sub-agent.

Requesting a Sub-Agent

You can explicitly ask Claude to use a sub-agent for any task:

  • “Use a sub-agent to research competitor pricing and report back.”
  • “Spawn a sub-agent to review this code for bugs while you work on the next feature.”
  • “Use three parallel sub-agents to analyze each of these three reports, then summarize.”

Context Windows

An LLM can only “see” a finite amount of text at once — this limit is called its context window.

Your Conversation

  • Every message you send includes the full conversation history — all prior prompts and replies
  • This is how the LLM remembers what you said earlier
  • Long conversations gradually consume the context window

Sub-Agent Conversations

  • Each sub-agent starts with a fresh context window
  • It only receives what the orchestrating agent decides to pass — a task description, relevant files, or specific data
  • It does not see your full conversation history

This is a feature, not a bug — sub-agents stay focused on their subtask and don’t waste context on irrelevant history.

Claude Skills

Built-In Document Skills

Anthropic provides three document skills: Excel, Word, and PowerPoint.

Claude Desktop (Chat, Cowork, and Code)

  • Skills are stored in the cloud by Anthropic
  • No setup required — available automatically
  • Invoke with /xlsx, /docx, /pptx

Claude Code Terminal

  • Skills must be installed locally into ~/.claude/skills/
  • The class installer handles this automatically
  • Invoke with /xlsx, /docx, /pptx

In Claude Code (CLI or Desktop Code tab), invoke skills explicitly: /xlsx, /docx, /pptx

The /xlsx Skill

In Claude Code, skills are plain text files stored in ~/.claude/skills/. You can read the full /xlsx skill at:

It instructs Claude to use live Excel formulas instead of hardcoded values, specifies a standard workflow (create, format, save, recalculate, verify), and includes financial modeling standards.

Skill Creator

The class installer also installs /skill-creator — a guide created by Anthropic for building your own skills.

  • Generates the skill definition file
  • Installs the skill so it appears as a / command

Customizing a Built-In Skill

If you use Claude Desktop/Code, you cannot edit Anthropic’s document skills directly — but you can create a custom skill that extends one.

Your SKILL.md would say something like:

“Follow the /xlsx skill workflow exactly, EXCEPT: always include a summary sheet as the first tab, always freeze the header row, and always name ranges used in formulas.”

Then invoke your custom version with /myxlsx instead of /xlsx.

Ask Claude to create it for you. Use /skill-creator I want a skill that will override the xlsx skill so that …

Example: Create a Tasks Skill

  1. Type /skill-creator to start the skill builder
  2. Describe what you want: I want to keep track of pending tasks in these categories: …
  3. Let Claude generate and install the skill
  4. Test it: “/tasks Add: finish DCF exercise, due Tuesday”
  5. Test it: “/tasks What’s pending?”