with one click
tune-synthesis-context
"
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
"
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
"
"
"
"
"
"
| name | tune-synthesis-context |
| description | " |
lib/synthesize.sh lines 87-250 — build_docs_context() and build_tooling_context().ultrainit/logs/synthesis-docs.stderr and .ultrainit/logs/synthesis-tooling.stderr — raw errors.ultrainit/findings/ — all findings files that get included in contexttail -50 .ultrainit/logs/synthesis-docs.stderr
tail -50 .ultrainit/logs/synthesis-tooling.stderr
context_length_exceeded → context is too large, reduce itestimate_tokens() in lib/synthesize.sh uses bytes/4 heuristic. Check actual file sizes:
# Largest findings files (Pass 1 context)
du -sh .ultrainit/findings/*.json | sort -rh | head -10
# Module analyses are often the largest
du -sh .ultrainit/findings/module-*.json | sort -rh
# Check total bytes of what goes into Pass 1 context
cat .ultrainit/findings/*.json | wc -c
Module analyses for unimportant directories inflate the context significantly. Remove individual low-value findings:
# List all module findings
ls .ultrainit/findings/module-*.json
# Remove one
rm .ultrainit/findings/module-<unimportant-dir>.json
Then re-run synthesis (the phase won't re-gather since gather is marked complete):
./ultrainit.sh --force /path/to/project
In lib/synthesize.sh, find build_docs_context() (lines 87-152). The function uses jq to extract specific fields. To reduce module analysis size, add field exclusions:
# Current: includes full module output
jq '. ' "$module_file"
# Reduced: exclude large arrays
jq 'del(.key_files, .domain_terms, .skill_opportunities)' "$module_file"
--skip-research to exclude Phase 3 findings./ultrainit.sh --skip-research /path/to/project
Domain research and MCP discovery findings can add significant tokens with low marginal value.
If Pass 2 is producing incomplete output (missing skills or hooks), check what build_tooling_context() excludes. Pass 2 intentionally omits key_files details, domain_terms, and skill_opportunities from module analyses to reduce tokens. If these are needed, edit lib/synthesize.sh lines 159-250 to include them.
Delete only synthesis outputs so the pipeline re-synthesizes without re-gathering:
rm .ultrainit/synthesis/output-docs.json
rm .ultrainit/synthesis/output-tooling.json
rm .ultrainit/synthesis/output.json
# Remove synthesis phase completion marker
jq 'del(.synthesize)' .ultrainit/state.json > /tmp/state.json && mv /tmp/state.json .ultrainit/state.json
# Rerun
./ultrainit.sh /path/to/project
# Verify synthesis completed
jq '.synthesize' .ultrainit/state.json
# Check output has expected artifact types
jq 'keys' .ultrainit/synthesis/output.json
jq '.skills | length' .ultrainit/synthesis/output.json
jq '.hooks | length' .ultrainit/synthesis/output.json
Budget is cumulative across retries — each synthesis retry costs money. After 3 retries, budget may be exhausted. Raise --budget or delete specific .cost files before tuning.
Deleting output files is not enough — you must also remove the phase completion marker from state.json, otherwise the pipeline skips synthesis even after deleting the output files.
estimate_tokens() uses bytes/4 — dense JSON has more tokens per byte than prose. Actual token count for findings files may be 1.5-2x the estimate.