compress_observations
Compress raw hook observations into structured summaries to reduce token count in session history. Call before get_state to ensure compact project memory.
Instructions
Compress recent raw hook observations into structured typed summaries (tool_failure, tool_success, file_edit, generic) using rule-based analysis. Reduces token count when injecting session history into context. Does not delete raw observations — only marks them as compressed. Call before get_state or at session start to ensure hook data is compact before loading project memory. Returns the count of compressed items and a human-readable summary of what was processed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max number of raw observations to process. Default: 50. | |
| since | No | ISO 8601 timestamp: only compress observations newer than this. Optional. | |
| project_path | No | Absolute path to the project root. Defaults to current working directory. |