How emir/claude-s40 works
Claude S40 is a keypad-first Java ME Claude client for Nokia Series 40 phones, backed by a Go gateway that bridges the phone’s legacy TLS to the Claude API. The main workflow is setup/pairing, composing a request, server-side chat (optionally with web search), then displaying and paging the reply; chat history and device-local actions are separate branches. The README supplies capabilities not visible in the excerpts; those are mapped to exact tree paths without asserting unsampled call wiring.
Main entry points: main.go TLS gateway · Net.java Phone networking · ClaudeS40MIDlet.java MIDlet coordinator · chat.go Chat service
Components 20
Phone interface
- MIDlet coordinator
app/src/io/github/emir/claudes40/ClaudeS40MIDlet.java - Chat session
app/src/io/github/emir/claudes40/ChatSession.java - Chat display
app/src/io/github/emir/claudes40/ChatCanvas.java - Phone networking
app/src/io/github/emir/claudes40/Net.java
Phone features
- Setup and pairing
app/src/io/github/emir/claudes40/Setup.java - Settings and backup
app/src/io/github/emir/claudes40/Settings.java - Chat lists
app/src/io/github/emir/claudes40/ChatList.java - Saved replies
app/src/io/github/emir/claudes40/SavedList.java - Calendar and tasks
app/src/io/github/emir/claudes40/CalendarForm.java - Phone PIM
app/src/io/github/emir/claudes40/Pim.java
Gateway
- TLS gateway
server/main.go - Wire protocol
server/protocol.go - Input sanitizing
server/sanitize.go
Chat backend
- Chat service
server/chat.go - Claude API client
server/claude.go - SQLite store
server/store.go
Other components
- Phone user
- Claude API
- SQLite database
- Phone calendar
Connections 20
- Phone user → MIDlet coordinator: uses
- MIDlet coordinator → Chat session: creates
- MIDlet coordinator → Chat display: shows
- Chat display → Chat session: renders state
- Chat session → Phone networking: sends requests
- Setup and pairing → Phone networking: tests and pairs
- Phone networking → TLS gateway: HTTPS requests
- TLS gateway → Wire protocol: encodes replies
- TLS gateway → Input sanitizing: validates input
- TLS gateway → Chat service: dispatches chat
- TLS gateway → SQLite store: dispatches history
- Chat service → Claude API client: requests completion
- Claude API client → Claude API: HTTPS completion
- Chat service → SQLite store: reads and writes chats
- SQLite store → SQLite database: persists data
- Chat lists → Phone networking: loads chats
- Saved replies → Phone user: offers offline reading
- Calendar and tasks → Phone PIM: commits entry
- Phone PIM → Phone calendar: writes event or task
- Settings and backup → Phone user: stores preferences