Skip to content

PreCompact: the 100 ms budget is a system-jq figure, and custom_instructions is unprobed #32

Description

@jeremymanning

Residual from #8, which shipped in c06eb6c and is otherwise closed. Two gaps in the
measurement that shipped with it, both recorded in notes/OPEN-THREADS.md:179-203.

1. The 100 ms budget is a system-jq figure

hooks/precompact.sh was built against issue #8's 100 ms target and meets it on
/usr/bin/jq only. Medians over 15 runs against a 5 MB transcript, macOS 25.6.0,
2026-09-02, at the default 256 KB bound:

jq no candidate one candidate
/usr/bin/jq (jq-1.7.1-apple) 27.4 ms 86.3 ms
anaconda's jq-1.6 62.4 ms 147.9 ms

The difference is process starts rather than bytes: jq -n 1 medians 9.6 ms as the system
jq and 22.4 ms as jq-1.6, and this hook runs several programs. A user whose PATH resolves
jq to a slow build is 48 ms over budget on the candidate path. That is 0.1% of the
128-second median compaction the hook delays, which is why it shipped.

Two acceptable answers, and this issue is to pick one:

  • restate the budget as a system-jq figure everywhere it appears, or
  • shed a process so the slow build fits. tests/test_precompact.py::ProcessCountTest
    already pins the process count, so a change here is testable rather than a stopwatch
    argument.

Anyone with a jq-1.6 on PATH can re-derive both rows.

2. custom_instructions has only ever been observed null

Every probe recorded it empty (docs/CLAUDE-CODE-BEHAVIOR.md:510), so the populated shape,
and what a /compact <instructions> invocation puts in it, is unrecorded. Nothing in
hooks/precompact.sh reads the field, so this costs nothing today. It is a gap in the
platform record, and the probe is one /compact with an argument against a payload dump.

Acceptance

  • The 100 ms claim in hooks/precompact.sh and in notes/OPEN-THREADS.md either carries
    the jq build it was measured on, or a re-measurement on jq-1.6 that fits.
  • docs/CLAUDE-CODE-BEHAVIOR.md:510 records a populated custom_instructions, with the CLI
    version, or records that a populated one could not be produced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions