SKILL · context-engineering

Skill: structured note-taking

A skill that has the agent maintain a NOTES.md outside the context window during long tasks: progress, dependencies, and decisions survive compaction instead of dissolving with the transcript.

✓ verified 2026-07-18 · stack: claude-code · source

Long tasks outlive context windows. Anthropic’s context-engineering guidance names the countermeasure: the agent “regularly writes notes persisted to memory outside of the context window”, keeping “critical context and dependencies that would otherwise be lost across dozens of tool calls” and enabling “long-horizon strategies that would be impossible when keeping all the information in the LLM’s context window alone” (effective context engineering). This skill turns that habit into a procedure the agent follows without being reminded.

.claude/skills/take-notes/SKILL.md
---
description: Maintain NOTES.md during multi-step tasks. Use at the start
of any task likely to span many tool calls or risk compaction, after
each milestone, and immediately after any surprising discovery.
---
Maintain ./NOTES.md as the task's external memory. The transcript is
disposable; NOTES.md is not.
## When to write
- At task start: restate the goal in one line and list the known
constraints.
- After completing each milestone: one line, what changed, where.
- Immediately when you discover something surprising: a hidden
dependency, a failing assumption, a config that contradicts the docs.
Surprises are the notes that matter most after a context reset.
- Before any risky or long operation: record the plan so a fresh context
can tell intent from accident.
## Structure (keep these four headings, nothing else)
# Task
One line: what done looks like.
# State
Checklist of milestones, ticked as they land. The next unticked item is
always the next action.
# Discoveries
Dated one-liners. Facts about THIS repo/session that no doc states:
"the staging config overrides X", "test A fails without service B".
# Decisions
Choices made and the reason, one line each. What a reviewer or a resumed
session would otherwise re-litigate.
## Rules
- One line per entry; NOTES.md is an index, not a journal. Move anything
longer into the relevant file or the PR description.
- Update by editing in place; never append a second copy of a heading.
- On resuming any session: read NOTES.md FIRST, trust it over memory of
the transcript, and reconcile it against the actual tree before acting.
- Delete NOTES.md when the task ships; stale notes mislead the next task.

What it does

  • Makes note-taking event-driven rather than mood-driven: task start, milestone, surprise, and pre-risk are the four triggers, so the file exists precisely when a compaction or reset would otherwise hurt.
  • The four fixed headings keep the file scannable at reload: the next action falls out of State, and Discoveries carries the repo facts that cost tool calls to re-derive.
  • The “surprises first” rule encodes what the guidance’s worked example shows (agents keeping tallies, maps, and strategy notes): the notes worth externalising are the ones no document already states.
  • The delete-on-ship rule keeps NOTES.md a task artifact rather than a shadow documentation system that drifts.

Failure modes

  • Notes are context, twice. The file costs tokens to write and to re-read; the one-line rule is the budget. If NOTES.md grows past a screen, it has become a journal and needs pruning, not appending.
  • A stale State section is worse than none. A resumed session trusts the checklist; an unticked completed item causes duplicated work, a ticked incomplete one causes false confidence. The reconcile-on-resume rule exists for exactly this.
  • Committed notes leak. NOTES.md is working memory and may name internal hosts or half-formed judgements; add it to .gitignore unless the team explicitly wants task notes in history.
  • This complements, not replaces, auto memory. Claude Code’s auto memory persists per-repository learnings across sessions on its own schedule; NOTES.md is per-task and deliberate. The compaction pattern covers how the two interact under context pressure.

Verified against the structured note-taking guidance and its worked example at anthropic.com/engineering/effective-context-engineering-for-ai-agents, 2026-07-18.