Job handover document from scattered notes, with a gap check
Turn 25 scattered notes into a handover draft without letting the model invent dates. Number the notes, then use a script to count unused notes and new dates.
"Write a job handover document for my successor from the notes below." Asked that way three times, the model put ~Dec 15 on the water filter line all three times. The notes only said "replaced every 3 months, last done Sep 15". The model added three months. In a handover document, a date in the schedule reads as fact to the person who inherits it. Asking only for "recurring tasks, work in progress, contacts and deadlines" gave a next date in three of three runs (Dec 15, mid-December). Across those six runs, five turned "the 5th of every month" into a dated row such as Nov 5, and five added a Prepared 2026-10-21 line that the notes never mention.
Below: number the notes, make the model park what it does not know under "Needs confirmation" instead of filling it in, and let a script count unused notes and new dates.
[1] Save the notes one per line. They are 25 lines (10 shown here) from an imagined office administrator about to move teams, with no accounts or passwords. Recurring tasks, open work, contacts and expiry dates are mixed together, and one line (No company vehicles) is not a task at all.
Company card statement reconciled on the 5th of every month, receipts go to AccountingCopier lease ends Dec 31, decide on renewal during NovemberCopier vendor contact direct line 555-0142, toner swapped at the monthly visitFire inspection planned for the second week of November, visit time not fixed yetEmergency contact list refreshed every quarter, next one early DecemberWater dispenser filter replaced every 3 months, last done Sep 15Old monitors, 8 of them, need a disposal request filed by end of NovemberClub subsidy forms collected each quarter and sent to Finance, next due Dec 10Video conference gear checked twice a year, last time in JuneNo company vehicles…[2] Number the lines.
$ awk '{printf "%d. %s\n",NR,$0}' notes.en.txt > notes.en.num.txt[3] Build the prompt. Instructions go in <instructions> and the notes in <notes>. Anthropic's guidance on structuring prompts with XML tags recommends exactly this split. Three rules matter: a note number on every item, nothing that is not in the notes (list it under section 5 instead), and every note lands in sections 1-4 or in section 6 with a reason.
<instructions>Write a job handover document for the successor from the numbered notes in <notes>.Use these six sections:1. Recurring tasks (by frequency)2. Work in progress3. Contacts4. Deadlines and expiry dates5. Needs confirmation6. Notes left out Rules:- End every item with the supporting note number(s) in the form [3] or [3,7]. Do not write an item without a number.- Do not write procedures, methods, reasons, numbers, dates or names that are not in the notes. Do not calculate new dates.- If the successor needs something that the notes do not say, list it in section 5 as '[Needs confirmation] what is unknown'. The number is the note that raised the question.- Every note goes into sections 1-4, or into section 6 as 'number: reason'.- Do not write accounts or passwords.- Use only section titles and bullet points. Add no other commentary.</instructions> <notes>[4] Append the numbered notes and run it three times.
$ { cat head.en.txt notes.en.num.txt; echo "</notes>"; } > prompt.en.txt$ claude -p --model claude-sonnet-5-5 --max-turns 1 --tools "" --setting-sources "" --strict-mcp-config < prompt.en.txt > out.en.1.txtThe first result (the middle of section 1 and all of sections 2 and 4 are cut; the original covers all 25 notes):
## 1. Recurring tasks (by frequency)- Weekly (Monday morning): sort the mail; registered items get logged in the receipt book [5]- Monthly (5th): reconcile the company card statement; receipts go to Accounting [1]…- Every 3 months: replace the water dispenser filter; last done Sep 15 [10]… ## 3. Contacts- Copier vendor, direct line 555-0142 [4]- Building office: Ms. L, extension 2207 [14] ## 5. Needs confirmation- [Needs confirmation] Fire inspection visit time and who attends [7]- [Needs confirmation] Who decides on the copier lease renewal and what the options are [3]- [Needs confirmation] How and where to file the monitor disposal request [19]- [Needs confirmation] How the successor receives the credentials for meeting room booking admin rights [6]- [Needs confirmation] Next replacement date for the water dispenser filter; notes only give the last date [10]- [Needs confirmation] Next check date for the video conference gear; notes only give the last time [22]- [Needs confirmation] Which vendor and what process to use for the stationery order [2]- [Needs confirmation] Which vendor and who supplies the content for the business card batch [11]- [Needs confirmation] Who the contacts are in Accounting, Finance and IT [1,20,15]- [Needs confirmation] Venue shortlist details, budget and decision date for the year-end party [16]- [Needs confirmation] Whether the caterer switch is to be revisited and when [21] ## 6. Notes left out- 6: login details are not written in this document; they are passed on separately [6]- 24: states there are no company vehicles; no task or action attached [24]The filter line carries only the last date, and the missing next date is listed under Needs confirmation. Nothing was added.
[5] Write the checking script. It reports notes that appear in none of sections 1-4 or 6, items whose note number is missing or out of range, numbers and date phrases that are not in the notes (including mid-December or early November, not just Dec 15), and how many "Needs confirmation" lines there are. The last line only lists words from sections 1-4 whose first four letters appear nowhere in the notes. It does not fail on them, because whether a sentence is filler is for a person to judge.
#!/usr/bin/env python3"""usage: check.py notes.txt handover.txt (notes.txt = notes without numbers, one per line)"""import re, sysnotes = open(sys.argv[1], encoding="utf-8").read().splitlines()out = open(sys.argv[2], encoding="utf-8").read().splitlines()N = len(notes)src = "\n".join(notes)REF = r"\[(?:\d+(?:,\s*\d+)*|Needs confirmation)\]"sec, used, held, marked, unsupported, rest, strange = None, set(), set(), 0, [], [], set()for i, line in enumerate(out): s = line.strip() if s.startswith("#") or re.match(r"\**\d\.\s", s) or re.fullmatch(r"\*\*[^*]+\*\*:?", s): # 머리 줄: 번호가 있든 없든 낱말로 칸을 정한다 for w, n in {"recurring": 1, "progress": 2, "contacts": 3, "deadline": 4, "confirmation": 5, "left out": 6}.items(): if w in s.lower(): sec = n continue if not s: continue if sec == 6: # 'number: reason' k = re.match(r"[-*]\s*(\d+):\s*(.*)", s) if k and 1 <= int(k.group(1)) <= N: held.add(int(k.group(1))) else: unsupported.append(s[:50]) rest.append(re.sub(REF, "", k.group(2) if k else s)) # the reason goes through the new-number/date check too if any(not 1 <= int(x) <= N for r in re.findall(r"\[(\d+(?:,\s*\d+)*)\]", s) for x in r.split(",")): unsupported.append(s[:50]) continue rest.append(re.sub(REF, "", s)) # table rows included: for the new-number/date check if not re.match(r"[-*] ", s): continue nxt = next((l for l in out[i + 1:] if l.strip()), "") if len(nxt) - len(nxt.lstrip()) > len(line) - len(line.lstrip()): continue # group title with indented children refs = {int(x) for r in re.findall(r"\[(\d+(?:,\s*\d+)*)\]", s) for x in r.split(",")} if not refs or max(refs) > N or min(refs) < 1: unsupported.append(s[:50]) if "[Needs confirmation]" in s: marked += 1 if sec != 5: unsupported.append("flag outside section 5: " + s[:40]) elif sec in (1, 2, 3, 4): used |= refs strange |= {w for w in re.findall(r"[a-z]{4,}", re.sub(REF, "", s).lower()) if w[:4] not in src.lower()}MON = "jan feb mar apr may jun jul aug sep oct nov dec".split()DATE = r"(?:(early|mid|late|end of|beginning of)[- ]\s*)?\b(" + "|".join(m + r"[a-z]*" for m in MON) + r")\b\.?(?:\s+(\d{1,2})\b)?"def dates(s): return {f"{(q or '').lower()} {MON.index(mo[:3].lower()) + 1} {d}".strip() for q, mo, d in re.findall(DATE, s, re.I)}def nums(s): return set(re.findall(r"\d+(?:[-.]\d+)*", re.sub(DATE, " ", s, flags=re.I)))text = "\n".join(rest)new_nums, new_dates = sorted(nums(text) - nums(src)), sorted(dates(text) - dates(src))missing = sorted(set(range(1, N + 1)) - used - held)print("notes not used in sections 1-4 or 6:", missing)print("[Needs confirmation] lines:", marked, "· lines with no/invalid note number:", len(unsupported))for u in unsupported[:3]: print(" e.g.:", u)print("numbers not in the notes:", new_nums, "· date phrases not in the notes:", new_dates)print("words in sections 1-4 not in the notes (first 4 letters; read these by eye):", sorted(strange))sys.exit(1 if missing or unsupported or new_nums or new_dates or not used else 0)[6] Run it on the first result.
$ python -I -X utf8 check.en.py notes.en.txt out.en.1.txtnotes not used in sections 1-4 or 6: [][Needs confirmation] lines: 11 · lines with no/invalid note number: 0numbers not in the notes: [] · date phrases not in the notes: []words in sections 1-4 not in the notes (first 4 letters; read these by eye): ['discussed', 'made', 'send', 'still']out.en.2.txt and out.en.3.txt also exited 0. Counting by how the model was asked, three runs each:
| How it was asked | Next filter date written | Prepared date line | "5th" turned into Nov 5 |
|---|---|---|---|
| One sentence | 3 of 3 | 2 of 3 | 3 of 3 |
| Split into four headings only | 3 of 3 | 3 of 3 | 2 of 3 |
| The prompt above | 0 of 3 | 0 of 3 | 0 of 3 |
[7] Test the script on bad input. I changed one line of out.en.1.txt by hand in twelve ways (missing note, new number, new date, a number and a bad note id slipped into a 'Notes left out' reason, filler sentence, tag removed and so on); eight exited with code 1. One example: next due Dec 15 added to the filter line. The file is not model output.
$ python -I -X utf8 check.en.py notes.en.txt bad/e3.txtnotes not used in sections 1-4 or 6: [][Needs confirmation] lines: 11 · lines with no/invalid note number: 0numbers not in the notes: [] · date phrases not in the notes: ['12 15']Filler (scan the receipts and file them) exited 0 and only showed in the word list. Removing a [Needs confirmation] tag, swapping in another real date (Dec 31) and citing another real note ([2] for [20]) were not caught, because the value or number really exists in the notes.
[8] The section that went wrong was "Needs confirmation": 11, 17 and 13 lines in the three runs. Lines like "which vendor and what process to use for the stationery order" pile up almost one per note, and the successor ends up holding a longer list of questions than the document. Adding one clause to the rule fixed the count:
… The number is the note that raised the question. Include only gaps that would stop the successor from starting the task, and write at most 10 lines.(The other rules stay as in head.en.txt.) Three more runs gave 10, 5 and 9 lines. All 25 notes were used each time and no new numbers or dates showed up. Which questions survived was not compared line by line.
[9] Three things are for a person to read: whether each "Needs confirmation" line would really stop the successor, whether the Contacts section holds only contacts (in the third original run it included In week one, introduce the successor to the building office and the copier vendor), and whether the reasons under "Notes left out" hold.