Add full-compaction hook example

This commit is contained in:
Mario Zechner 2025-12-24 12:25:36 +01:00
parent bf313d2713
commit 5aa53ded11
3 changed files with 143 additions and 51 deletions

View file

@ -25,6 +25,9 @@ Prevents session changes when there are uncommitted git changes. Blocks clear/sw
### auto-commit-on-exit.ts
Automatically commits changes when the agent exits (shutdown event). Uses the last assistant message to generate a commit message.
### full-compaction.ts
Custom context compaction that summarizes the entire conversation instead of keeping recent turns. Uses the `before_compact` hook event to intercept compaction and generate a comprehensive summary using `complete()` from the AI package. Useful when you want maximum context window space at the cost of losing exact conversation history.
## Usage
```bash