Cold Email Sequence Drafter
MIT↓ 0 downloadsA single Claude Code agent reads your offer and ideal-customer notes and writes a complete 5-touch cold email sequence — subject-line options, tight bodies, send timing, one clear CTA per email, and personalization tokens ready to merge at send time.
Topology
Disclosures
Everything below runs on your machine or inside the sandbox when you use this workflow. Mismatches between these declarations and the actual code block publishing.
Host hooks
Commands executed on YOUR host machine by Sandcastle lifecycle hooks.
None declared.
Sandbox hooks
Commands executed inside the sandbox container.
None declared.
Network access
None. The agent operates only on the local repository inside the sandbox.
Shell expansion
No shell-expansion blocks in prompt files.
Files
Diff vs the stock Sandcastle 0.12.0 template Dockerfile — green lines were added by the author, red lines were removed from stock.
+# Sandbox image for the Cold Email Sequence Drafter workflow.+# Mirrors the stock Sandcastle template: Node 22, git, and the Claude Code CLI,+# running as a non-root `agent` user. Pure text — no project runtime needed.FROM node:22-bookworm# System dependencies.RUN apt-get update && apt-get install -y --no-install-recommends \git \curl \jq \ca-certificates \&& rm -rf /var/lib/apt/lists/*# Claude Code CLI (the agent runtime).RUN npm install -g @anthropic-ai/claude-code# Non-root agent user. `sandcastle docker build-image` aligns AGENT_UID/GID to# the host user via --build-arg to avoid permission errors on bind mounts.ARG AGENT_UID=1000ARG AGENT_GID=1000RUN groupadd --gid ${AGENT_GID} agent \&& useradd --uid ${AGENT_UID} --gid ${AGENT_GID} --create-home --shell /bin/bash agentUSER agentWORKDIR /workspace
Show full Dockerfile (highlighted)
# Sandbox image for the Cold Email Sequence Drafter workflow.
# Mirrors the stock Sandcastle template: Node 22, git, and the Claude Code CLI,
# running as a non-root `agent` user. Pure text — no project runtime needed.
FROM node:22-bookworm
# System dependencies.
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
curl \
jq \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Claude Code CLI (the agent runtime).
RUN npm install -g @anthropic-ai/claude-code
# Non-root agent user. `sandcastle docker build-image` aligns AGENT_UID/GID to
# the host user via --build-arg to avoid permission errors on bind mounts.
ARG AGENT_UID=1000
ARG AGENT_GID=1000
RUN groupadd --gid ${AGENT_GID} agent \
&& useradd --uid ${AGENT_UID} --gid ${AGENT_GID} --create-home --shell /bin/bash agent
USER agent
WORKDIR /workspace
# Auth for the Claude Code agent.
# Run `claude setup-token` on your host to generate a token, then paste it here
# in your local .sandcastle/.env (never commit the real .env).
CLAUDE_CODE_OAUTH_TOKEN=
import { run, claudeCode } from "@ai-hero/sandcastle";
import { docker } from "@ai-hero/sandcastle/sandboxes/docker";
// A single Claude Code (Opus) agent, one pass. It reads icp.md and offer.md from
// the repository, then writes a full 5-touch cold email sequence. Pure text — no
// dependencies to install, no network, no hooks. The default `head` branch
// strategy commits the sequence directly onto the current branch.
const result = await run({
name: "cold-email-sequence",
agent: claudeCode("claude-opus-4-8", { effort: "high" }),
sandbox: docker({ imageName: "sandcastle:cold-email-sequence" }),
promptFile: ".sandcastle/prompt.md",
maxIterations: 1,
});
console.log(`Wrote the sequence in ${result.commits.length} commit(s) on ${result.branch}.`);
Write a 5-touch cold email sequence
You are a senior outbound copywriter who has booked thousands of meetings with cold email. You write short, human, specific emails that get replies — not templated spray-and-pray. Your job is to write a complete 5-touch sequence.
Source of truth
Read these two files in the repository root:
offer.md— what the product does, the concrete outcome it delivers, proof points, differentiation, and pricing/next step.icp.md— the ideal customer: role/title, company profile, the pain they feel, the trigger events worth referencing, and the objections they'll raise.
Everything you write must be grounded in these files. Do not invent metrics,
customer names, or claims that aren't supported. Where a specific detail (a
company name, a metric, a trigger) would go, use a clearly marked personalization
token like {{first_name}}, {{company}}, {{trigger}}, or {{metric}} so the
sender fills it at send time.
Principles for cold email that actually works
- Relevance over volume. Open with something about them, not about you. The first line must prove this isn't a blast. Lead with a trigger or an observation, never "I hope this email finds you well" or "My name is…".
- One idea, one ask. Each email makes a single point and has exactly one clear CTA. The CTA is low-friction — an interest-check question ("worth a look?"), not "book a 30-minute demo" on touch one.
- Sell the outcome, not the feature. Talk about the result the ICP gets and the pain it removes, in their language.
- Short. Aim for 50–125 words per email. It should be readable in one glance on a phone. Cut every sentence that doesn't move the reader toward a reply.
- No hype, no jargon, no fake urgency. Sound like one busy person emailing another. Plain words. No exclamation-point energy.
- Each touch adds a new angle — don't just "bump" the thread. Rotate through: (1) trigger + core outcome, (2) a specific proof point / mini case, (3) a different pain or a common objection reframed, (4) a short value-add or resource with no ask beyond a reply, (5) a respectful, low-pressure break-up that leaves the door open.
Output
Write the full sequence to outreach/sequence.md. For each of the 5 emails
include:
- Send timing (e.g. Day 0, Day 3, Day 7, Day 12, Day 18) and a one-line note on the purpose of that touch.
- Three subject-line options — short, lowercase-friendly, curiosity or relevance driven, no clickbait, no "RE:" fakery.
- The body, using the personalization tokens above.
- The single CTA on its own line.
Add a short ## How to use section at the top listing every personalization
token you used and what to fill each with. Then commit outreach/sequence.md.
README
Cold Email Sequence Drafter
Most cold sequences fail the same way: they open by talking about the sender, cram three asks into one email, and hide the outcome behind feature-speak. This workflow writes the opposite — five short, relevant, human touches that read like one busy person emailing another, from a single pass over your own notes.
What it does
You keep two short files in your repo:
offer.md— what you sell, the concrete outcome it delivers, your proof, your differentiation, and the next step.icp.md— who you're targeting: their role, company profile, the pain they feel, the trigger events worth referencing, and the objections they'll raise.
A Claude Code (Opus) agent reads both and writes a complete 5-touch sequence
to outreach/sequence.md. Each email gets send timing and a stated purpose,
three subject-line options, a tight 50–125 word body, and exactly one
low-friction CTA. Every touch adds a new angle — trigger, proof point,
objection reframe, value-add, respectful break-up — instead of just bumping the
thread. Personalization tokens like {{first_name}}, {{company}}, and
{{trigger}} are left in place, with a legend at the top telling you what to
fill each with at send time.
How it works
main.ts runs one agent for a single pass (maxIterations: 1) inside a Docker
sandbox, committing the sequence to the current branch. The topology is a single
node: read offer + ICP → 5-touch sequence. It is pure text — no dependencies
to install, no network access, no hooks, and nothing invented that isn't
supported by your offer.md and icp.md.
Requirements
Set CLAUDE_CODE_OAUTH_TOKEN in .sandcastle/.env (run claude setup-token).
Add offer.md and icp.md to your repo root. Build the image once with
npx @ai-hero/sandcastle docker build-image, then run
npx tsx .sandcastle/main.ts. Your sequence lands at outreach/sequence.md,
ready to drop into your sending tool once you fill the tokens.