◉CLAUDE LABJP
●CODE 2.1.319 — Claude Code now moves MCP tasks to the background automatically, and a denyInsteadOfPrompting setting denies calls that would wait on a prompt●FABLE 5.2 — Claude Fable 5.2 and its fast mode are on the Claude API (11/9). Mythos 5.2 is limited to verified organizations●SONNET 4.5 — Retires on the Claude API on 11/30, 20 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●FAST — Opus 4.8 fast mode is deprecated and will be removed on 11/30. Migrate to Opus 5.5●NEW — I Put a Ten-Line Promise File at the To…●CODE 2.1.319 — Claude Code now moves MCP tasks to the background automatically, and a denyInsteadOfPrompting setting denies calls that would wait on a prompt●FABLE 5.2 — Claude Fable 5.2 and its fast mode are on the Claude API (11/9). Mythos 5.2 is limited to verified organizations●SONNET 4.5 — Retires on the Claude API on 11/30, 20 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●FAST — Opus 4.8 fast mode is deprecated and will be removed on 11/30. Migrate to Opus 5.5●NEW — I Put a Ten-Line Promise File at the To…
Articles/Cowork
◈ Cowork/2026-10-11Intermediate

I Stopped Making Cowork Read My Whole Troubleshooting Notes — Pulling One Section by Number Cut 105 KB to 1.5 KB

A record of turning a 105 KB file of web-ops troubleshooting notes into something you query by number. My first extraction script could reach only 30 of 120 numbers, and #70 came back as zero bytes. The fixed awk, a zero-byte check, and measured section sizes are all here.

Cowork62Ops NotesContext3awkIndie Dev23

My troubleshooting notes had quietly grown to 1,549 lines.

Every time I told Cowork, "I think I've hit this symptom before," I handed over the whole file. One symptom, and nearly 105 KB along with it. One day, watching it load, I stopped and wondered why I was doing this.

So I changed it: say a number, get back one section. My first script, though, couldn't find most of the numbers. I'm keeping that failure in the record, with the measurements.

The short version: sections are small, and the real problem was numbers I couldn't reach

Measured results first. The file is a single Markdown document of problems I've run into while operating web sites.

ItemMeasured
Whole file104,822 bytes (1,549 lines)
Headings (## and ###)217
Section size (median)356 bytes
Section size (90th percentile)910 bytes
Largest section4,008 bytes
Index (chapters and numbered headings only)144 entries, 11,740 bytes
Pulling one section by number401 to 1,567 bytes

Passing the whole file versus pulling one section differs by roughly 60x to 260x in bytes. I hadn't expected the median section to be only 356 bytes until I measured it.

Notes are something you query, not something you make the assistant read. I drew that line only after I saw the numbers.

My first extraction script reached a quarter of the numbers

The first awk I wrote picked up only headings that carried a number like #119.

# First version: only matches "### #119 ..." style headings
awk -v n="$2" '
/^#{2,3} / { on = ($0 ~ ("^#{2,3} #" n "([^0-9]|$)")) }
on { print }
' "$1"

#119 worked. It returned 1,567 bytes, and for a moment everything looked fine.

Then I asked for #70, a section I look up all the time. It returned 0 bytes. No error, just nothing.

Recounting the headings explained it:

  • Headings with a #-style number, like ### #119 ...: 30 distinct numbers
  • Headings with a plain chapter number and no #, like ## 70. ...: most of the rest

The notes had grown over months, so only the later sections used the #number style while the early ones used chapter numbers. The script reached 30 numbers; 120 were actually addressable (within 1 to 134). A quarter.

What worried me most was that, from Cowork's side, "0 bytes" looks identical to "no match." A symptom could be written down in the notes and still be judged "no precedent."

The fixed version, and what it returns

For chapter-style sections (## 70.) the script now returns everything up to the next ## , children included. For #number sections it returns just that section.

#!/bin/bash
# kb.sh FILE NUMBER
# "## N." runs to the next "## " (children included); "### #N" returns that section only
awk -v n="$2" '
/^## /  { on = ($0 ~ ("^## " n "\\.")); top = on; if (on) print; next }
/^### / { if ($0 ~ ("^### #" n "([^0-9]|$)")) { on = 1; top = 0; print; next }
          else if (!top) { on = 0 } }
on { print }
' "$1"

Measured after the fix:

NumberBytes returnedWhat it is
#70401Scheduled-task prompts drifting out of sync with their instructions
#191,531Page-speed fixes (three child sections included)
#1191,567An x-default hreflang being declared twice
#1251,016Child pages inheriting a root-level setting
#999 (does not exist)0No match

Ten consecutive runs took 0.057 seconds in total, so speed is a non-issue.

The last row is the one that matters. Zero bytes for a number that doesn't exist is correct behavior. Zero bytes for a number that does exist means the tool is broken. To tell those apart, I added the check in the next section.

Don't let "0 bytes" pass quietly — cross-check against the index

I build the list of numbers that exist first, then pull every one of them and complain about any that return nothing.

#!/bin/bash
# kb-check.sh FILE — pull every number in the index and count the 0-byte results
F="$1"
nums=$( { grep -oE '^## [0-9]+\.' "$F" | grep -oE '[0-9]+'
          grep -oE '^### #[0-9]+' "$F" | grep -oE '[0-9]+'; } | sort -nu )
bad=0
for n in $nums; do
  size=$(./kb.sh "$F" "$n" | wc -c)
  [ "$size" -eq 0 ] && { echo "0 bytes: #$n"; bad=$((bad+1)); }
done
echo "checked=$(echo "$nums" | wc -w) zero=$bad"

I run it once after adding a section. On my file it prints checked=120 zero=0 and finishes in 0.8 seconds. If zero is anything else, it means a new heading style has crept in.

I also chose not to build the index on line numbers. They shift every time a section is added. Querying by heading text and number keeps the script working as the notes keep growing.

Rewriting the instruction I give Cowork

With the tooling in place, I rewrote the instruction too.

Before:

My troubleshooting notes are in STUMBLING_POINTS.md. Look for the relevant parts.

After:

My troubleshooting notes are in STUMBLING_POINTS.md. Don't read the whole file. First pull one section with kb.sh by number. If you don't know the number, look at the index (the list of headings) and pick the likely one. If any number comes back with 0 bytes, tell me instead of moving on.

The last sentence comes straight from the failure above. Not letting "nothing came back" slide by gives me one more place to notice a miss.

Where this leaves me

In numbers, roughly 105 KB per lookup became a 0.4 to 1.6 KB section. What stayed with me, though, was something else: decide how a lookup behaves when it fails before you decide how it behaves when it works.

If you keep a notes file like this, a first step could be counting whether your heading numbers follow a single style. Mine didn't, and that was where the whole approach began to be useful.

Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

◈ Cowork2026-10-18
I Preloaded a Scheduled Task with head -150: 15.6 KB Read, 3.3 KB for Today
A scheduled task preloaded its daily notes with head -150, and line count turned out to be no budget at all. A date-block reader with a byte ceiling, and how to avoid dropping ideas nobody has used yet.
◈ Cowork2026-11-02
Only the Plugin's MCP Server Fails to Authenticate — Triage for an Unexpanded ${VAR}
If only a plugin-bundled MCP server fails to authenticate in Cowork, its ${VAR} placeholders may be reaching the server as literal text. A log check and a pre-distribution scan, based on the report in issue #94395.
◈ Cowork2026-10-30
Start Cowork's First Week With a Practice Folder: Three I Handed Over, One I Held Back
How to decide which folders to give Cowork first: an empty practice folder, a copy of real files, and an output folder, while keeping the folder with credentials out of reach.