Accessibility refinements to Claude Desktop
Project description
refined-claude
Accessibility refinements to Claude Desktop. OS X only.
Features
- 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.
Installation
Install this tool using pip:
uv tool install refined-claude
You will need to give Terminal permissions for Accessibility, if you haven't already. (System Settings -> Privacy & Security -> Accessibility -> +)
Usage
With a running instance of Claude Desktop, just run this in the background:
refined-claude
Or explicitly with the run subcommand:
refined-claude run
The 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).
Creating Accessibility Snapshots
To create a snapshot of the Claude application's accessibility tree for testing:
refined-claude snapshot --output snapshot.xml
Running in Test Mode
You can run the application in test mode using a previously created snapshot:
refined-claude run --test-mode snapshot.xml
This allows testing the application without requiring the real Claude application to be running.
Development
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 . --reinstall
Testing
To run the tests:
# Using pytest
pip install pytest pytest-xdist
pytest
# Or using the provided test command
test
Testing with Fake Accessibility APIs
The 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.
Testing State Changes with Mocking
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.
Troubleshooting
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file refined_claude-0.2.0.tar.gz.
File metadata
- Download URL: refined_claude-0.2.0.tar.gz
- Upload date:
- Size: 45.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0867fa24496230f74a41916394eff276c383930bba9252b6e275130a4b809d8e
|
|
| MD5 |
ffcc4d6aa7425cea767a097d966bc033
|
|
| BLAKE2b-256 |
0266b7ad7ed5271cff3cba77fc74205e482aa532c97bf47d99e7099ce5939723
|
File details
Details for the file refined_claude-0.2.0-py3-none-any.whl.
File metadata
- Download URL: refined_claude-0.2.0-py3-none-any.whl
- Upload date:
- Size: 33.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb6ccc32fe8081d60201cb5356c83000182a736da268ce25f1f6a87b20983164
|
|
| MD5 |
d22ffd572c8e0737404ea1edef18ea2b
|
|
| BLAKE2b-256 |
22d9e01e009ac6b0e35fd6a0fb57d69243c6663ae2a542905cb8c17a12439dac
|