Compress and decompress JSON using the ASON format directly in Visual Studio Code. Reduce token usage by 20-60% for LLM applications while maintaining 100% lossless round-trip fidelity.
- Direct commands for manual compression/decompression
- Keyboard shortcuts:
Cmd+Alt+C(compress),Cmd+Alt+D(decompress),Cmd+Alt+S(stats) - Accessible via Command Palette or right-click menu
- Perfect for one-off conversions
- Automatically configured when you install this extension!
- Works with GitHub Copilot Chat (requires VS Code 1.99+)
- Copilot can use ASON tools automatically
- Ask Copilot: "Compress this JSON using ASON" and it works!
- No manual configuration needed - it just works!
- Open VS Code
- Go to Extensions (
Cmd+Shift+X/Ctrl+Shift+X) - Search for "ASON"
- Click Install
- MCP server is automatically configured for Copilot!
- VS Code 1.99+ (for MCP server integration)
- Node.js 18+ (for MCP server via npx)
- GitHub Copilot (optional, for automatic tool access)
When you install this extension:
- β
Extension commands are registered (
ASON: Compress, etc.) - β MCP server is automatically configured for GitHub Copilot
- β ASON tools become available in Copilot Chat
- β No manual configuration needed!
The MCP server uses npx @ason-format/mcp-server@latest, so it always stays up-to-date.
- Compress JSON to ASON: Convert selected JSON to token-optimized ASON format
- Decompress ASON to JSON: Restore ASON back to original JSON (lossless)
- Compression Statistics: View detailed metrics on token and byte savings
- Configurable Settings: Customize compression behavior per workspace
- MCP Server Support: Use with GitHub Copilot Chat (VS Code 1.99+)
Access commands via:
- Command Palette (
Cmd+Shift+P/Ctrl+Shift+P) - Right-click context menu (when text is selected)
| Command | Description |
|---|---|
ASON: Compress Selection |
Compress selected JSON to ASON format |
ASON: Decompress Selection |
Decompress selected ASON to JSON |
ASON: Show Compression Stats |
Display detailed compression statistics |
- Select JSON text in your editor
- Open Command Palette (
Cmd+Shift+P) - Run
ASON: Compress Selection - Selected text is replaced with ASON format
Before:
{
"users": [
{"id": 1, "name": "Alice", "age": 25},
{"id": 2, "name": "Bob", "age": 30}
]
}After:
users:[2]{id,name,age}
1|Alice|25
2|Bob|30
- Select ASON text in your editor
- Run
ASON: Decompress Selection - Selected text is replaced with formatted JSON
- Select JSON text
- Run
ASON: Show Compression Stats - View detailed metrics in the output panel:
=== ASON Compression Statistics ===
Original Tokens: 59
Compressed Tokens: 23
Token Reduction: 61.02%
Original Size: 151 bytes
Compressed Size: 43 bytes
Bytes Saved: 108 bytes
=== Configuration ===
Indent: 1
Delimiter: "|"
Use References: true
Use Sections: true
Use Tabular: true
=== ASON Preview ===
users:[2]{id,name,age}
1|Alice|25
2|Bob|30
Configure ASON behavior in your workspace settings (Cmd+, / Ctrl+,):
{
"ason.indent": 1,
"ason.delimiter": "|",
"ason.useReferences": true,
"ason.useSections": true,
"ason.useTabular": true,
"ason.autoShowStats": true
}| Setting | Type | Default | Description |
|---|---|---|---|
ason.indent |
number | 1 |
Indentation level for nested structures |
ason.delimiter |
string | `" | "` |
ason.useReferences |
boolean | true |
Enable $var reference deduplication |
ason.useSections |
boolean | true |
Enable @section organization for objects |
ason.useTabular |
boolean | true |
Enable key:[N]{fields} tabular format for arrays |
ason.autoShowStats |
boolean | true |
Show statistics after compression |
Compress data before sending to OpenAI, Claude, or other LLM APIs:
// Instead of sending 150 tokens
const json = {"users": [{"id": 1, "name": "Alice"}, ...]};
// Send 60 tokens (60% reduction)
const ason = "users:[2]{id,name}\n1|Alice\n...";Store more data in browser localStorage:
// Before: 2KB JSON
localStorage.setItem('data', JSON.stringify(data));
// After: 800 bytes ASON
localStorage.setItem('data', compressor.compress(data));Reduce bandwidth for API responses:
// Server compresses responses
app.get('/api/data', (req, res) => {
const ason = compressor.compress(data);
res.send(ason);
});You can add custom keyboard shortcuts in VS Code:
- Open Keyboard Shortcuts (
Cmd+K Cmd+S/Ctrl+K Ctrl+S) - Search for "ASON"
- Assign shortcuts (e.g.,
Cmd+Shift+Afor compress)
Example keybindings.json:
[
{
"key": "cmd+shift+a",
"command": "ason.compressSelection",
"when": "editorHasSelection"
},
{
"key": "cmd+shift+d",
"command": "ason.decompressSelection",
"when": "editorHasSelection"
}
]cd vscode-ason
npm install
npm run build- Open this folder in VS Code
- Press F5 to launch Extension Development Host
- Test commands in the new window
npm install -g @vscode/vsce
vsce packageThis creates a .vsix file you can install locally or publish to the marketplace.
ASON (Aliased Serialization Object Notation) is a token-optimized JSON compression format designed specifically for Large Language Models (LLMs).
Key Features:
- 20-60% token reduction on average
- 100% lossless round-trip fidelity
- Human-readable format
- Multiple compression techniques (uniform arrays, object references, value dictionary, path flattening)
Learn More:
To release a new version:
# Run the release script
./scripts/release.sh
# 1. Select version bump (patch/minor/major)
# 2. Update CHANGELOG.md when prompted
# 3. Confirm push
# GitHub Actions will automatically:
# - Build the extension
# - Create .vsix file
# - Create GitHub Release with .vsix attached
# Then manually publish to VS Code Marketplace:
npm run publishMIT Β© ASON Project Contributors
Contributions welcome! Please open an issue or pull request.
- GitHub: https://github.com/ason-format/vscode-extension
- Issues: https://github.com/ason-format/vscode-extension/issues
- ASON Core: https://github.com/ason-format/ason
- VS Code API: https://code.visualstudio.com/api