Skip to content

Conversation

@koaning
Copy link
Owner

@koaning koaning commented Aug 30, 2025

Summary

  • Refactors the procedural chat() function into a Chat class for better state management
  • Adds support for configurable modes (e.g., "plan", "normal", "debug") with different tool sets
  • Implements conversation replay when switching modes to maintain context
  • Adds new slash commands: /mode <name> and /modes
  • Maintains full backward compatibility with existing chat() function

Key Features

  • Mode System: Users can configure different modes with different tool subsets
  • Mode Switching: /mode <name> command switches modes and replays conversation history
  • UI Enhancements: Mode indicators in prompts, mode-aware help text
  • Backward Compatible: Existing usage patterns continue to work unchanged

API Examples

# Existing usage (still works)
chat(tools=[tool1, tool2])

# New Chat class (equivalent)
Chat(tools=[tool1, tool2]).run()

# New with modes
Chat(
    tools={
        "normal": [read_tool, write_tool, edit_tool],
        "plan": [read_tool, glob_tool, grep_tool]  # Read-only
    },
    mode_switch_messages={
        "plan": "You are now in plan mode. You can read and analyze but not write files."
    },
    initial_mode="normal"
).run()

Test Plan

  • Chat class initialization with various configurations
  • Mode switching logic with tool filtering
  • Backward compatibility with existing chat() function
  • New slash commands (/mode, /modes)
  • UI mode indicators and feedback

🤖 Generated with Claude Code

koaning and others added 2 commits August 30, 2025 22:22
- Convert procedural chat() function to Chat class
- Add support for configurable modes with different tool sets
- Implement mode switching with conversation replay
- Add new slash commands: /mode, /modes
- Maintain full backward compatibility with existing chat() function
- Add mode-aware UI indicators and help text

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants