A plain-English, beginner-friendly walkthrough explaining every feature in the Agent Junky Tokenomics suite. Learn how to stop runaway session context bloat, prune dead terminal logs, audit entire codebases, and reset multi-turn agents with zero memory loss.
Follow these 4 simple steps inside your editor window:
agentjunky-vscode-1.2.2.vsix (or agentjunky-vscode-latest.vsix) file from your Downloads folder. If you prefer the command line, open your terminal and run the one-line command for your editor:
code --install-extension agentjunky-vscode-1.2.2.vsix cursor --install-extension agentjunky-vscode-1.2.2.vsix
Unlike rough "word count" estimates, Agent Junky uses real Byte-Pair Encoding (BPE) algorithms matching OpenAI (cl100k_base and o200k_base) and Anthropic Claude 3.7. As you type, edit, or open any file, the telemetry item in your status bar computes:
Counts tokens as the LLM's tokenizer actually perceives them. Code with many brackets and snake_case generates more tokens than English prose.
Measures chars/token (typically ~3.8 for English text and ~2.2 for dense JSON). Identifies bloated formatting.
Instantly shows how much it will cost to feed this file into Claude 3.7 Sonnet as context before you hit send.
The extension provides a rich interactive dashboard right inside your editor so you never have to leave your code to run diagnostics.
1. Press Ctrl+Shift+P (or Cmd+Shift+P on Mac) to open the Command Palette.
2. Type: Agent Junky: Open Tokenomics Dashboard and press Enter.
Monitors live Claude Code and Antigravity conversation sessions. Shows total turns, re-sent tokens, burn rate, and a 1-click button to trigger transcript surgery.
Scans your active folder, calculates total token weights, displays a multi-model price comparison, and ranks the top 15 heaviest files consuming your context.
Focuses on the currently open editor tab. Allows you to test lossless minification or AST skeletonization on code snippets with live token reduction previews.
Many developers assume that if they ask a small 4-word question like "fix the bug on line 12", the LLM only bills them for 4 words. This is completely false.
What makes up those 182,500 tokens? Zombie output. Terminal build outputs, 300 lines of passing unit tests from an hour ago, repeating git commit logs, and compiler warnings that were already solved. This dead baggage hogs the model's attention window, causing hallucinations and high latency.
Transcript Surgery (sessionPruner.ts) is a deterministic AST cleaner. It scans your conversation history, keeps recent turns untouched, and replaces older dead terminal outputs with concise 1-line semantic tombstones.
Agent Junky: Prune Active Session Transcript..bak file as a safety backup, removes the zombie logs, and displays the total tokens reclaimed.When you've been working with Claude Code or Cursor for hours and context approaches 100k+ tokens, native compaction triggers. Native compaction uses an LLM to write a summary of the chat. This often forgets edge cases or loses track of what you were just editing.
Agent Junky replaces this with Deterministic State Handover. It queries your actual Git index and IDE memory to generate a structured handover file called SESSION_STATE.md:
1. Run Agent Junky: Generate Session State Handover.
2. Start a fresh chat or clear context in your agent (/compact or new thread).
3. Send this single prompt: @SESSION_STATE.md Please review the handover state and continue on Task 3. Your agent instantly picks up right where you left off with zero hallucination and a fresh, cheap context window!
Before passing a whole codebase or folder into an agent with @folder or tool execution, audit its token weight. Often, a single auto-generated file (like openapi.json or a test fixture) can silently eat 60% of the entire token allowance.
Open Command Palette and run: Agent Junky: Audit Workspace Repository Tokens.
The auditor will scan all files, respect .gitignore, skip binaries/lockfiles, and print out the ranked heavyweights table and cost matrix across Claude 3.7 Sonnet, Haiku, GPT-4o, and Gemini Flash.
When an agent needs to know how to call code from another file, it only needs the function signatures, class declarations, argument types, and return types. It does not need 300 lines of internal SQL queries and loops.
export class UserService {
constructor(private db: Database) {}
async findUser(id: string): Promise<User> {
const query = "SELECT * FROM users WHERE id = ?";
const result = await this.db.query(query, [id]);
if (!result.rows.length) {
throw new UserNotFoundError(id);
}
return mapRowToUser(result.rows[0]);
}
} export class UserService {
constructor(private db: Database);
findUser(id: string): Promise<User>;
}
Open any TypeScript, JavaScript, or Python file and run Agent Junky: Skeletonize Active File (AST). A clean interface file will be copied to your clipboard ready to pass to your agent!
| Command Palette Name | Internal ID | What It Does |
|---|---|---|
| Open Tokenomics Dashboard | agentjunky.openTokenomicsDashboard | Opens the full 3-tab Command Center Webview. |
| Prune Active Session Transcript | agentjunky.pruneActiveSession | Detects zombie terminal outputs and replaces with tombstones. |
| Generate Session State Handover | agentjunky.generateStateHandover | Freezes active diffs and tasks into SESSION_STATE.md. |
| Audit Workspace Repository Tokens | agentjunky.auditWorkspaceTokens | Scans workspace tree, ranks heavy files, and prints cost table. |
| Count Tokens in Active File | agentjunky.countTokens | Returns precise BPE token count and char density for active tab. |
| Skeletonize Active File (AST) | agentjunky.skeletonizeActiveFile | Strips function and method bodies, leaving pure type interfaces. |
| Lossless Minify Selection | agentjunky.minifySelection | Removes indentation and excess whitespace from JSON/code. |
| Configure Claude Desktop MCP | agentjunky.configureClaudeDesktop | Automates adding the Agent Junky MCP server to Claude Desktop. |
| Inspect Claude Config File | agentjunky.inspectClaudeConfig | Opens claude_desktop_config.json directly in your editor. |
| View Seven Layers Blueprint | agentjunky.viewArchitectureBlueprint | Opens the Layer 1–7 production AI systems blueprint. |
| Test Local MCP Server | agentjunky.testLocalMcpServer | Pings local stdio harness and confirms all 4 tools respond. |
Absolutely not. Transcript Surgery only edits the internal conversation JSON/JSONL transcript file used by your AI agent (in your user app data folder). It never modifies your repository files, never commits to Git, and automatically saves a timestamped .bak file in the transcript directory before touching a single line.
Yes. If you ever want to revert a pruned transcript, locate the file with the same name ending in .bak and rename it back to the original filename.
Yes. All Byte-Pair Encoding tokenization, transcript pruning, AST skeletonization, and repository auditing run 100% locally on your machine in Node.js. No telemetry or code is sent to external servers.
You can test the full simulator live on our web platform at agentjunky.com/tokenomics. It includes the interactive 3-mode switcher with live pruning, repo auditing, and single-file minification.
Download v1.2.x or explore the interactive browser simulator.
Get practical thinking on agentic AI, enterprise architecture, RAG, and production governance delivered straight to your LinkedIn feed.
Need an architectural review, help transitioning an agent prototype to production, or designing governed tool gateways? Let's connect.