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.
Metadata
Release files for refined-claude 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| refined_claude-0.2.0.tar.gz | 45.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| refined_claude-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 78.5 kB
Release files / refined_claude-0.2.0.tar.gz
| Download URL | refined_claude-0.2.0.tar.gz |
|---|---|
| Size | 45.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0867fa24496230f74a41916394eff276c383930bba9252b6e275130a4b809d8e
|
|
BLAKE2b-256 checksum How to use checksums |
0266b7ad7ed5271cff3cba77fc74205e482aa532c97bf47d99e7099ce5939723
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.6
|
Release files / refined_claude-0.2.0-py3-none-any.whl
| Download URL | refined_claude-0.2.0-py3-none-any.whl |
|---|---|
| Size | 33.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eb6ccc32fe8081d60201cb5356c83000182a736da268ce25f1f6a87b20983164
|
|
BLAKE2b-256 checksum How to use checksums |
22d9e01e009ac6b0e35fd6a0fb57d69243c6663ae2a542905cb8c17a12439dac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.6
|
Security for refined-claude 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.