Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions docs/context-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ Commands for managing conversation history length and token usage.

## Comparison

| Feature | `/clear` | `/truncate` | `/compact` |
|---------|----------|------------|------------|
| **Speed** | Instant | Instant | Slower (uses AI) |
| **Context Preservation** | None | Temporal | Intelligent |
| **Cost** | Free | Free | Uses API tokens |
| **Reversible** | No | No | No |
| Feature | `/clear` | `/truncate` | `/compact` |
| ------------------------ | -------- | ----------- | ---------------- |
| **Speed** | Instant | Instant | Slower (uses AI) |
| **Context Preservation** | None | Temporal | Intelligent |
| **Cost** | Free | Free | Uses API tokens |
| **Reversible** | No | No | No |

## `/clear` - Clear All History

Remove all messages from conversation history.
Remove all messages from conversation history.

### Syntax

Expand Down Expand Up @@ -59,7 +59,7 @@ Basic compaction with default settings.
Limit summary to 1000 output tokens.

```
/compact 2000 next up, we're adding a dark theme
/compact 2000 next up, we're adding a dark theme
```

Compact with token limit and custom instructions.
Expand Down Expand Up @@ -101,5 +101,3 @@ Remove oldest 50% of messages.
- About as fast as `/clear`
- `/truncate 100` is equivalent to `/clear`
- **Irreversible** - messages are permanently removed


15 changes: 10 additions & 5 deletions scripts/fmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"

cd "$PROJECT_ROOT"

PRETTIER_PATTERNS=("src/**/*.{ts,tsx,js,jsx,json}" "*.{json,md}")
PRETTIER_PATTERNS=(
"src/**/*.{ts,tsx,js,jsx,json}"
"tests/**/*.{ts,tsx,js,jsx,json}"
"docs/**/*.{md,mdx}"
"*.{json,md}"
)

format_typescript() {
run_prettier() {
local mode="$1"
if [ "$mode" = "--check" ]; then
echo "Checking TypeScript/JSON/Markdown formatting..."
Expand Down Expand Up @@ -38,12 +43,12 @@ format_shell() {
}

if [ "$1" = "--check" ]; then
format_typescript --check
run_prettier --check
elif [ "$1" = "--shell" ]; then
format_shell
elif [ "$1" = "--all" ]; then
format_typescript
run_prettier
format_shell
else
format_typescript
run_prettier
fi