Compress conversation context via arbiter logic
Extracts conversation facts into compressed logical statements for context preservation.
/plugin marketplace add ariaxhan/kernel-plugin/plugin install kernel@kernel-marketplaceWhen user invokes /arbiter-compact:
Analyze the current conversation and extract all factual knowledge in ARBITER SYNTAX.
Follow .claude/rules/arbiter-syntax.md strictly:
snake_case identifiers only& (and), | (or), ! (not), -> (implies), <-> (iff)# comments for readabilityExtract facts across these dimensions:
1. Project Setup
# Technologies/frameworks in use
use_<technology>
requires_<dependency>
version_constraint_<tool>
2. Architecture Decisions
# System design choices
api_is_<type>
database_is_<type>
auth_is_<method>
pattern_is_<pattern>
3. Coding Conventions
# Style and patterns
use_type_hints
use_<naming_convention>
require_<practice>
4. Access Control / Business Logic
# Permission rules
<condition> -> <capability>
<role> & <status> -> <permission>
5. API Contracts
# Endpoint behaviors
endpoint_<name>_returns_<format>
endpoint_<name>_requires_<condition>
6. Dependencies / Tooling
# Available tools and configs
has_<tool>
<tool>_<config>_enabled
7. File Locations / Structure
# Where things live (if relevant to future work)
tests_in_tests_dir
config_in_<location>
8. Decisions Made
# Explicit choices during conversation
decided_<decision>
rejected_<alternative>
Write extracted facts to /tmp/arbiter_extracted.txt
Run arbiter compression:
python3 .claude/tools/arbiter.py /tmp/arbiter_extracted.txt > /tmp/arbiter_compressed.txt
Compare results:
Present to user:
## Extracted Facts (N statements)
[show /tmp/arbiter_extracted.txt contents]
## Compressed Facts (M statements, X% reduction)
[show /tmp/arbiter_compressed.txt contents]
## Analysis
- Tautologies removed: [count]
- Redundancies removed: [count]
- Contradictions detected: [list if any]
## Next Steps
You can now use this compressed fact set as context seed.
To reset conversation with these facts, manually use:
/compact focus=<paste compressed facts>
Given conversation about setting up a FastAPI project with pytest:
Extracted (8 statements):
use_python
use_fastapi
use_pytest
use_sqlalchemy
database_is_postgres
authenticated -> can_read
admin & authenticated -> can_write
admin -> authenticated
Compressed (7 statements, 12.5% reduction):
use_python
use_fastapi
use_pytest
use_sqlalchemy
database_is_postgres
authenticated -> can_read
admin & authenticated -> can_write
Analysis:
admin -> authenticated is implied by admin & authenticated -> can_writeUse /arbiter-compact when you want to manually compress conversation context:
/compact focus=<facts>To enable automatic compression on every context compaction:
.claude/settings.json:{
"hooks": {
"PreCompact": [
{
"matcher": "*",
"hooks": [
{
"type": "prompt",
"prompt": "Extract conversation facts in arbiter syntax per .claude/rules/arbiter-syntax.md. Output ONLY logical statements, no prose."
}
]
}
]
}
}
How it works:
Benefits: