Skip to content
Agentmart
Submit a tool

context-compressor

Strategies for compressing context to maximize token efficiency

Skill by Ashish-Dhankecha

IndexedAGPL-3.0
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/ashish-dhankecha-context-compressor

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Strategies for compressing context to maximize token efficiency

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/context-compressor

What's inside

Skill name
context-compressor
Description
Strategies for compressing context to maximize token efficiency
License
AGPL-3.0
Instructions
198 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Context Compressor Skill

<role>
You are a context compression specialist. Your job is to maintain rich understanding while using minimal tokens.

**Core principle:** Compress aggressively, decompress only when needed.
</role>

---

## Compression Strategies

### Strategy 1: Summary Mode

**When:** You've fully understood a file and may need to reference it later.

**How:**
```markdown
## File Summary: src/auth/login.ts

**Purpose:** Handles user login via email/password
**Key functions:**
- handleLogin(req, res) → Validates credentials, returns JWT
- validateCredentials(email, password) → Checks against DB
**Dependencies:** bcrypt, jose, database
**Tokens saved:** ~400 (95 lines not reloaded)
```

**Use instead of:** Re-reading the full file

---

### Strategy 2: Outline Mode

**When:** You need to understand a file's structure but not implementation details.

**How:**
```markdown
## Outline: src/services/payment.ts (127 lines)

- L1-15: Imports and types
- L17-35: PaymentService class
  - L20: constructor(config)
  - L25: processPayment(amount, method)
  - L45: refund(transactionId)
  - L67: getHistory(userId)
- L90-127: Helper functions
```

**Tokens:** ~50 vs ~500 for full file

---

### Strategy 3: Diff-Only Mode

**When:** You've already seen a file and need to understand changes.

**How:**
```markdown
## Changes to: src/config.ts

Added:
- L45: TOKEN_BUDGET_THRESHOLD = 0.5
- L46: COMPRESSION_ENABLED = true

Modified:
- L12: MAX_CONTEXT → increased from 100000 to 150000
```

**Use for:** Reviewing modifications, understanding updates

---

### Strategy 4: Reference Mode

**When:** You need to track a file without loading it.

**How:**
```markdown
## References

| File | Last Seen | Summary | Load If |
|------|-----------|---------|---------|
| auth.ts | Task 2 | Login handling | Auth bugs |
| db.ts | Task 1 | Postgres client | DB errors |
| utils.ts | Never | Utility funcs | Helper needed |
```

**Cost:** ~10 tokens vs ~200+ per file

---

### Strategy 5: Progressive Disclosure

**When:** Unsure how much detail is needed.

**Process:**
1. Start with outline (Level 1)
2. If insufficient, load key functions (Level 2)
3. If still stuck, load related code (Level 3)
4. Full file only as last resort (Level 4)

```
L1: Outline → "I see handleLogin at L25"
L2: Function → "handleLogin validates then calls createToken"
L3: Related → "createToken uses jose.sign with HS256"
L4: Full → Only for complex debugging
```

---

## Compression Triggers

### Automatic Compression Points

| Trigger | Action |
|---------|--------|
| After understanding a file | Create summary |
| Switching tasks | Compress previous context |

From Ashish-Dhankecha/Leo, AGPL-3.0.

More from Ashish-Dhankecha/Leo

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Jun 28, 2026 (4 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
AGPL-3.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Ashish-Dhankecha

Cite this page

context-compressor skill. Agent Mart. https://agentmart.dev/skills/ashish-dhankecha-context-compressor (last updated 2026-10-24)