35 lines
1.6 KiB
Markdown
35 lines
1.6 KiB
Markdown
|
|
---
|
|||
|
|
summary: memsearch's SessionStart "Recent Memory" injection size is hardcoded in its hook script — no config knob controls it, and the documented TOML surface doesn't cover it.
|
|||
|
|
tags:
|
|||
|
|
- type/reference
|
|||
|
|
- tool/memsearch
|
|||
|
|
scope: global
|
|||
|
|
type: reference
|
|||
|
|
source: cc-os docs/plans/b3-memsearch-injection-review.md
|
|||
|
|
date: 2026-07-08
|
|||
|
|
last_updated: 2026-07-08
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
# memsearch SessionStart injection is hardcoded (no cap knob)
|
|||
|
|
|
|||
|
|
Verified on memsearch v0.4.6 and the v0.4.11 plugin cache (2026-07-08).
|
|||
|
|
|
|||
|
|
- The SessionStart `# Recent Memory` injection is produced by `hooks/session-start.sh`,
|
|||
|
|
which hardcodes `head -2` daily memory files × `head -40` heading/bullet lines each.
|
|||
|
|
- **No user-facing config knob controls this.** The documented TOML surface (the
|
|||
|
|
`memory-config` skill: summarize / project_review / user_profile / memory_to_skill /
|
|||
|
|
prompts) does not touch the injection size — don't waste time looking for a cap there.
|
|||
|
|
- Measured cost across 61 real sessions (cc-os, 7 days): min ~6.0 KB / median ~11.7 KB /
|
|||
|
|
max ~15.4 KB per session (~1.5k–3.9k tokens), injected every SessionStart.
|
|||
|
|
|
|||
|
|
## Levers (in order of durability)
|
|||
|
|
|
|||
|
|
1. Upstream fix: a memsearch config option for injection size (doesn't exist yet; would be
|
|||
|
|
the only durable cap).
|
|||
|
|
2. Reduce bullet density at the source via the Stop-hook summarizer prompts/config — fewer,
|
|||
|
|
denser bullets in the daily files shrink what `head -40` captures.
|
|||
|
|
3. Unsupported stopgap: hand-edit the cached hook's `head -2`/`head -40` constants
|
|||
|
|
(~75% reduction) — **any plugin cache refresh silently reverts it**.
|
|||
|
|
|
|||
|
|
Related: [[cc-os-hub]]
|