Files
learning-garden/sources/2026-03-23.md

47 lines
1.2 KiB
Markdown

---
pageType: source
id: source.2026-03-23
title: 2026-03-23
sourceType: local-file
sourcePath: /home/topher/.openclaw/workspace-2890-bot/memory/2026-03-23.md
ingestedAt: 2026-05-02T21:36:27.468Z
updatedAt: 2026-05-02T21:36:27.468Z
status: active
growth: seed
---
# 2026-03-23
## Source
- Type: `local-file`
- Path: `/home/topher/.openclaw/workspace-2890-bot/memory/2026-03-23.md`
- Bytes: 549
- Updated: 2026-05-02T21:36:27.468Z
## Content
```text
# 2026-03-23
## Context Pruning Rule (85% Trigger)
- Topher asked for a new heartbeat rule at 85% context limit
- When triggered (~85K tokens):
1. Save most recent 50% to `memory/context_snapshot_recent_*.md`
2. Delete oldest 30% from session storage
3. Log to `memory/context-log.md`
- Implemented in `scripts/context_monitor.py`
- Added TOKEN_PREEMPTIVE = 85000 constant
- New functions: `save_recent_context()`, `prune_oldest_context()`, `log_to_context_log()`
## Testing
- Script runs: `python3 scripts/context_monitor.py --check` → OK
```
## Notes
<!-- openclaw:human:start -->
<!-- openclaw:human:end -->
## Related
<!-- openclaw:wiki:related:start -->
- No related pages yet.
<!-- openclaw:wiki:related:end -->