-
Notifications
You must be signed in to change notification settings - Fork 9
feat: add Claude Code remote server for iOS/web access #153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
basnijholt
wants to merge
9
commits into
main
Choose a base branch
from
feat/claude-code-remote-server
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add a FastAPI server that exposes Claude Code capabilities via REST and WebSocket,
enabling remote access from iOS Shortcuts, web interfaces, or any HTTP client.
Uses the official Claude Agent SDK which authenticates via existing Claude Code
subscription (after running `claude /login`).
Features:
- REST endpoints: /session/new, /session/{id}/prompt, /session/{id}/cancel
- WebSocket endpoint: /session/{id}/stream for real-time streaming
- Session management with conversation continuity (via resume parameter)
- Configurable allowed tools and permission modes
- New CLI command: `agent-cli claude-serve`
Install with: pip install agent-cli[claude]
- Extract _build_options helper to eliminate duplicated ClaudeAgentOptions construction - Remove unused _get_sdk_types function - Remove unused Session.messages field - Define DEFAULT_ALLOWED_TOOLS as module constant - Add 16 unit tests covering SessionManager, endpoints, and options builder
- Add ProjectManager with "In {project}," prefix parsing, sticky sessions,
and explicit project parameter support
- Add LogStore for conversation history with log_id-based retrieval
- Add /prompt endpoint with automatic session/project management
- Add /log/{id} and /logs endpoints for web UI viewing
- Add /projects and /switch-project endpoints
- Track file changes from Edit/Write/MultiEdit tool calls
- Configure projects via config.toml [claude_server] section
- Add comprehensive tests (29 total, all passing)
- Replace custom CSS with DaisyUI via CDN - Dark theme with cards, badges, tables - Collapsible full response section - Mobile-responsive layout
- Interactive chat interface with DaisyUI styling - Hold-to-record mic button for voice input - Configurable voice server URL for transcription - Project selector dropdown - Chat bubble UI with files_changed and log links - Mobile-friendly responsive layout
- Auto-generate self-signed SSL certificate on first use - Store certs in ~/.config/agent-cli/ssl/ - Required for voice recording on Safari/iOS (mediaDevices needs HTTPS) - Add better error handling when mediaDevices unavailable - Update endpoint display to show protocol
…missions - Add /logs/json endpoint for JSON log retrieval - Load conversation history on chat page load - Add explicit mic permission button for Safari/iOS - Add permission state tracking and improved UX feedback - Add per-file ruff ignore for S608 (HTML templates, not SQL)
- Replace custom JS chat handling with HTMX attributes - Add /chat/messages endpoint for loading history as HTML fragments - Add /chat/send endpoint for form submission returning HTML - Move all imports to top of file (no more inline imports) - Remove _check_claude_sdk() - assume SDK is installed - Add _render_message helper for consistent chat bubble HTML - Reduce JS from ~150 lines to ~70 (voice recording only)
- Add /chat/stream endpoint that streams response via Server-Sent Events - Update chat UI to show real-time streaming text as Claude responds - Show tool usage indicators during streaming (🔧 tool names) - Replace final streaming bubble with complete message including metadata - Simplify header: just clock icon for history, no text - Remove unused project selector code
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
agent-cli claude-serve --port 8765 --cwd /path/to/projectFeatures
/session/new,/session/{id}/prompt,/session/{id}/cancel/session/{id}/streamfor real-time streamingInstallation
Prerequisites
claude /loginonce to authenticate with your Claude.ai accountTest plan