HMDeveloper
All articles
agents
agentscontextmemory

The memory index grew and the agent only saw 15%

The index reached 170,870 bytes, but the agent could load only about 15%. See what changed in size, the session-start estimate, and search.

On September 30, the memory index reached 170,870 bytes. The agent could load only about 15% of it.

On disk, the file looked complete. For the agent, much of it did not exist.

I organized the workspace so each kind of information has a defined location. There is no controlled comparison that proves better answers, faster resumption, or fewer repeated errors. I measured file size, a session-start estimate, and search time.

One root, folders with one job

~/Workspace/
  CLAUDE.md  AGENTS.md          # map and development flow
  .sprints -> <vault>/_memory/sprints
  <Company>/Core/
    vault/                      # KNOWS
      _global/                  # shared rules and decisions
      _memory/                  # lessons and sprint files
      <project>/INDEX.md        # project entry point; ## Now first
    .brain/                     # OPERATES
      agents/ skills/ routing/ scripts/
    <product>/                  # IMPLEMENTS
      CLAUDE.md                 # thin router
  Infra/ Clients/ SaaS/ Archive/
~/.claude/                      # projection of .brain
  CLAUDE.md projects/ skills/ scripts/ state/

The root points to the right locations without duplicating the detailed documentation. The vault holds knowledge. The operational layer keeps agents and routines. Repositories implement the work. Runtime folders receive projections. They are not the source.

Each project has an INDEX.md with current status and links to decisions and rules. .brain/ holds agents, skills, routing, and adapters. The product CLAUDE.md points to the flow. On November 7, routers in three scopes had 8, 14, and 18 lines. That reading is from that day, not a guarantee that short files never grow.

The split between router and knowledge already showed up in context in two layers. Here, I track index size, working context, and recalled lessons.

The index shrank. Then it grew again.

The index fell 94% and grew again. Bytes show size on disk, not context cost.

Memory index size

Index size on the dates shown. Bytes are not context cost.

Data
Aug 19, 202624,774 B
Sep 16, 202678,052 B
Sep 30, 2026170,870 B
Oct 2, 202610,808 B
Nov 7, 202622,070 B

On October 2, 703 lines went to an archive file. The index fell from 178,725 to 10,808 bytes. On November 7 it was 22,070 bytes, about 11 KB above the October low in five weeks. The cut fixed the immediate excess. It did not stop growth.

The limit seen in September was 25,000 characters or 200 lines, whichever came first. The file had 169,589 characters in 828 lines. The character limit allowed about 14.7%, roughly the first 115 lines. In August, a line-based cutoff had already excluded 104 lines and 88 pointers. The system did not say that the rest did not reach the context.

The session-start estimate has a formula too

The estimate adds the bytes of three files that always load (global CLAUDE.md, root CLAUDE.md and MEMORY.md) and divides by four. On November 7: (11,708 + 6,984 + 22,070) / 4 = 10,190. It does not measure the whole prompt. Bytes are not characters, and different compositions are not comparable.

Session-start estimate: rules and index

Rules and index estimate. Sep 16 and Nov 6 are reported readings. Nov 7 is recomputed with the same formula. Bytes are not context cost.

Data
Sep 16, 2026~21,072
Nov 6, 2026~9,906
Nov 7, 2026, recomputed10,190

The July reading was about 5.6 thousand tokens, but it used another composition and stays off the chart. In September the estimate was about 21 thousand. The coincidence with the 78,052-byte index does not prove a cause. In November the reading was about 9.9 thousand. The next day, recalculating with the same formula gave 10,190. The estimate does not cover everything the agent reads.

A session is not durable knowledge

The sprint file records the state of a task: evidence, decisions, open items, questions for the owner, and constraints. The agent opens it by ID before resuming. It records one point in time and does not prove that no other work is underway. Resumption also checks branches and PRs.

At the end of a session, the transcript supports the lessons. The routine writes at most five short claims, and zero is valid. Each claim is checked against the record. If there is evidence, the claim gets a page. Search avoids duplicates. The index points to the page and does not copy its full contents.

Before each tool call, an automatic trigger looks for lessons related to the command or path and may include up to three. If the search fails, the tool stays available.

In September, table search took a median of 75 ms. 95% of queries stayed under 248 ms. Hybrid search had a 95th percentile of 397 ms; that is not a maximum. In 7 of 8 queries, a useful result appeared in the first three, with or without the hybrid route. The hybrid route alone scored 4 of 8. It stayed off by default.

On November 3, the trigger showed a lesson about a shell error. In the same session, the command was repeated twice. The response was not to write more memory. The case went to an automatic check: when a rule must not be broken, a reminder is only a warning. This is one example, with no overall repeat rate before and after.

What the numbers do not say

I did not measure answer quality before and after, time to resume, tasks lost when context is cleared, or errors avoided by the lessons. How often the trigger included a lesson does not prove the lessons were used. I do not attribute the estimates to the folder tree. The measurements are about specific files, formulas, and searches.

How to copy this at small scale

Start with one workspace root and one Markdown vault. Create one INDEX.md per project, with current status and links. Keep the map and the flow in the router, and give each document one source. Use one sprint file per subject, and record a lesson only when the transcript supports it.

First, keep the index under the tool's real limit, which may be lines or characters. If a rule fails again even when recalled, automate that specific check. The layout gives addresses. The check confirms the rule.

Summary

One root and one place per kind of knowledge keep the map readable. Sprint files help resume work. Verified lessons are added to memory. The index fell 94% and grew again. One recalled lesson did not prevent the command from being repeated. Start small. Measure the loaded context. Automate the rule that needs a check.

I help teams use AI agents in daily software work. If your team does that, let's talk.

See consulting