Skip to content

[FEATURE] Add /compact command #2

Closed
Closed

Description

@edenreich

Summary

Similar feature like we have in Claude code - /compact will allow a user to take whatever the chat was about in put it into a markdown file for future iterations.

Acceptance Criteria

  • There is a new command called /compact
  • When it is executed in the chat a new Markdown file will be created in a configured location (default to project level under .infer folder)
  • It's documented in the README.md

Activity

  1. added
    enhancement
    on Aug 10, 2025
  2. edenreich commented on Aug 10, 2025

    @edenreich
    ContributorAuthor

    @claude Can you work on this?

  3. claude commented on Aug 10, 2025

    @claude
    Contributor

    Claude finished @edenreich's task —— View job • claude/issue-2-20250810-0859 • Create PR ➔


    Implementation Complete! ✅

    I have successfully implemented the /compact command feature as requested in the GitHub issue.

    What Was Implemented

    ✅ New /compact command - Available in chat sessions to export conversation history
    ✅ Configurable output location - Defaults to .infer folder at project level
    ✅ Documentation updated - Both README.md and CLAUDE.md include the new feature

    Technical Details

    Files Modified:

    • config/config.go - Added CompactConfig structure and default settings
    • cmd/chat.go - Added /compact command handler and export functionality
    • CLAUDE.md - Updated configuration and command documentation
    • README.md - Added comprehensive documentation for the new feature

    Key Features:

    • 📝 Exports chat conversations to timestamped markdown files (chat-export-YYYYMMDD-HHMMSS.md)
    • 🔧 Configurable output directory via compact.output_dir config setting
    • 🤖 Supports all message types with proper role indicators (User, Assistant, System, Tool)
    • 🛠️ Includes tool calls and arguments with JSON syntax highlighting
    • 📊 Provides feedback with file paths and message counts
    • 🧹 Handles empty conversations gracefully

    Usage Example:

    # ~/.infer.yaml
    compact:
      output_dir: ".infer"  # Custom directory for exports

    In chat session:

    You: Hello, how are you?
    Assistant: I'm doing well, thank you!
    You: /compact
    📝 Conversation exported successfully to: /path/to/project/.infer/chat-export-20250810-090405.md
    📊 Exported 2 message(s) from chat session with gpt-4
    

    Quality Assurance

    • ✅ Code builds successfully
    • ✅ Passes linting checks
    • ✅ Follows project coding standards
    • ✅ Uses conventional commit format

    The feature is ready for use and meets all acceptance criteria specified in the issue.


  4. added a commit that references this issue on Aug 10, 2025
    f5380e8
  5. inference-gateway-releaser commented on Aug 10, 2025

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.2.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementreleased

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions