import { useState, useEffect, useRef, useCallback } from "react"; interface Props { instructions: string; disabled: boolean; onSave: (instructions: string) => Promise; onClose: () => void; } export default function ClaudeInstructionsModal({ instructions: initial, disabled, onSave, onClose }: Props) { const [instructions, setInstructions] = useState(initial); const overlayRef = useRef(null); const textareaRef = useRef(null); useEffect(() => { textareaRef.current?.focus(); }, []); useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { if (e.key === "Escape") onClose(); }; document.addEventListener("keydown", handleKeyDown); return () => document.removeEventListener("keydown", handleKeyDown); }, [onClose]); const handleOverlayClick = useCallback( (e: React.MouseEvent) => { if (e.target === overlayRef.current) onClose(); }, [onClose], ); const handleBlur = async () => { try { await onSave(instructions); } catch (err) { console.error("Failed to update Claude instructions:", err); } }; return (

Claude Instructions

Per-project instructions for Claude Code (written to ~/.claude/CLAUDE.md in container)

{disabled && (
Container must be stopped to change Claude instructions.
)}