Add chat history compaction feature with AI-based summarization #50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements chat history compaction using AI-based summarization techniques to enable longer conversations within token limits.
Features
Implementation Details
Usage
CYCOD - AI-powered Developer CLI, Version 1.0.0-DEV-r-20250909.0300+24133384b4920a9e84df3232942b956c7d8599d5
Copyright(c) 2025, Rob Chambers. All rights reserved.
Invalid argument: [options]
CYCOD CHAT COMPACT
Compact chat history files using AI-based summarization. This command
intelligently summarizes older parts of the conversation while preserving
important context, enabling much longer conversations within token limits.
USAGE: cycod chat compact [options]
ARGUMENTS
Chat history file to compact (required)
Can also be specified with --file
OPTIONS
--file Specify a chat history file to compact
--output Output file for the compacted history (default: original-name-compacted.jsonl)
--compact [mode] Specify compaction mode: full, simple, or none (default: full if --compact used without a mode)
--no-compact Disable compaction (same as --compact none)
--preserve-messages Number of recent messages to preserve intact (default: 4)
--preserve Same as --preserve-messages (for compatibility)
--max-tokens Maximum total chat tokens target (managed by CYCOD) (default: 160000)
--max-prompt-tokens Maximum prompt token target (managed by CYCOD) (default: 50000)
--max-tool-tokens Maximum tool token target (managed by CYCOD) (default: 50000)
COMPACTION MODES
For detailed information about compaction modes:
cycod help chat compaction modes
EXAMPLES
EXAMPLE 1: Compact a chat history file with default (full) mode
EXAMPLE 2: Use simple mode and specify output file
EXAMPLE 3: Preserve more recent messages and set token target
EXAMPLE 4: Set different token limits for different token types
EXAMPLE 5: Disable compaction
SEE ALSO
cycod help chat history
cycod help chat compaction modes
cycod help chat token management
cycod help settings
cycod help config
Related Issue
Closes #2509