---
title: "Context compaction animated icon"
description: "Context compaction animated icon (AI · Agent operations). The context closes to a compact readable group. Strong opens the jaws briefly before a fast compression; the text stays ordered without stretching or overshoot."
canonical: https://generativeicons.com/icons/context-compaction/
---

# Context compaction animated icon

The context closes to a compact readable group. Strong opens the jaws briefly before a fast compression; the text stays ordered without stretching or overshoot.

- Id: `context-compaction`
- Category: AI · Agent operations
- Search terms: condense, compress context, squeeze, shrink, reduce tokens, save tokens, trim context, auto compact, memory compression, compress chat
- Two states: prepared to result, played forward and back
- Styles: outline, solid, duotone; outline weights 1.5, 2, 2.5 (any from 1 to 3); motion light or strong
- File: https://generativeicons.com/assets/context-compaction.lottie (dotLottie, 7442 bytes, sha256 15c3c0f07ac1277de54f3027f153ed79a5a80ff8cd26a7d259bbebfdefb3ef4a)
- License: MIT

## Install

```sh
npm install @lottiefiles/generative-icons-runtime
npx generative-icons init
npx generative-icons add context-compaction
```

## React

```tsx
// npm install @lottiefiles/generative-icons-react
'use client';
import { AnimatedIcon } from '@lottiefiles/generative-icons-react';
import icon, { src } from './generative-icons/context-compaction.mjs';

export function ContextCompactionIcon() {
  return <AnimatedIcon icon={icon} src={src} size={32}
    color="#ffffff" variant="outline" weight={2}
    motion="light" theme="dark" />;
}
```

## JavaScript

```js
import { createIcon } from '@lottiefiles/generative-icons-runtime';
import icon, { src } from './generative-icons/context-compaction.mjs';

const handle = await createIcon(canvas, {
  icon, src,
  color: '#ffffff', style: 'outline', weight: 2,
  motion: 'light', theme: 'dark'
});
button.addEventListener('click', () => handle.play());
// On removal: handle.destroy();
```

More: https://generativeicons.com/icons/context-compaction/ · https://generativeicons.com/api/icons/context-compaction
