This repository was previously known as ezyang/refined-claude but it will be obsoleted by a browser extension variant.
Accessibility refinements to Claude Desktop. OS X only.
- Auto approve. Automatically approve tool usage requests. WARNING: MCP servers can take arbitrary actions, make sure you understand what actions your LLM may take in a chat and try to only install MCP servers which provide only safe/rollback-able operations.
- Auto continue. Automatically continue chats when they hit the reply size limit.
- Once-only warnings. Warning messages are only shown once per file location to reduce log noise.
- Snapshot accessibility tree. Create a snapshot of the Claude application's accessibility tree for testing purposes.
Install this tool using pip:
uv tool install refined-claudeYou will need to give Terminal permissions for Accessibility, if you haven't already. (System Settings -> Privacy & Security -> Accessibility -> +)
With a running instance of Claude Desktop, just run this in the background:
refined-claudeOr explicitly with the run subcommand:
refined-claude runThe CLI defaults to the 'run' command when no subcommand is specified.
You can disable various features using --no-auto-approve or --no-auto-continue. Use --no-default-features to disable all features by default (you can then selectively enable specific features as needed).
To create a snapshot of the Claude application's accessibility tree for testing:
refined-claude snapshot --output snapshot.xmlYou can run the application in test mode using a previously created snapshot:
refined-claude run --test-mode snapshot.xmlThis allows testing the application without requiring the real Claude application to be running.
Clone the repo and install the development version tool using pip:
git clone https://github.com/ezyang/refined-claude.git
cd refined-claude
uv tool install . --reinstallTo run the tests:
# Using pytest
pip install pytest pytest-xdist
pytest
# Or using the provided test command
testThe application includes a testing infrastructure that allows you to test functionality without requiring the real Claude application to be running. It works by:
- Creating a snapshot of the Claude application's accessibility tree using the
snapshotcommand - Using this snapshot with a fake implementation of the Accessibility APIs
To create a test that uses this infrastructure, see the example in tests/test_fake_accessibility.py.
For features that rely on state changes (such as notify_on_complete), we use a combination of:
- XML snapshots for the initial state
- Mocking for simulating state changes
This approach is demonstrated in tests/test_notify_on_complete_mocked.py, where we:
- Use a snapshot for the initial UI state
- Mock specific functions like
check_chat_running_stateto simulate state transitions - Test the logic that depends on these state changes
This pattern is particularly useful when testing features that respond to UI changes that are difficult to capture in static XML snapshots.
Sometimes, refined-claude will fail to find the WebView on your open window. This can happen if Claude is opened after you run refined-claude, or if you open refined-claude too soon after opening Claude. Unfortunately, the most reliable way to fix this problem is to restart refined-claude.