Skip to content

Commit ba04c51

Browse files
docs: update README for GitHub Copilot CLI support
- tagline now mentions Copilot CLI - install section lists Copilot CLI activation step - benchmarks table updated to 10/10 with Copilot session fixture - config section shows both claude and copilot paths - new GitHub Copilot CLI section (hooks, memory injection, escape hatch) - How it works updated to cover Copilot CLI hook architecture - local dev section simplified (bench/run.sh now auto-detects binary)
1 parent d667644 commit ba04c51

1 file changed

Lines changed: 40 additions & 12 deletions

File tree

README.md

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
55
[![Rust](https://img.shields.io/badge/rust-stable-orange.svg)](https://www.rust-lang.org)
66

7-
Token compression + context optimization for Claude Code and OpenCode. Runs automatically in Claude Code. Manual usage in OpenCode.
7+
Token compression + context optimization for Claude Code, OpenCode, and GitHub Copilot CLI. Runs automatically in Claude Code and Copilot CLI. Manual usage in OpenCode.
88

99
## What it does
1010

@@ -21,6 +21,7 @@ curl -fsSL https://raw.githubusercontent.com/claudioemmanuel/squeez/main/install
2121

2222
- **Claude Code:** Restart Claude Code to activate
2323
- **OpenCode:** Restart OpenCode to activate the plugin
24+
- **Copilot CLI:** Memory injected into `~/.copilot/copilot-instructions.md`; restart Copilot CLI to activate hook-based bash compression
2425

2526
## Benchmarks
2627

@@ -30,15 +31,16 @@ Measured on macOS (Apple Silicon), token estimate = chars/4. Run with `bash benc
3031
|---------|--------|-------|-----------|---------|
3132
| `ps aux` | 40,373 tk | 2,352 tk | **-95%** | 6ms |
3233
| `git log` (200 commits) | 2,667 tk | 819 tk | **-70%** | 4ms |
34+
| `docker logs` | 665 tk | 186 tk | **-73%** | 5ms |
3335
| `find` (deep tree) | 424 tk | 134 tk | **-69%** | 3ms |
3436
| `git status` | 50 tk | 16 tk | **-68%** | 3ms |
35-
| `docker logs` | 665 tk | 186 tk | **-73%** | 5ms |
36-
| `npm install` | 524 tk | 231 tk | **-56%** | 3ms |
3737
| `ls -la` | 1,782 tk | 886 tk | **-51%** | 4ms |
38+
| `npm install` | 524 tk | 231 tk | **-56%** | 3ms |
3839
| `git diff` | 502 tk | 317 tk | **-37%** | 4ms |
3940
| `env` dump | 441 tk | 287 tk | **-35%** | 3ms |
41+
| Copilot CLI session | 639 tk | 421 tk | **-35%** | 3ms |
4042

41-
9/9 fixtures pass. Latency under 10ms on every fixture.
43+
10/10 fixtures pass. Latency under 10ms on every fixture.
4244

4345
## Escape hatch
4446

@@ -48,7 +50,9 @@ Measured on macOS (Apple Silicon), token estimate = chars/4. Run with `bash benc
4850

4951
## Configuration
5052

51-
Optional `~/.claude/squeez/config.ini` (all fields optional):
53+
Optional config file (all fields optional):
54+
- Claude Code / default: `~/.claude/squeez/config.ini`
55+
- Copilot CLI: `~/.copilot/squeez/config.ini`
5256
```ini
5357
# Compression
5458
max_lines = 200
@@ -64,11 +68,13 @@ memory_retention_days = 30 # how long to keep session summaries
6468

6569
## How it works
6670

67-
Three Claude Code hooks work together:
71+
### Claude Code & Copilot CLI
72+
73+
Three hooks work together:
6874

6975
**Compression** (`PreToolUse`): Every Bash call is rewritten — `git status``squeez wrap git status`. The wrap command runs via `sh -c`, captures stdout+stderr, applies 4 strategies (smart_filter → dedup → grouping → truncation), and prints a compressed result with a savings header.
7076

71-
**Session memory** (`SessionStart`): On each new session, `squeez init` finalizes the previous session into a summary (files touched, errors resolved, test results, git events) and prints a memory banner so Claude has prior-session context from the start.
77+
**Session memory** (`SessionStart`): On each new session, `squeez init` finalizes the previous session into a summary (files touched, errors resolved, test results, git events) and prints a memory banner so the agent has prior-session context from the start. For Copilot CLI, this banner is also written to `~/.copilot/copilot-instructions.md` which is loaded automatically at every session.
7278

7379
**Token tracking** (`PostToolUse`): Every tool call's output size is tracked. When cumulative session tokens cross 80% of the context budget, a compact warning is emitted in the next bash output header.
7480

@@ -98,6 +104,30 @@ squeez wrap docker logs mycontainer
98104
squeez wrap npm install
99105
```
100106

107+
## GitHub Copilot CLI
108+
109+
Copilot CLI is supported via hooks registered in `~/.copilot/settings.json` and session memory injected into `~/.copilot/copilot-instructions.md`.
110+
111+
**Install:**
112+
```bash
113+
curl -fsSL https://raw.githubusercontent.com/claudioemmanuel/squeez/main/install.sh | sh
114+
```
115+
116+
**What happens:**
117+
- Session memory is written to `~/.copilot/copilot-instructions.md` — Copilot CLI reads this automatically at every session start, giving the agent prior-session context without re-discovery tokens
118+
- Hooks are registered in `~/.copilot/settings.json` for PreToolUse (bash compression), SessionStart (memory refresh), and PostToolUse (token tracking)
119+
- Session state is stored separately in `~/.copilot/squeez/` (independent from Claude Code state)
120+
121+
**Refresh memory manually:**
122+
```bash
123+
SQUEEZ_DIR=~/.copilot/squeez ~/.claude/squeez/bin/squeez init --copilot
124+
```
125+
126+
**Escape hatch:**
127+
```bash
128+
--no-squeez git log --all --graph
129+
```
130+
101131
## Local development
102132

103133
**Prerequisites:** Rust stable (`rustup update stable`), `bash`, macOS or Linux.
@@ -110,16 +140,14 @@ cd squeez
110140
# 2. Build & test
111141
cargo test
112142

113-
# 3. Run benchmarks (requires release binary)
143+
# 3. Run benchmarks (uses local release binary automatically)
114144
cargo build --release
115-
mkdir -p "$HOME/.claude/squeez/bin"
116-
cp target/release/squeez "$HOME/.claude/squeez/bin/squeez"
117145
bash bench/run.sh
118146

119-
# 4. Install hooks into your Claude Code config
147+
# 4. Install hooks into Claude Code and Copilot CLI config
120148
bash install.sh
121149

122-
# 5. Restart Claude Code — squeez is active
150+
# 5. Restart Claude Code / Copilot CLI — squeez is active
123151
```
124152

125153
To uninstall: `bash uninstall.sh`

0 commit comments

Comments
 (0)