You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(mcp): optimize token consumption in MCP responses
- Add to_minimal_dict() and to_cycle_check_dict() to Feature model
- Use minimal serialization for cycle detection (~95% token reduction)
- Add minimal parameter to feature_get_ready/blocked (default True)
- Optimize feature_get_graph to query only needed columns
- Add spec_get_summary MCP tool (~800 tokens vs 12,500 full)
- Implement progressive history summarization in assistant chat
- Update coding prompt to recommend new token-efficient tools
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .claude/templates/coding_prompt.template.md
+16-2Lines changed: 16 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,8 +31,7 @@ Then use MCP tools to check feature status:
31
31
Use the feature_get_stats tool
32
32
```
33
33
34
-
Understanding the `app_spec.txt` is critical - it contains the full requirements
35
-
for the application you're building.
34
+
**NOTE:** Do NOT read `app_spec.txt` directly (12,500+ tokens). If you need project context, use `spec_get_summary` tool (~800 tokens) which returns project name, tech stack, ports, and overview.
36
35
37
36
### STEP 2: START SERVERS (IF NOT RUNNING)
38
37
@@ -363,6 +362,9 @@ feature_skip with feature_id={id}
363
362
364
363
# 7. Clear in-progress status (when abandoning a feature)
365
364
feature_clear_in_progress with feature_id={id}
365
+
366
+
# 8. Get condensed project spec (~800 tokens vs 12,500 full)
367
+
spec_get_summary
366
368
```
367
369
368
370
### RULES:
@@ -396,6 +398,18 @@ This allows you to fully test email-dependent flows without needing external ema
396
398
397
399
---
398
400
401
+
## TOKEN EFFICIENCY
402
+
403
+
To maximize context window usage:
404
+
405
+
-**Don't read files unnecessarily** - Feature details from `feature_get_by_id` contain everything you need
406
+
-**Be concise** - Short, focused responses save tokens for actual work
407
+
-**Use `feature_get_summary`** for status checks (lighter than `feature_get_by_id`)
408
+
-**Use `spec_get_summary`** for project context (~800 tokens vs 12,500 for full app_spec.txt)
409
+
-**Avoid re-reading large files** - Read once, remember the content
410
+
411
+
---
412
+
399
413
**Remember:** One feature per session. Zero console errors. All data from real database. Leave codebase clean before ending session.
0 commit comments