Embedded Chat¶
The embedded chat panel connects you to a Claude Opus agent scoped to your project's repository. It is designed for task creation, architecture review, and spec writing — not casual Q&A.
Opening the chat¶
Click the message-square icon in the topbar. The chat panel slides in as an overlay (full-screen on mobile, side panel on desktop with a maximize toggle).
Model policy¶
The chat is unconditionally pinned to claude-opus-4-7. There is no model selector. The reasoning: chat in this context drives spec creation and architectural decisions — tasks where quality and reasoning depth matter. Every spec the chat creates will be executed by a runner agent, so a low-quality spec is expensive to fix later.
The model version is displayed as a subtle badge in the chat header.
Sessions¶
Sessions are stored as NDJSON files at:
(Typically ~/.local/share/craft-easy-agentic/sessions/....)
Creating and switching sessions¶
- Click New session to start a fresh conversation.
- The session list in the sidebar shows all previous sessions, sorted by most recently updated.
- Sessions have auto-generated titles (from the first assistant message) and show cost and turn count.
Cross-device sync¶
When you continue a session from a different device (phone, laptop, etc.), the chat loads from the server's session store — same messages, same context. Any device that has the dashboard open receives a real-time notification when a session is updated elsewhere.
Working directory context¶
Each chat session is anchored to the project. The claude subprocess is spawned with:
- --permission-mode auto — can read files in the project
- Working directory set to the project's repo_root
- CLAUDE_CONFIG_DIR set per multi-account rotation (only Claude's own state is redirected; HOME is unchanged so gh, az, kubectl, git push over SSH all keep working)
The agent can read your source files, backlog, specs, and documentation to give context-aware answers. It cannot write outside what the trust level permits, but it can write files (create specs, update documents) when you ask it to.
Image attachments¶
Chat-Claude is multi-modal. Paste, drag-drop, file-picker and camera-capture all feed straight into the running conversation as real multi-modal input — Opus can reason about screenshots, mockups, and whiteboard photos without leaving the dashboard.
Inputs¶
| Input | How |
|---|---|
| Paste | Cmd/Ctrl+V on the textarea — accepts PNG, JPEG, WebP, GIF |
| Drag-drop | Drag an image onto the chat panel; an overlay confirms the drop target. Non-image drops show a red "Endast bilder stöds" overlay |
| File picker | Click the paperclip button; opens the OS file dialog |
| Camera | On touch devices a camera icon appears; uses <input capture="environment"> to launch the rear camera |
Limits¶
| Limit | Value |
|---|---|
| Per file | 10 MB |
| Per session | 100 MB |
| Per message | 10 images |
| Per dashboard upload toast | 25 MB total selected |
Limits are enforced both client-side (with toast feedback for rejected files) and server-side (returns 413 / 507 / 415 with a clear reason).
Storage¶
Attachments are persisted to $XDG_DATA_HOME/craft-easy-agentic/sessions/<slug>/<session-id>/attachments/ with directory mode 0700, file mode 0600. Filenames are UUID-based; Content-Type is verified by magic-bytes (a .png carrying a PHP payload is rejected with 415).
When a session is deleted (single or bulk), the attachments directory is wiped recursively — the same code path handles both flows.
Rendering¶
User messages render attachments as inline thumbnails (64×64). Click a thumbnail to open the lightbox: full-screen on mobile, centered modal on desktop, with Esc to close, arrow keys to navigate between attachments, swipe-down-to-close on mobile.
Historical replay (loading a previous session) reconstructs thumbnails from the persisted AttachmentRef records in the session NDJSON, so attachments survive across devices and across restarts.
Security¶
- Magic-bytes sniff blocks misleading Content-Type uploads.
- Path-traversal defence has two layers: filename regex (
^[a-f0-9-]+\.(png|jpe?g|webp|gif)$) plus slug/session-id validation. - Strict CSP on the serve route:
default-src 'none'; img-src 'self' data:; style-src 'unsafe-inline'. - Bearer token via header for POST, header-or-
?token-query for GET (so<img>tags work). - Same-origin check on POST as defence-in-depth.
Creating task specs in chat¶
The recommended workflow for creating new tasks:
- Open the chat for the target project.
- Ask Opus to create a spec for the feature you want.
- Opus reads the existing codebase, backlog, and framework conventions and writes a complete
tasks/<TASK-ID>/spec.md. - Opus selects the appropriate
**Modell:**field value based on task complexity. - Review the spec, ask for revisions, then add the task to BACKLOG.md.
- Start the runner — the new task will be picked up in the next wave.
Rendering¶
The chat renders:
| Content type | Rendering |
|---|---|
| Markdown | Full rendering with code highlighting, tables, headers |
| Code blocks | Syntax-highlighted with language detection and copy button |
| Tool use | Collapsed block showing tool name and input parameters |
| Tool results | Collapsed block showing output (truncated for large results) |
| Thinking | Collapsible "reasoning" block |
| Cost summary | Inline badge at end of each response |
Stop generation¶
A Stop button appears while the agent is responding. This sends a stop signal to the claude subprocess immediately.
Keyboard¶
| Key | Action |
|---|---|
Enter |
Send message |
Shift+Enter |
Newline in message input |
Escape |
Close chat panel |