pub struct CompactMetadata {
pub trigger: String,
pub pre_tokens: u64,
pub post_tokens: Option<u64>,
}Expand description
Compact boundary metadata
Marks natural conversation break points where context was compacted.
§When Compaction Occurs
Claude Code automatically compacts conversation when:
- Token count reaches ~150k-160k tokens
- User manually triggers compaction
§Usage for Segmentation
Compact boundaries are IDEAL for:
- Breaking long sessions into segments
- Creating segment summaries
- Understanding conversation phases
§Example
{
"trigger": "auto",
"preTokens": 156594
}Fields§
§trigger: StringTrigger type: “auto” or “manual”
"auto"- Automatic compaction at ~150k tokens"manual"- User-triggered compaction
pre_tokens: u64Token count before compaction
Typically ~150k-160k for auto-compaction
post_tokens: Option<u64>Token count after compaction (optional)
Trait Implementations§
Source§impl Clone for CompactMetadata
impl Clone for CompactMetadata
Source§impl Debug for CompactMetadata
impl Debug for CompactMetadata
Source§impl<'de> Deserialize<'de> for CompactMetadata
impl<'de> Deserialize<'de> for CompactMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CompactMetadata
impl RefUnwindSafe for CompactMetadata
impl Send for CompactMetadata
impl Sync for CompactMetadata
impl Unpin for CompactMetadata
impl UnsafeUnpin for CompactMetadata
impl UnwindSafe for CompactMetadata
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more