◉CLAUDE LABJP
●CC 2.1.332 — In 2.1.332 (11/25), skills from MCP servers show up in the / menu as server:skill (beta)●SONNET 4.5 — Sonnet 4.5 retires from the Claude API on 11/30, 4 days left. Move to claude-sonnet-5-5●/SHIP — Users report a custom ship skill hidden behind the new built-in /ship command●NEW — New: Before Sonnet 4.5 retires, compare the 3 places its answers change●GEMINI 2.5 — Using Gemini 2.5 alongside Claude? From 12/1 requests reroute to newer models at their rates. 5 days left●JETBRAINS — Our guide to using Claude Code from JetBrains IDEs is the most-read page right now●CC 2.1.332 — In 2.1.332 (11/25), skills from MCP servers show up in the / menu as server:skill (beta)●SONNET 4.5 — Sonnet 4.5 retires from the Claude API on 11/30, 4 days left. Move to claude-sonnet-5-5●/SHIP — Users report a custom ship skill hidden behind the new built-in /ship command●NEW — New: Before Sonnet 4.5 retires, compare the 3 places its answers change●GEMINI 2.5 — Using Gemini 2.5 alongside Claude? From 12/1 requests reroute to newer models at their rates. 5 days left●JETBRAINS — Our guide to using Claude Code from JetBrains IDEs is the most-read page right now
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.

Cowork69Ops 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-20
Copy Your Scheduled Tasks' Prompts and Times Once a Week, So You Can Restore Them If They Vanish
Scheduled tasks can disappear or need rescheduling after an app update or a save that fails to read its file. Here is a weekly habit for keeping three things—prompt, schedule, and connected folders—in your own folder, plus a small script that tells you which copies changed since last week.
◈ Cowork2026-11-17
78 Memory Files Outside the Index: Retiring Cowork Project Memory Without Deleting It, and Moving Decisions Into Docs
I had been keeping app-operations decisions in a Cowork project's memory, and 78 files had drifted out of the index. Three scripts (find, retire-and-restore, index lint) and the line I drew between memory and docs.