compact
Reduce code token usage to extend AI context windows by compressing project files. Also supports editing, beautifying, expanding, and validating code.
Instructions
Compact code operations. Actions: compact_file|edit|compact_all|beautify|expand_file|expand_project|validate_pipeline|get_mode|set_mode
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fix | No | For validate_pipeline: auto-fix all style issues — generates .ctx documentation from readable code, then minifies (headers, imports, indentation, long names). Bidirectional: expand restores from .ctx. | |
| code | No | For edit: new code for the symbol | |
| mode | No | For set_mode: 1 (compact, recommended) or 2 (full) | |
| path | No | Path to file or directory | |
| action | Yes | Compact action to perform | |
| dryRun | No | Preview without modifying | |
| legend | No | For compact_file: include export legend | |
| strict | No | For validate_pipeline: report fns missing from .ctx | |
| symbol | No | For edit: function/class name to replace | |
| beautify | No | Beautify output (default: true) | |
| stripJSDoc | No | For set_mode: strip JSDoc when compacting | |
| autoValidate | No | For set_mode: auto-validate after edits |