~/groundwork

Budgets and compaction

Memory stays small enough to load every session. Old material is archived, never deleted.

Memory only helps if it is small enough to load. Every memory file has a size budget. doctor checks them, and compact tidies up.

npx groundwork-ai doctor
Always loaded:  ≈510 tokens (budget 2000): AGENTS.md 440, CLAUDE.md 35, skill list 35
Brief:          ≈288 tokens (budget 1500), loaded at each session start
Memory files:   handoff 166/600 · decisions 87/600 · map 48/800 · lessons 206/1200 · journal 169/2500 tokens

The budgets

In .groundwork/config.json, under budgets, in estimated tokens (characters ÷ 4):

KeyDefaultWhen it is over
brief1,500The brief trims itself to fit
handoff600Shorten it; compact archives sections Groundwork doesn't define
map800Shorten it by hand
decisions600compact archives superseded records
lessons1,200Merge or drop entries by hand
journal2,500compact archives the oldest entries

doctor exits 1 when a file is over, so it can run in CI. tokenBudget (2,000) is separate: it covers what your tool always loads, such as AGENTS.md.

Compact

npx groundwork-ai compact --dry-run     # preview
npx groundwork-ai compact

It moves things to .groundwork/archive/. It never deletes.

WhatWhere it goes
Journal entries beyond the budget, oldest firstarchive/JOURNAL-<year>.md
Superseded decisions, every timearchive/decisions/
Handoff sections Groundwork doesn't definearchive/HANDOFF-<date>.md

It won't shorten Now, Next or Notes. Only you or the agent can judge those.

On this page