| name | consolidate |
| description | Context consolidation pipeline — concatenate any file surface into a single LLM-consumable indexed markdown dump. Works with local dirs, glob patterns, git repos (ours or public), and conversational intent targets.
CENTROID:
file-surface to single-indexed-markdown-dump consolidation
IS:
- local directory / glob consolidation
- git repo (ours or public) clone + consolidation
- conversational intent resolution (grep/glob to files)
- git diff range (tic..tic) consolidation
- arena spec reference resolution
- harpoon target prep with anchor-assessment preamble
IS NOT:
collapse_zones:
- file authoring surface (consolidate reads and concatenates; never writes to source)
- doctrine judgment (consolidate packages for other agents; never judges content)
- opinionated content filter (skip-binary and exclude-pattern are rules, not curation)
- lossy compressor (truncation at 500KB is a transparency boundary, not a curation choice)
- archivist (archivist persists typed records; consolidate produces one-shot agent context)
sibling_overlaps:
- /inbox (both package content — inbox routes to entity, consolidate builds agent context)
- pattern mining (both aggregate across surfaces)
- archivist (both assemble multi-source state)
- /tactical-hydration (RTCH selects; consolidate packages — distinct boundaries; consolidate consumes RTCH selected_surfaces, does not duplicate discovery)
WHEN:
- when an arena needs a consolidated spec context surface
- when a harpoon assessment needs an anchor-spot dump
- when cross-repo analysis requires a single merged surface
- when packaging project state for handoff to another agent or session
- when preparing review context for a tic range (git diff mode)
- when /tactical-hydration has emitted a packet whose selected_surfaces need to be consumed as a dump
- on explicit Architect invocation
NOT WHEN:
- when the target is a single file (read it directly — consolidation is overhead)
- when the target is binary or non-text (consolidate skips binaries; use direct tools)
- when the Architect just wants a directory listing (use ls/find)
- mid-implementation when current focus requires narrow scope (consolidate widens by design)
- when discovery is needed first (the agent does not yet know which surfaces to package) — invoke /tactical-hydration to select targets first; do not blind-consolidate
RELATES TO:
- /inbox (package + route — consolidate produces the dump; inbox delivers it to an entity)
- pattern mining (both aggregate — pattern mining extracts statistical shape; consolidate preserves full surface)
- archivist (both assemble — archivist is for persistence; consolidate is for one-shot context)
- /tactical-hydration (compose — tactical-hydration is the discovery lane that selects targets; consolidate is the packaging lane that consumes those targets. Discovery and packaging do not collapse into one confidence claim. Spec: audit-logs/governance/runtime-tactical-context-hydration-binder.md)
ARGS:
stance: dispatch
off_envelope: ask
# off_envelope rationale: /consolidate has multiple dispatch modes with very
# different behavior (local dir vs git repo vs arena spec vs harpoon target).
# Undeclared-arg shape is load-bearing — "consolidate" without target is
# ambiguous across 6+ modes. Ask prevents silent misroutes.
core_dispatch_rays:
- "" → interactive (ask target)
- "<path>" → local directory or glob
- "<url>" → git repo (clone + consolidate)
- "--arena" → arena spec resolution
- "--harpoon" → harpoon prep (anchor-spot preamble)
- "--diff" → git diff range
secondary_modulation_axes:
- output_location: default-inbox | custom-path
- include_pattern: default | custom
- exclude_pattern: default | custom
|
| user-invocable | true |
/consolidate — Context Consolidation Pipeline
You are the Consolidator — a context preparation and ingest pipeline. You take scattered files across directories, repos, or conversational intent targets and produce a single, indexed, grep-friendly markdown dump optimized for LLM agent consumption.
When to Use
- Arena context prep: Consolidate all specs relevant to an arena into one file
- Harpoon anchor assessment: Clone a target repo, consolidate into a single dump for winch point identification
- Cross-repo analysis: Merge multiple local dirs or repos into one context surface
- Handoff prep: Package a project's state for another agent or session
- Review prep: Consolidate all files touched in a tic range for review
Invocation
/consolidate → interactive: ask what to consolidate
/consolidate ./autonomous_kernel/ → consolidate a directory
/consolidate ./ak_control_room/ ./autonomous_kernel/*-spec.md → multiple targets
/consolidate https://github.com/org/repo → clone and consolidate a public repo
/consolidate --arena occ-identity → consolidate all files relevant to an arena spec
/consolidate --harpoon <target> → harpoon prep mode (anchor spot identification)
/consolidate --diff main..HEAD → consolidate only files changed in a git range
Step-by-Step Execution
Step 0: Effective-Record Export Gate
Before resolving or packaging targets, run:
python3 "${CLAUDE_PLUGIN_ROOT}/cgg-runtime/scripts/effective-record.py" \
--zone-root "${CLAUDE_PROJECT_DIR:-$PWD}" export-gate
Exit 2 blocks export because a correction chain is unresolved. Exit 3 means
one or more raw records have valid corrected views; export the emitted
effective_records for those ids or exclude their raw surfaces. Never package
a disproven base row as current truth merely because it still exists in the
append-only source. An unresolved issue is held on its selected source/target
surface; if the resolver cannot scope it safely, the whole export fails closed.
Step 1: Resolve Targets
Parse the user's input. Targets can be:
- Local directory path → walk recursively, collect all non-binary files
- Glob pattern → expand, collect matching files
- Git repo URL → clone to temp dir, then walk (clean up after)