Handoff Pill
A pill is a context transfer artifact. The receiving chat starts with zero
memory of this one and a fresh container: every file built here is gone,
every lesson unlearned, every correction the user made forgotten. The pill's
one job is to make re-derivation unnecessary. It is written for the next
Claude, not for a human reader.
There are two modes. GENERATE when the user asks for a pill. INGEST when a
pill arrives at the start of a chat.
What is expensive to lose (priority order for what goes in)
- Root causes of solved problems. A bug that cost hours to diagnose costs
hours again in the next chat if only the fix is recorded. Symptom, root
cause, fix: all three, every time.
- Environment sharp edges. Constraints of the working environment that were
learned by violating them (timeouts, quotas, tool quirks, things that
silently fail). These are invisible until they bite.
- The user's standing directives. Every correction they made about how to
work, at the strength they meant it. A preference stated once in chat 1
and forgotten in chat 2 will be restated with less patience.
- Exact current state. Version strings, sizes, paths, commands, numbers as
of the end of this chat. The pill supersedes older documents; where it
corrects one, say so.
- Open threads. Decisions pending, questions asked but not yet answered by
the user, work in flight at the moment of generation.
Cheap to lose, so leave out: prose explanation, anything re-derivable from
public documentation, the conversational back and forth, dead ends that
taught nothing.
GENERATE mode
Step 1: Inventory the chat
Walk the whole conversation and collect, into working notes:
- Project identity: what is being built or done, current version or state.
- Load-bearing decisions and the reasoning that earned them.
- Artifacts produced: files, documents, packages, where each lives NOW and
which exist only outside the chat (delivered downloads, the user's disk,
a repo).
- Working procedures: build chains, test commands, workflows, exact
invocations that are known to work.
- Every non-obvious problem solved: symptom, root cause, fix.
- Environment constraints discovered the hard way.
- Every instruction or correction the user gave about how to work.
- What was in flight and what is undecided at this moment.
- The agreed next steps.
Step 2: Write the pill
Read references/pill-template.md and follow its section order. Section
names may flex to fit the domain (a writing project has "drafts and
versions" where an OS project has "build chain") but every section's spirit
must be served or its absence justified.
Rules that make a pill work
- Write telegraphic and exact. Reference-manual density, not narrative.
The reader is a model with the pill in context; it does not need to be
persuaded, it needs to be loaded.
- Operational facts come first, right after the header. State plainly what
does not cross the chat boundary and exactly which files the user must
re-upload for which kinds of work. Name the files. This is the single
most load-bearing section: without it the next chat confidently attempts
work it cannot do.
- Never omit failures to look clean. The casebook of solved problems is
the highest-value cargo in the pill.
- Quote the user's directives at their intended strength ("never X",
"always Y"), and mark which apply to all future work versus this project.
- Record open questions verbatim, including ones the user has not answered,
so the next chat can re-ask instead of guessing.
- No secrets, ever. Keys, tokens, passwords, personal identifiers, and
anything the user would not commit to a public repo stay out, because
pills get committed to public repos. If a credential matters
operationally, describe where it lives ("API key stored on the machine at
path P"), never its value.
- Date the pill, name the source chat, and list the sources it was written
from (the live conversation, delivered artifacts, prior documents).
- Regenerate from the live chat at each milestone, not only at the end;
a chat can hit its limit mid-task. When a prior pill exists, write the
new one from the current conversation and diff against the old pill for
anything real that would otherwise be lost; never chain pill-from-pill
without checking against reality, because errors compound.
Quality gate: the resume test
Before delivering, ask: could a fresh Claude holding only this pill, plus
the uploads it names as required, continue the work without asking the user
to re-explain anything? Walk each planned next step and check the pill
answers the questions that step raises. If any step would force a question
back to the user, the pill is not done.
Delivery
One markdown file, named <PROJECT>_HANDOFF_PILL.md, delivered as a file
the user can download. Typical size is 150 to 400 lines; heavy engineering
chats justify up to about 600. Past that, split bulk reference material into
a companion file and keep the pill as the dense index that points to it.
Tell the user in one or two lines what the pill carries and what they must
upload alongside it next time. Do not paste the whole pill into the chat.
INGEST mode
When a pill is uploaded or pasted at the start of a chat:
- Read the entire pill before responding to anything else.
- Confirm state back to the user in a few lines: the project, its current
version or state, what was in flight, and the open questions awaiting
their answer. This proves the load and surfaces staleness immediately.
- Adopt the standing directives section as if the user had typed those
instructions in this chat.
- If the requested work needs artifacts the pill lists as required uploads
and they are not present, ask for exactly those files by name before
attempting the work.
- Treat the pill as the most current source. Where it conflicts with an
older document also in context, prefer the pill and flag the conflict in
one line rather than silently picking.
- Do not re-verify or re-derive what the pill states as settled unless
evidence in the new chat contradicts it.
1---2name: handoff-pill3description: Generate a handoff pill, a single dense markdown file that carries a long chat's full context, decisions, solved problems, and the user's working directives into a fresh chat. Use whenever the user says pill, handoff pill, context pill, or ingestible pill; asks to package, transfer, or hand off this conversation to a new chat; says the chat is getting too long or slow and wants to continue elsewhere without losing context; or asks to distill the session's learnings into a portable file. Also use in reverse, whenever a file named like *_PILL.md or *HANDOFF*.md is uploaded or pasted at the start of a chat, by following this skill's ingestion protocol before doing anything else.4---56# Handoff Pill78A pill is a context transfer artifact. The receiving chat starts with zero9memory of this one and a fresh container: every file built here is gone,10every lesson unlearned, every correction the user made forgotten. The pill's11one job is to make re-derivation unnecessary. It is written for the next12Claude, not for a human reader.1314There are two modes. GENERATE when the user asks for a pill. INGEST when a15pill arrives at the start of a chat.1617## What is expensive to lose (priority order for what goes in)18191. Root causes of solved problems. A bug that cost hours to diagnose costs20 hours again in the next chat if only the fix is recorded. Symptom, root21 cause, fix: all three, every time.222. Environment sharp edges. Constraints of the working environment that were23 learned by violating them (timeouts, quotas, tool quirks, things that24 silently fail). These are invisible until they bite.253. The user's standing directives. Every correction they made about how to26 work, at the strength they meant it. A preference stated once in chat 127 and forgotten in chat 2 will be restated with less patience.284. Exact current state. Version strings, sizes, paths, commands, numbers as29 of the end of this chat. The pill supersedes older documents; where it30 corrects one, say so.315. Open threads. Decisions pending, questions asked but not yet answered by32 the user, work in flight at the moment of generation.3334Cheap to lose, so leave out: prose explanation, anything re-derivable from35public documentation, the conversational back and forth, dead ends that36taught nothing.3738## GENERATE mode3940### Step 1: Inventory the chat4142Walk the whole conversation and collect, into working notes:4344- Project identity: what is being built or done, current version or state.45- Load-bearing decisions and the reasoning that earned them.46- Artifacts produced: files, documents, packages, where each lives NOW and47 which exist only outside the chat (delivered downloads, the user's disk,48 a repo).49- Working procedures: build chains, test commands, workflows, exact50 invocations that are known to work.51- Every non-obvious problem solved: symptom, root cause, fix.52- Environment constraints discovered the hard way.53- Every instruction or correction the user gave about how to work.54- What was in flight and what is undecided at this moment.55- The agreed next steps.5657### Step 2: Write the pill5859Read `references/pill-template.md` and follow its section order. Section60names may flex to fit the domain (a writing project has "drafts and61versions" where an OS project has "build chain") but every section's spirit62must be served or its absence justified.6364### Rules that make a pill work65661. Write telegraphic and exact. Reference-manual density, not narrative.67 The reader is a model with the pill in context; it does not need to be68 persuaded, it needs to be loaded.692. Operational facts come first, right after the header. State plainly what70 does not cross the chat boundary and exactly which files the user must71 re-upload for which kinds of work. Name the files. This is the single72 most load-bearing section: without it the next chat confidently attempts73 work it cannot do.743. Never omit failures to look clean. The casebook of solved problems is75 the highest-value cargo in the pill.764. Quote the user's directives at their intended strength ("never X",77 "always Y"), and mark which apply to all future work versus this project.785. Record open questions verbatim, including ones the user has not answered,79 so the next chat can re-ask instead of guessing.806. No secrets, ever. Keys, tokens, passwords, personal identifiers, and81 anything the user would not commit to a public repo stay out, because82 pills get committed to public repos. If a credential matters83 operationally, describe where it lives ("API key stored on the machine at84 path P"), never its value.857. Date the pill, name the source chat, and list the sources it was written86 from (the live conversation, delivered artifacts, prior documents).878. Regenerate from the live chat at each milestone, not only at the end;88 a chat can hit its limit mid-task. When a prior pill exists, write the89 new one from the current conversation and diff against the old pill for90 anything real that would otherwise be lost; never chain pill-from-pill91 without checking against reality, because errors compound.9293### Quality gate: the resume test9495Before delivering, ask: could a fresh Claude holding only this pill, plus96the uploads it names as required, continue the work without asking the user97to re-explain anything? Walk each planned next step and check the pill98answers the questions that step raises. If any step would force a question99back to the user, the pill is not done.100101### Delivery102103One markdown file, named `<PROJECT>_HANDOFF_PILL.md`, delivered as a file104the user can download. Typical size is 150 to 400 lines; heavy engineering105chats justify up to about 600. Past that, split bulk reference material into106a companion file and keep the pill as the dense index that points to it.107Tell the user in one or two lines what the pill carries and what they must108upload alongside it next time. Do not paste the whole pill into the chat.109110## INGEST mode111112When a pill is uploaded or pasted at the start of a chat:1131141. Read the entire pill before responding to anything else.1152. Confirm state back to the user in a few lines: the project, its current116 version or state, what was in flight, and the open questions awaiting117 their answer. This proves the load and surfaces staleness immediately.1183. Adopt the standing directives section as if the user had typed those119 instructions in this chat.1204. If the requested work needs artifacts the pill lists as required uploads121 and they are not present, ask for exactly those files by name before122 attempting the work.1235. Treat the pill as the most current source. Where it conflicts with an124 older document also in context, prefer the pill and flag the conflict in125 one line rather than silently picking.1266. Do not re-verify or re-derive what the pill states as settled unless127 evidence in the new chat contradicts it.