Context Engineering Template is a repository of instructions, examples, workflows, and validation practices that give AI coding assistants the information they need to complete software tasks. It is for developers working with Claude Code or other coding assistants, and the catalogue entries package parts of its workflow as commands, agents, instructions, and a skill.
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.
git clone --depth 1 https://github.com/coleam00/context-engineering-introWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/coleam00/context-engineering-intro/handoff)<a href="https://agentmods.dev/commands/coleam00/context-engineering-intro/handoff"><img src="https://agentmods.dev/badge/commands/coleam00/context-engineering-intro/handoff/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/coleam00/context-engineering-intro/handoff"><img src="https://agentmods.dev/badge/commands/coleam00/context-engineering-intro/handoff.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00012 | $0.01039 |
| Opus 5.5 | $0.00005 | $0.00416 |
| Sonnet 5.5 | $0.00002 | $0.00208 |
| Haiku 4.5 | $0.00001 | $0.00104 |
Grade A, and why
handoff 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 1mo 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.
This is a copy
100% identical to handoff — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Handoff: Capture Session State for Continuation
Objective
Create a structured handoff document that captures everything the next session (or agent) needs to seamlessly continue this work. This is the Write + Compress pattern — you're externalizing the session's memory into a persistent file AND compressing it into just the essentials.
When to Use
- Before ending a long session where work will continue later
- Before hitting context limits (proactive, not reactive)
- When switching from one phase to another (research → implementation)
- When handing off between human and AI, or between AI sessions
- Instead of relying on
/compactfor critical ongoing work
Process
1. Analyze the Current Session
Review everything that happened in this conversation:
- What was the original goal or task?
- What has been completed so far?
- What is still in progress or blocked?
- What key decisions were made and WHY?
- What files were read, created, or modified?
- What errors were encountered and how were they resolved?
- What dead ends were explored (so the next session doesn't repeat them)?
2. Gather Current State
git status
git diff --stat HEAD
git log --oneline -5
git branch --show-current
3. Write the Handoff Document
Save to: HANDOFF.md in the current working directory (or the worktree root if in a worktree).
Use this exact structure:
# Handoff: [Brief Task Description]
**Date:** [current date]
**Branch:** [current branch name]
**Last Commit:** [hash + message, or "uncommitted changes"]
## Goal
[1-2 sentences: what we're trying to accomplish. Include the original user request or plan reference.]
## Completed
- [x] [Task 1 — brief description of what was done]
- [x] [Task 2 — brief description]
- [Sub-detail if non-obvious]
## In Progress / Next Steps
- [ ] [Task 3 — what needs to happen next, with enough detail to act on]
- [ ] [Task 4 — include file paths and specific areas to focus on]
- [ ] [Task 5 — any blocked items with explanation of the blocker]
## Key Decisions
Document WHY choices were made, not just what was chosen:
- **[Decision]**: [What was chosen] — [Why, including alternatives rejected]
- **[Decision]**: [What was chosen] — [Why]
## Dead Ends (Don't Repeat These)
- [Approach that was tried and didn't work] — [Why it failed]
- [Investigation path that turned out to be irrelevant] — [What we found instead]
## Files Changed
- `path/to/file.ts` — [what changed and why, 1 line]
- `path/to/new-file.ts` — [NEW: what this file does]
- `path/to/deleted-file.ts` — [DELETED: why it was removed]
## Current State
- **Tests:** [passing/failing — which specific tests and why]
- **Type-check:** [clean/N errors — what kind]
- **Lint:** [clean/N warnings — what kind]
- **Build:** [working/broken]
- **Manual verification:** [what was tested manually, results]
## Context for Next Session
[2-4 sentences: the MOST IMPORTANT thing the next agent needs to know. What's the current situation? What's the biggest risk? What should they do first?]
**Recommended first action:** [Exact command or step to take first]
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.
- 1mo ago First seen · 134 lines · 12 tokens per session scan A bb5f16ae13e8
handoff is a command published in the GitHub repository coleam00/context-engineering-intro (13,880 stars, last pushed 7mo ago), licensed MIT. It adds 12 tokens to every session and 1,039 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to handoff, differing in 0 lines, and is treated as a copy.
Other commands, from other repositories
minutes-ideas
Surface recent voice memos and ideas captured from any device. Use when the user asks "what ideas did I have?", "what were my recent memos?", "what did I record while walking?", or wants to recall a captured thought.
learn
Force claude-smart to extract learnings from this session now.
memory-store
Store an insight, decision, or pattern to memory.
analyze-context
USE WHEN you want to analyze project context before starting work on a task. Calls context + recall, then synthesizes goals, decisions, gotchas, and relevant memories into a pre-task brief.
cc-memory
Configure persistent memory that survives across sessions using a layered approach: split rule files for always-loaded context, auto-memory for organic learning, and optional MCP-backed long-term memory for large codebases.
lians-recall
Recall current (non-stale) facts from Lians memory, optionally as-of a past date.