Skip to content

feat: /squeez slash command (skill) to change squeez config from inside Claude — backed by a squeez config get/set CLI #149

@jhonatanjunio

Description

@jhonatanjunio

Problem

squeez is used inside an agent session, but every knob that controls how aggressive it is can only be changed outside that session, by hand-editing ~/.claude/squeez/config.ini ($SQUEEZ_DIR/config.ini).

There are ~60 tunables in Config (src/config.rs) — find_max_results, max_lines, summarize_threshold_lines, ultra_trigger_pct, adaptive_intensity, persona, lang, sig_mode_*, the nudge thresholds, etc. — and today the only way to touch any of them is:

  1. leave the conversation,
  2. open ~/.claude/squeez/config.ini in an editor,
  3. find/guess the right key name,
  4. save,
  5. come back.

This is backwards. If squeez feels too aggressive mid-task (e.g. it just collapsed an ls listing, or the persona is too terse), the user should be able to dial it down without leaving the console or the conversation.

Current state confirmed in code:

  • No config-mutation CLI. src/main.rs dispatches wrap/filter/track/init/compress-md/compress-prompt/setup/uninstall/update/benchmark/track-result/compress-output/mcp/calibrate/budget-params/protocol — there is no config get / config set / config list. (compact is a stub.)
  • MCP server is read-only. All 14 tools (src/commands/mcp_server.rs) read session state; none can write config.
  • No slash command / skill ships today. No .claude/commands/ assets in the repo; squeez setup installs hooks only.
  • Config is a flat key=value ini, parsed by Config::from_str (src/config.rs:198), loaded fresh on every invocation via Config::load() (src/config.rs:361).

Goal

Run /squeez from inside Claude Code (and the other supported hosts) to inspect and change squeez's behaviour in natural language:

  • "squeez is too aggressive" → relax the compression budgets.
  • "switch the persona to lite" / "turn the persona off" → set persona.
  • "bump find_max_results to 200" → set a specific key.
  • "show the current config" → list current values vs defaults.
  • "reset everything to defaults" → reset.

No editor, no leaving the conversation.

Why this needs two layers

A Claude Code slash command is just a prompt file — it has no way to safely mutate config.ini on its own (sed-editing an ini from a prompt is fragile and would silently corrupt the file). So the feature is two parts:

Layer 1 — squeez config CLI (the enabler)

Add a config subcommand that is the single safe path to read/write config.ini:

squeez config list                 # all keys: current value, default, source (default|file)
squeez config get <key>            # one value
squeez config set <key> <value>    # validate + write, preserving comments/unknown lines
squeez config reset [<key>]        # remove key (revert to default) or reset all
squeez config path                 # print the resolved config.ini path

Requirements:

  • Validation reuses the existing schema. set must reject unknown keys and type-invalid values (bool/usize/f32/enum) instead of writing garbage — leverage the same match arms Config::from_str already has, so the source of truth stays single.
  • Non-destructive writes. Preserve comments, blank lines, key order, and any keys the binary doesn't recognise. Create the file (and parent dir) if missing.
  • Machine-readable output (--json) so the skill can parse current state reliably.
  • Zero-dependency constraint stays. No TOML/serde crate — extend the existing hand-rolled ini handling (Cargo.toml is stdlib + libc only).

Layer 2 — /squeez skill

A /squeez command (markdown prompt) that squeez setup installs into each host's command dir where supported (.claude/commands/squeez.md for Claude Code; equivalent for Copilot/OpenCode/Gemini/Codex). The skill:

  1. runs squeez config list --json to read current state,
  2. maps the user's natural-language intent to concrete key changes,
  3. applies them with squeez config set ...,
  4. confirms what changed (old → new).

Effect-timing nuance (must be documented in the skill)

  • Compression knobs are live immediately. wrap calls Config::load() fresh per command, so find_max_results, max_lines, adaptive_intensity, thresholds, etc. take effect on the next bash command — no restart needed.
  • persona / lang are injected at SessionStart by init.rs into the CLAUDE.md <!-- squeez:start --> block. Changing them via config set updates the file, but the already-loaded session prompt won't change until the block is re-injected. The skill should re-run squeez init to rewrite the block and tell the user the persona change fully lands on the next session / /compact.

UX proposals (nice-to-have on top of raw get/set)

  • Presets / levels that bundle several knobs: e.g. squeez config preset gentle|balanced|aggressive mapping to sensible find_max_results / max_lines / ultra_trigger_pct / grouping bundles. "too aggressive" → gentle.
  • Quick toggles: enabled, persona off, adaptive_intensity on/off.
  • Diff view: config list highlights values that differ from defaults, so the user sees what they've changed.

Scope / constraints

  • Zero runtime dependencies (extend the existing ini parser; don't pull in a config crate).
  • Multi-host: setup should install the command for each detected host that supports user-defined slash commands; degrade gracefully where a host has no equivalent.
  • Validation errors must be human-readable (the skill surfaces them back to the user).

Acceptance criteria

  • squeez config get/set/list/reset/path implemented, with --json, key+type validation, and comment-preserving writes.
  • squeez config set persona lite && squeez config get persona round-trips; an invalid key/value exits non-zero with a clear message.
  • Changing a compression knob (e.g. find_max_results) takes effect on the next squeez wrap with no restart.
  • /squeez skill installed by squeez setup for Claude Code (and other hosts where supported), driving the above in natural language.
  • Persona/lang change path re-injects the CLAUDE.md block and documents the next-session timing.
  • Tests for the config writer (round-trip, comment preservation, invalid input rejection) under tests/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions