Skip to content

Commit 52640ad

Browse files
authored
Merge pull request #509 from manojmallick/feat/budget-ledger-508
feat(tracking,mcp): sigmap budget — session spend ledger + get_budget (F1, v8.23)
2 parents 65a6b31 + 4d4f93d commit 52640ad

25 files changed

Lines changed: 617 additions & 36 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Use SigMap with open-source tools and fully self-hosted setups:
222222
| **JetBrains** | [Marketplace](https://plugins.jetbrains.com/plugin/31109-sigmap--ai-context-engine/) | [github.com/manojmallick/sigmap-jetbrains](https://github.com/manojmallick/sigmap-jetbrains) | IntelliJ IDEA, WebStorm, PyCharm, GoLand — tool window + actions |
223223
| **Neovim** | lazy.nvim / packer / vim-plug | [github.com/manojmallick/sigmap.nvim](https://github.com/manojmallick/sigmap.nvim) | `:SigMap`, `:SigMapQuery` float window, statusline widget |
224224

225-
**MCP server**20 on-demand tools for Claude Code and Cursor:
225+
**MCP server**21 on-demand tools for Claude Code and Cursor:
226226

227227
```bash
228228
sigmap --mcp
@@ -269,7 +269,7 @@ SigMap treats coding agents as **consumers, not competitors**: it hands them a d
269269

270270
| Agent | One-time setup | How it consumes SigMap |
271271
|---|---|---|
272-
| **Claude Code** | `sigmap mcp install claude` | 20 MCP tools (`search_signatures`, `get_lines`, `get_diff_context`, `squeeze_output`…) |
272+
| **Claude Code** | `sigmap mcp install claude` | 21 MCP tools (`search_signatures`, `get_lines`, `get_diff_context`, `squeeze_output`…) |
273273
| **Cursor** | `sigmap mcp install cursor` | MCP tools, plus the `cursor` adapter writes `.cursorrules` |
274274
| **Cline** | `sigmap mcp install cursor` | Reads `.cursorrules`; same MCP server |
275275
| **Continue** | `sigmap mcp install vscode` | MCP tools inside the Continue extension |

docs-vp/guide/mcp.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: MCP server setup
3-
description: Set up the SigMap MCP server for Claude Code, Cursor, and Windsurf. On-demand codebase access with 20 tools over stdio. Zero npm install.
3+
description: Set up the SigMap MCP server for Claude Code, Cursor, and Windsurf. On-demand codebase access with 21 tools over stdio. Zero npm install.
44
head:
55
- - meta
66
- property: og:title
@@ -22,7 +22,7 @@ head:
2222

2323
Give Claude Code, Cursor, and Windsurf on-demand access to your codebase signatures. Zero npm install.
2424

25-
The SigMap MCP server exposes 20 tools over the stdio Model Context Protocol. Your AI agent calls only what it needs — keeping token costs low.
25+
The SigMap MCP server exposes 21 tools over the stdio Model Context Protocol. Your AI agent calls only what it needs — keeping token costs low.
2626

2727
> **Setup time: under 2 minutes.** Use `sigmap --setup` for automatic configuration.
2828
@@ -99,7 +99,7 @@ Stack both MCP servers for the two-layer context strategy — SigMap for always-
9999
## 11 available tools
100100

101101
::: tip New in v6.3.0 — native tool registration
102-
Claude Code and Codex now receive the full tool list at MCP startup without a discovery round-trip. The server declares all 20 tools in the `initialize` response, so your AI sees them immediately. No config change needed — upgrade via `npm install -g sigmap@latest`.
102+
Claude Code and Codex now receive the full tool list at MCP startup without a discovery round-trip. The server declares all 21 tools in the `initialize` response, so your AI sees them immediately. No config change needed — upgrade via `npm install -g sigmap@latest`.
103103
:::
104104

105105
All tools are available on-demand — your AI agent calls only what it needs.

docs-vp/public/llms-full.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Cursor, GitHub Copilot, Aider, Windsurf, local LLMs, and MCP.
2626
| Task-success proxy (modeled) | — | 64.8% |
2727
| Prompts per task | 2.84 | 1.53 (46.1% fewer) |
2828
| Supported languages | — | 33 |
29-
| MCP tools | — | 20 |
29+
| MCP tools | — | 21 |
3030
| npm runtime dependencies | — | 0 |
3131

3232
---
@@ -125,6 +125,8 @@ sigmap evidence "<query>" --markdown Emit the Markdown handoff rendering to
125125
sigmap evidence "<query>" --top <n> --budget <n> --out <path> Tune ranked files / token budget / write rendered output
126126
sigmap memory List cross-session stores (.context/) — entries, size, age
127127
sigmap memory --clear <store> Clear one store: session|notes|weights|evidence|all (--json supported)
128+
sigmap budget Session spend ledger — estimated SigMap-emitted tokens, budget, context age (--json)
129+
sigmap budget --budget <tokens> One-off budget override (config: sessionBudgetTokens, contextTtlDays)
128130
sigmap note "<text>" Append a note to the cross-session decision log
129131
sigmap note List recent notes (also: note --list <N>)
130132
sigmap status Show repo state — branch, dirty files, index freshness, notes
@@ -138,7 +140,7 @@ sigmap --version Show version
138140

139141
---
140142

141-
## MCP server — 20 tools
143+
## MCP server — 21 tools
142144

143145
Start with `sigmap --mcp` (stdio JSON-RPC). Configure once:
144146

@@ -306,6 +308,14 @@ Compress noisy tool, command, or agent output before it enters context — a sta
306308
Input: { content: string }
307309
```
308310

311+
### get_budget
312+
313+
Session spend ledger — estimated tokens SigMap has emitted this session (chars/4 estimates from the local gain log), optional budget remaining, and context freshness. Scope honesty: counts only SigMap output, NOT the whole chat's spend. Check this mid-session and degrade gracefully when near budget: prefer terse encoding, squeeze large outputs, summarize-then-drop context. Local-only; no LLM, no network.
314+
315+
```
316+
Input: { session?: string, budgetTokens?: number }
317+
```
318+
309319
---
310320

311321
## Configuration (gen-context.config.json)
@@ -334,6 +344,8 @@ watchDebounce = 300
334344
routing = false
335345
format = default
336346
tracking = false
347+
sessionBudgetTokens = null
348+
contextTtlDays = null
337349
mcp = {"autoRegister":true}
338350
depMap = true
339351
versionPins = true

docs-vp/public/llms.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Cursor, GitHub Copilot, Aider, Windsurf, local LLMs, and MCP.
2929
- Token reduction: 96.8% average across benchmark repos
3030
- Task-success proxy: 64.8% (modeled from retrieval tiers, not measured LLM sessions)
3131
- Prompts per task: 1.53 vs 2.84 baseline (46.1% fewer, modeled)
32-
- Languages: 33 supported · MCP tools: 20
32+
- Languages: 33 supported · MCP tools: 21
3333
- Dependencies: zero npm runtime dependencies · fully offline
3434

3535
## Quick start

0 commit comments

Comments
 (0)