| <!DOCTYPE html>
|
| <html lang="es">
|
| <head>
|
| <meta charset="UTF-8" />
|
| <meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| <title>Claude Code Master 2026 - Podcast + Chatbot</title>
|
| <link rel="preconnect" href="https://fonts.googleapis.com" />
|
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
| <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:wght@500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
|
| <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/github-dark.min.css" />
|
| <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/highlight.min.js"></script>
|
| <style>
|
| :root {
|
| --bg: #0a0d12;
|
| --bg-panel: #11161e;
|
| --bg-elev: #19202a;
|
| --bg-hover: #1f2731;
|
| --border: #28303d;
|
| --border-soft: #1d242f;
|
| --text: #e6edf3;
|
| --text-dim: #8b949e;
|
| --text-bright: #f0f6fc;
|
| --accent: #d97757;
|
| --accent-soft: rgba(217, 119, 87, 0.12);
|
| --accent-strong: #c5663f;
|
| --accent-2: #b07ee5;
|
| --user-bg: #1f2937;
|
| --code-bg: #06090d;
|
| --success: #3fb950;
|
| --danger: #f85149;
|
| --warning: #d29922;
|
| --shadow: 0 4px 32px rgba(0, 0, 0, 0.45);
|
| --shadow-soft: 0 2px 14px rgba(0, 0, 0, 0.3);
|
| --gradient-cover: linear-gradient(135deg, #d97757 0%, #b07ee5 50%, #6366f1 100%);
|
| }
|
|
|
| * { box-sizing: border-box; margin: 0; padding: 0; }
|
|
|
| html, body {
|
| background: var(--bg);
|
| color: var(--text);
|
| font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
|
| font-size: 15px;
|
| line-height: 1.6;
|
| scroll-behavior: smooth;
|
| }
|
| body {
|
| min-height: 100vh;
|
| background:
|
| radial-gradient(ellipse at top, rgba(217, 119, 87, 0.08) 0%, transparent 50%),
|
| radial-gradient(ellipse at 80% 30%, rgba(176, 126, 229, 0.06) 0%, transparent 60%),
|
| var(--bg);
|
| }
|
|
|
| button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
|
| a { color: var(--accent); text-decoration: none; }
|
| a:hover { text-decoration: underline; }
|
|
|
|
|
| .topbar {
|
| position: sticky; top: 0; z-index: 50;
|
| display: flex; align-items: center; justify-content: space-between;
|
| padding: 14px 32px;
|
| background: rgba(10, 13, 18, 0.85);
|
| backdrop-filter: blur(18px);
|
| border-bottom: 1px solid var(--border-soft);
|
| }
|
| .topbar-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
|
| .topbar-brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
|
| .topbar-brand .meta { font-weight: 400; color: var(--text-dim); font-size: 12px; margin-left: 6px; }
|
| .topbar-actions { display: flex; gap: 8px; align-items: center; }
|
| .topbar-actions a, .topbar-actions button {
|
| background: transparent; border: 1px solid var(--border);
|
| color: var(--text-dim); padding: 6px 12px; border-radius: 8px;
|
| font-size: 12.5px; cursor: pointer; transition: all 0.15s;
|
| text-decoration: none;
|
| }
|
| .topbar-actions a:hover, .topbar-actions button:hover {
|
| color: var(--text); border-color: var(--accent); text-decoration: none;
|
| }
|
| .key-pill { display: flex; align-items: center; gap: 6px; }
|
| .key-pill .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
|
| .key-pill.ok .pulse { background: var(--success); box-shadow: 0 0 6px var(--success); }
|
|
|
|
|
| .hero {
|
| display: grid;
|
| grid-template-columns: minmax(320px, 380px) 1fr;
|
| gap: 48px;
|
| max-width: 1200px;
|
| margin: 0 auto;
|
| padding: 64px 32px 56px;
|
| align-items: center;
|
| }
|
| .cover {
|
| position: relative;
|
| aspect-ratio: 1 / 1;
|
| width: 100%;
|
| border-radius: 16px;
|
| overflow: hidden;
|
| box-shadow:
|
| var(--shadow),
|
| 0 0 80px rgba(217, 119, 87, 0.22);
|
| background: var(--bg-panel);
|
| }
|
| .cover img {
|
| width: 100%;
|
| height: 100%;
|
| object-fit: cover;
|
| display: block;
|
| }
|
| .cover .ep-tag {
|
| position: absolute; top: 14px; left: 14px;
|
| background: rgba(0, 0, 0, 0.65);
|
| backdrop-filter: blur(8px);
|
| color: white;
|
| font-size: 10px;
|
| font-weight: 600;
|
| text-transform: uppercase;
|
| letter-spacing: 1.5px;
|
| padding: 5px 10px;
|
| border-radius: 999px;
|
| border: 1px solid rgba(255, 255, 255, 0.15);
|
| z-index: 2;
|
| display: none;
|
| }
|
|
|
| .hero-info { max-width: 640px; }
|
| .hero-info .eyebrow {
|
| display: inline-flex; align-items: center; gap: 8px;
|
| font-size: 11px;
|
| font-weight: 600;
|
| text-transform: uppercase;
|
| letter-spacing: 2px;
|
| color: var(--accent);
|
| margin-bottom: 18px;
|
| }
|
| .hero-info .eyebrow::before { content: '◉'; font-size: 10px; }
|
|
|
| .hero-info h1 {
|
| font-family: 'Source Serif 4', serif;
|
| font-weight: 700;
|
| font-size: clamp(34px, 4vw, 52px);
|
| line-height: 1.05;
|
| letter-spacing: -0.02em;
|
| margin-bottom: 18px;
|
| color: var(--text-bright);
|
| }
|
| .hero-info h1 .accent {
|
| background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
|
| -webkit-background-clip: text;
|
| background-clip: text;
|
| -webkit-text-fill-color: transparent;
|
| }
|
| .hero-info .lede {
|
| font-size: 17px;
|
| color: var(--text-dim);
|
| line-height: 1.55;
|
| margin-bottom: 28px;
|
| max-width: 560px;
|
| }
|
| .hero-info .meta-row {
|
| display: flex; gap: 18px; margin-bottom: 28px;
|
| font-size: 13px; color: var(--text-dim);
|
| flex-wrap: wrap;
|
| }
|
| .hero-info .meta-row span { display: flex; align-items: center; gap: 6px; }
|
| .hero-info .meta-row strong { color: var(--text); font-weight: 600; }
|
|
|
| .player {
|
| background: var(--bg-panel);
|
| border: 1px solid var(--border);
|
| border-radius: 14px;
|
| padding: 18px 20px;
|
| box-shadow: var(--shadow-soft);
|
| margin-bottom: 22px;
|
| }
|
| .player audio {
|
| width: 100%;
|
| height: 44px;
|
| border-radius: 8px;
|
| filter: invert(0.92) hue-rotate(180deg);
|
| }
|
| .player .player-foot {
|
| display: flex; justify-content: space-between; align-items: center;
|
| margin-top: 12px;
|
| font-size: 11px;
|
| color: var(--text-dim);
|
| }
|
| .player .player-foot .speed-buttons { display: flex; gap: 4px; }
|
| .player .player-foot .speed-buttons button {
|
| background: var(--bg-elev);
|
| border: 1px solid var(--border-soft);
|
| color: var(--text-dim);
|
| padding: 3px 10px;
|
| border-radius: 6px;
|
| font-size: 11px;
|
| cursor: pointer;
|
| font-family: 'JetBrains Mono', monospace;
|
| }
|
| .player .player-foot .speed-buttons button.active {
|
| background: var(--accent-soft); border-color: var(--accent); color: var(--accent);
|
| }
|
|
|
| .hero-cta {
|
| display: flex; gap: 10px; flex-wrap: wrap;
|
| }
|
| .btn {
|
| display: inline-flex; align-items: center; gap: 8px;
|
| padding: 11px 18px;
|
| border-radius: 10px;
|
| font-size: 14px;
|
| font-weight: 500;
|
| cursor: pointer;
|
| border: none;
|
| text-decoration: none;
|
| transition: all 0.15s;
|
| }
|
| .btn-primary {
|
| background: var(--accent);
|
| color: white;
|
| }
|
| .btn-primary:hover {
|
| background: var(--accent-strong);
|
| transform: translateY(-1px);
|
| box-shadow: 0 4px 14px rgba(217, 119, 87, 0.4);
|
| }
|
| .btn-secondary {
|
| background: var(--bg-elev);
|
| color: var(--text);
|
| border: 1px solid var(--border);
|
| }
|
| .btn-secondary:hover { border-color: var(--accent); color: var(--text-bright); }
|
|
|
|
|
| .invite {
|
| max-width: 1200px;
|
| margin: 64px auto 24px;
|
| padding: 0 32px;
|
| }
|
| .section-header {
|
| margin-bottom: 28px;
|
| max-width: 720px;
|
| }
|
| .section-header h2 {
|
| font-family: 'Source Serif 4', serif;
|
| font-size: 32px;
|
| font-weight: 600;
|
| letter-spacing: -0.01em;
|
| margin-bottom: 10px;
|
| color: var(--text-bright);
|
| }
|
| .section-header p {
|
| color: var(--text-dim);
|
| font-size: 16px;
|
| line-height: 1.5;
|
| }
|
|
|
| .topic-grid {
|
| display: grid;
|
| grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
| gap: 12px;
|
| margin-bottom: 36px;
|
| }
|
| .topic-card {
|
| background: var(--bg-panel);
|
| border: 1px solid var(--border-soft);
|
| border-radius: 12px;
|
| padding: 18px 20px;
|
| cursor: pointer;
|
| text-align: left;
|
| transition: all 0.18s;
|
| position: relative;
|
| overflow: hidden;
|
| }
|
| .topic-card::before {
|
| content: '';
|
| position: absolute; top: 0; left: 0; right: 0; height: 3px;
|
| background: var(--accent);
|
| transform: scaleX(0);
|
| transform-origin: left;
|
| transition: transform 0.25s;
|
| }
|
| .topic-card:hover {
|
| border-color: var(--accent);
|
| transform: translateY(-2px);
|
| box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
|
| }
|
| .topic-card:hover::before { transform: scaleX(1); }
|
| .topic-card .card-label {
|
| font-size: 10px;
|
| font-weight: 700;
|
| text-transform: uppercase;
|
| letter-spacing: 1.5px;
|
| color: var(--accent);
|
| margin-bottom: 6px;
|
| }
|
| .topic-card .card-title {
|
| font-size: 14.5px;
|
| font-weight: 500;
|
| color: var(--text-bright);
|
| margin-bottom: 6px;
|
| line-height: 1.35;
|
| }
|
| .topic-card .card-hint {
|
| font-size: 12px;
|
| color: var(--text-dim);
|
| }
|
|
|
|
|
| #chat-section {
|
| max-width: 1200px;
|
| margin: 0 auto;
|
| padding: 0 32px 64px;
|
| }
|
| .chat-shell {
|
| display: grid;
|
| grid-template-columns: 280px 1fr;
|
| background: var(--bg-panel);
|
| border: 1px solid var(--border);
|
| border-radius: 16px;
|
| overflow: hidden;
|
| height: 80vh;
|
| min-height: 600px;
|
| box-shadow: var(--shadow);
|
| }
|
| .chat-sidebar {
|
| background: var(--bg-elev);
|
| border-right: 1px solid var(--border);
|
| overflow-y: auto;
|
| padding: 16px 14px;
|
| }
|
| .chat-sidebar h3 {
|
| font-size: 10px;
|
| text-transform: uppercase;
|
| letter-spacing: 1.4px;
|
| color: var(--text-dim);
|
| margin: 8px 4px 10px;
|
| font-weight: 700;
|
| }
|
| .topic-filter { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 18px; }
|
| .topic-pill {
|
| background: transparent;
|
| border: 1px solid var(--border-soft);
|
| color: var(--text-dim);
|
| padding: 3px 9px;
|
| border-radius: 999px;
|
| font-size: 10.5px;
|
| cursor: pointer;
|
| transition: all 0.15s;
|
| white-space: nowrap;
|
| }
|
| .topic-pill:hover { color: var(--text); border-color: var(--border); }
|
| .topic-pill.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 500; }
|
|
|
| .article-list { display: flex; flex-direction: column; gap: 4px; }
|
| .article {
|
| padding: 9px 11px;
|
| border-radius: 8px;
|
| cursor: pointer;
|
| transition: background 0.12s;
|
| display: block;
|
| text-decoration: none;
|
| color: inherit;
|
| }
|
| .article:hover { background: var(--bg-hover); text-decoration: none; }
|
| .article.dimmed { opacity: 0.32; }
|
| .article-title {
|
| font-weight: 500;
|
| font-size: 12.5px;
|
| color: var(--text-bright);
|
| line-height: 1.32;
|
| margin-bottom: 3px;
|
| }
|
| .article-meta {
|
| font-size: 10.5px;
|
| color: var(--text-dim);
|
| display: flex; gap: 6px; align-items: center;
|
| }
|
| .article-meta .badge {
|
| background: var(--accent-soft); color: var(--accent);
|
| padding: 1px 5px; border-radius: 3px; font-size: 9.5px; font-weight: 600;
|
| text-transform: uppercase; letter-spacing: 0.5px;
|
| }
|
| .article-meta .badge.community { background: rgba(139, 148, 158, 0.15); color: var(--text-dim); }
|
|
|
| .chat-main {
|
| display: flex; flex-direction: column;
|
| background: var(--bg);
|
| overflow: hidden;
|
| }
|
| .chat-header {
|
| padding: 14px 22px;
|
| border-bottom: 1px solid var(--border-soft);
|
| display: flex; justify-content: space-between; align-items: center;
|
| background: var(--bg-panel);
|
| }
|
| .chat-header .title-row { display: flex; align-items: center; gap: 10px; }
|
| .chat-header h3 { font-size: 13.5px; font-weight: 600; }
|
| .chat-header .badge-live {
|
| display: inline-flex; align-items: center; gap: 5px;
|
| font-size: 10px; color: var(--text-dim); font-weight: 500;
|
| }
|
| .chat-header .badge-live::before {
|
| content: ''; width: 6px; height: 6px; border-radius: 50%;
|
| background: var(--success); box-shadow: 0 0 6px var(--success);
|
| }
|
| .chat-header select {
|
| background: var(--bg-elev);
|
| border: 1px solid var(--border);
|
| border-radius: 6px;
|
| padding: 5px 10px;
|
| color: var(--text);
|
| font-size: 12px;
|
| }
|
|
|
| .messages {
|
| flex: 1; overflow-y: auto;
|
| padding: 24px 0;
|
| }
|
|
|
| .empty-chat {
|
| max-width: 520px;
|
| margin: 60px auto 0;
|
| text-align: center;
|
| padding: 0 24px;
|
| color: var(--text-dim);
|
| font-size: 14px;
|
| }
|
| .empty-chat strong { color: var(--text); display: block; margin-bottom: 6px; }
|
|
|
| .message {
|
| max-width: 760px;
|
| margin: 0 auto 20px;
|
| padding: 0 22px;
|
| display: flex; gap: 12px;
|
| }
|
| .message.user { flex-direction: row-reverse; }
|
| .message .avatar {
|
| width: 30px; height: 30px;
|
| border-radius: 50%;
|
| display: flex; align-items: center; justify-content: center;
|
| font-size: 12.5px;
|
| font-weight: 700;
|
| flex-shrink: 0;
|
| }
|
| .message.user .avatar { background: var(--user-bg); color: var(--text-bright); }
|
| .message.assistant .avatar {
|
| background: var(--gradient-cover); color: white;
|
| font-family: 'Source Serif 4', serif;
|
| }
|
| .message .bubble { flex: 1; min-width: 0; }
|
| .message.user .bubble { text-align: right; }
|
| .message.user .bubble-content {
|
| display: inline-block;
|
| background: var(--user-bg);
|
| padding: 9px 13px;
|
| border-radius: 12px 12px 2px 12px;
|
| text-align: left;
|
| max-width: 100%;
|
| word-wrap: break-word;
|
| font-size: 14px;
|
| }
|
| .message.assistant .bubble-content { background: transparent; font-size: 14px; }
|
| .bubble-content h1, .bubble-content h2, .bubble-content h3 { margin: 14px 0 6px; color: var(--text-bright); font-weight: 600; }
|
| .bubble-content h1 { font-size: 18px; }
|
| .bubble-content h2 { font-size: 16px; }
|
| .bubble-content h3 { font-size: 14.5px; }
|
| .bubble-content p { margin: 7px 0; }
|
| .bubble-content ul, .bubble-content ol { margin: 7px 0 7px 22px; }
|
| .bubble-content li { margin: 3px 0; }
|
| .bubble-content code {
|
| background: var(--code-bg);
|
| padding: 2px 5px;
|
| border-radius: 4px;
|
| font-family: 'JetBrains Mono', monospace;
|
| font-size: 0.86em;
|
| color: var(--accent);
|
| }
|
| .bubble-content pre {
|
| background: var(--code-bg);
|
| border: 1px solid var(--border-soft);
|
| border-radius: 8px;
|
| padding: 12px 14px;
|
| margin: 10px 0;
|
| overflow-x: auto;
|
| }
|
| .bubble-content pre code { background: transparent; padding: 0; color: var(--text); font-size: 12px; line-height: 1.5; }
|
| .bubble-content blockquote {
|
| border-left: 3px solid var(--accent);
|
| padding: 4px 12px;
|
| color: var(--text-dim);
|
| margin: 10px 0;
|
| font-style: italic;
|
| }
|
| .bubble-content table { border-collapse: collapse; margin: 10px 0; width: 100%; font-size: 12.5px; }
|
| .bubble-content th, .bubble-content td { border: 1px solid var(--border); padding: 7px 11px; text-align: left; }
|
| .bubble-content th { background: var(--bg-elev); font-weight: 600; }
|
| .bubble-content a { color: var(--accent); }
|
| .bubble-content hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
|
|
|
| .cursor {
|
| display: inline-block;
|
| width: 7px; height: 13px;
|
| background: var(--accent);
|
| vertical-align: text-bottom;
|
| animation: blink 1s steps(1) infinite;
|
| margin-left: 2px;
|
| }
|
| @keyframes blink { 50% { opacity: 0; } }
|
|
|
| .tokens-info {
|
| font-size: 10px;
|
| color: var(--text-dim);
|
| margin-top: 7px;
|
| font-family: 'JetBrains Mono', monospace;
|
| }
|
| .tokens-info .hit { color: var(--success); }
|
| .tokens-info .miss { color: var(--warning); }
|
|
|
| .composer {
|
| border-top: 1px solid var(--border);
|
| background: var(--bg-panel);
|
| padding: 14px 22px 18px;
|
| }
|
| .composer-inner { max-width: 760px; margin: 0 auto; position: relative; }
|
| .composer textarea {
|
| width: 100%; min-height: 48px; max-height: 180px;
|
| background: var(--bg-elev);
|
| border: 1px solid var(--border);
|
| border-radius: 12px;
|
| padding: 12px 52px 12px 14px;
|
| color: var(--text);
|
| font-size: 14px;
|
| resize: none;
|
| outline: none;
|
| transition: border-color 0.15s, box-shadow 0.15s;
|
| line-height: 1.5;
|
| }
|
| .composer textarea:focus {
|
| border-color: var(--accent);
|
| box-shadow: 0 0 0 3px var(--accent-soft);
|
| }
|
| .composer textarea::placeholder { color: var(--text-dim); }
|
| .send-btn {
|
| position: absolute; right: 7px; bottom: 7px;
|
| background: var(--accent);
|
| color: white;
|
| border: none;
|
| width: 36px; height: 36px;
|
| border-radius: 8px;
|
| cursor: pointer;
|
| display: flex; align-items: center; justify-content: center;
|
| font-size: 14px;
|
| transition: background 0.15s, transform 0.1s;
|
| }
|
| .send-btn:hover { background: var(--accent-strong); }
|
| .send-btn:active { transform: scale(0.95); }
|
| .send-btn:disabled { background: var(--border); cursor: not-allowed; }
|
| .composer .hint {
|
| font-size: 11px; color: var(--text-dim);
|
| margin-top: 6px; display: flex; justify-content: space-between;
|
| }
|
| .composer .hint kbd {
|
| background: var(--bg-elev); border: 1px solid var(--border);
|
| border-radius: 4px; padding: 1px 5px;
|
| font-family: 'JetBrains Mono', monospace; font-size: 10px;
|
| }
|
|
|
|
|
| .resources {
|
| max-width: 1200px;
|
| margin: 24px auto 80px;
|
| padding: 0 32px;
|
| }
|
| .resource-grid {
|
| display: grid;
|
| grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
|
| gap: 14px;
|
| }
|
| .resource {
|
| background: var(--bg-panel);
|
| border: 1px solid var(--border-soft);
|
| border-radius: 12px;
|
| padding: 18px 20px;
|
| text-decoration: none;
|
| color: inherit;
|
| transition: all 0.18s;
|
| display: block;
|
| }
|
| .resource:hover {
|
| border-color: var(--accent);
|
| transform: translateY(-2px);
|
| text-decoration: none;
|
| box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
|
| }
|
| .resource .icon {
|
| width: 36px; height: 36px;
|
| background: var(--accent-soft);
|
| border-radius: 8px;
|
| display: flex; align-items: center; justify-content: center;
|
| font-size: 18px;
|
| margin-bottom: 12px;
|
| }
|
| .resource .res-title { font-weight: 600; color: var(--text-bright); margin-bottom: 4px; font-size: 14.5px; }
|
| .resource .res-desc { color: var(--text-dim); font-size: 12.5px; line-height: 1.45; }
|
|
|
| .footer-credit {
|
| text-align: center;
|
| padding: 24px 32px;
|
| color: var(--text-dim);
|
| font-size: 12px;
|
| border-top: 1px solid var(--border-soft);
|
| }
|
|
|
|
|
| .modal-bg {
|
| position: fixed; inset: 0;
|
| background: rgba(5, 7, 10, 0.78);
|
| display: none;
|
| align-items: center; justify-content: center;
|
| z-index: 100;
|
| backdrop-filter: blur(6px);
|
| }
|
| .modal-bg.show { display: flex; }
|
| .modal {
|
| background: var(--bg-panel);
|
| border: 1px solid var(--border);
|
| border-radius: 14px;
|
| padding: 28px;
|
| width: 480px;
|
| max-width: 90vw;
|
| box-shadow: var(--shadow);
|
| }
|
| .modal h3 { font-size: 18px; margin-bottom: 6px; }
|
| .modal p { color: var(--text-dim); font-size: 13.5px; margin-bottom: 18px; line-height: 1.5; }
|
| .modal input {
|
| width: 100%;
|
| background: var(--bg-elev);
|
| border: 1px solid var(--border);
|
| border-radius: 8px;
|
| padding: 10px 14px;
|
| color: var(--text);
|
| font-family: 'JetBrains Mono', monospace;
|
| font-size: 12px;
|
| outline: none;
|
| }
|
| .modal input:focus { border-color: var(--accent); }
|
| .modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
|
| .modal button {
|
| padding: 9px 18px; border-radius: 8px; border: none; cursor: pointer;
|
| font-weight: 500; font-size: 13px; transition: background 0.15s;
|
| }
|
| .modal button.primary { background: var(--accent); color: white; }
|
| .modal button.primary:hover { background: var(--accent-strong); }
|
| .modal button.secondary { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
|
| .modal button.secondary:hover { background: var(--bg-elev); color: var(--text); }
|
| .modal .warning {
|
| background: rgba(210, 153, 34, 0.1);
|
| border: 1px solid rgba(210, 153, 34, 0.3);
|
| border-radius: 6px;
|
| padding: 10px;
|
| font-size: 12px; color: var(--warning);
|
| margin-top: 14px;
|
| }
|
|
|
|
|
| ::-webkit-scrollbar { width: 8px; height: 8px; }
|
| ::-webkit-scrollbar-track { background: transparent; }
|
| ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
|
| ::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
|
|
|
|
|
| @media (max-width: 880px) {
|
| .hero { grid-template-columns: 1fr; padding: 36px 20px 28px; gap: 28px; }
|
| .chat-shell { grid-template-columns: 1fr; height: auto; min-height: 0; }
|
| .chat-sidebar { display: none; }
|
| .messages { min-height: 50vh; }
|
| }
|
| </style>
|
| </head>
|
| <body>
|
|
|
| <nav class="topbar">
|
| <div class="topbar-brand">
|
| <span class="dot"></span>
|
| Claude Code Master 2026
|
| <span class="meta">Podcast + Chatbot · ES</span>
|
| </div>
|
| <div class="topbar-actions">
|
| <a href="https://notebooklm.google.com/notebook/d41b8b19-190a-44b2-8aa1-b40c32e98405" target="_blank" rel="noopener">📓 NotebookLM</a>
|
| <button class="key-pill" id="keyStatus" title="Estado de la API key">
|
| <span class="pulse"></span>
|
| <span id="keyStatusLabel">Sin API key</span>
|
| </button>
|
| <button id="changeKeyBtn">Cambiar key</button>
|
| </div>
|
| </nav>
|
|
|
| <header class="hero">
|
| <div class="cover">
|
| <span class="ep-tag">Episode 01</span>
|
| <img src="cover.jpeg" alt="Las mejores practicas de Claude - cover del podcast" loading="eager" />
|
| </div>
|
| <div class="hero-info">
|
| <span class="eyebrow">Audio Overview · NotebookLM Deep Dive</span>
|
| <h1>Ingeniería de contexto avanzada con <span class="accent">Claude Code</span></h1>
|
| <p class="lede">
|
| Un deep dive sobre las técnicas que diferencian a quienes usan Claude Code de los que lo dominan: prompting, plan mode, CLAUDE.md, skills, MCP y las novedades de mayo 2026.
|
| </p>
|
| <div class="meta-row">
|
| <span><strong>10</strong> artículos curados</span>
|
| <span><strong>~49K</strong> tokens de contexto</span>
|
| <span><strong>ES</strong> Latam</span>
|
| <span><strong>NotebookLM</strong> deep dive</span>
|
| </div>
|
| <div class="player">
|
| <audio id="audio" controls preload="metadata">
|
| <source src="claude_code_overview.m4a" type="audio/mp4" />
|
| <source src="claude_code_overview.mp3" type="audio/mpeg" />
|
| Tu navegador no soporta audio HTML5.
|
| </audio>
|
| <div class="player-foot">
|
| <span>Generado por NotebookLM a partir de los 10 artículos</span>
|
| <div class="speed-buttons">
|
| <button data-speed="0.85">0.85×</button>
|
| <button data-speed="1" class="active">1×</button>
|
| <button data-speed="1.25">1.25×</button>
|
| <button data-speed="1.5">1.5×</button>
|
| </div>
|
| </div>
|
| </div>
|
| <div class="hero-cta">
|
| <button class="btn btn-primary" id="goToChatBtn">💬 Hablar con el chatbot</button>
|
| <a class="btn btn-secondary" href="claude_code_overview.m4a" download>↓ Descargar audio</a>
|
| </div>
|
| </div>
|
| </header>
|
|
|
| <section class="invite">
|
| <div class="section-header">
|
| <h2>Después del audio, ¿querés profundizar?</h2>
|
| <p>Tocá una tarjeta para arrancar la conversación o escribí tu propia pregunta abajo. El chatbot conoce los 10 artículos al detalle y cita las fuentes.</p>
|
| </div>
|
| <div class="topic-grid" id="topicGrid"></div>
|
| </section>
|
|
|
| <section id="chat-section">
|
| <div class="chat-shell">
|
| <aside class="chat-sidebar">
|
| <h3>Filtrar por tema</h3>
|
| <div class="topic-filter" id="topicFilter"></div>
|
| <h3>Artículos en la base</h3>
|
| <div class="article-list" id="articleList"></div>
|
| </aside>
|
| <div class="chat-main">
|
| <div class="chat-header">
|
| <div class="title-row">
|
| <h3>Conversación</h3>
|
| <span class="badge-live">en vivo · streaming</span>
|
| </div>
|
| <select id="modelSelect" title="Modelo">
|
| <option value="gemini-2.5-pro">Gemini 2.5 Pro · 100/día</option>
|
| <option value="gemini-2.5-flash" selected>Gemini 2.5 Flash · 500/día</option>
|
| <option value="gemini-2.5-flash-lite">Flash-Lite · 1000/día</option>
|
| </select>
|
| </div>
|
| <div class="messages" id="messages">
|
| <div class="empty-chat" id="emptyChat">
|
| <strong>Listo para charlar.</strong>
|
| Tocá una tarjeta de arriba o escribí tu pregunta. Vas a recibir respuesta con citas a los artículos fuente.
|
| </div>
|
| </div>
|
| <div class="composer">
|
| <div class="composer-inner">
|
| <textarea id="composer" placeholder="Pregunta sobre Claude Code..." rows="2"></textarea>
|
| <button class="send-btn" id="sendBtn" title="Enviar (Enter)">▲</button>
|
| <div class="hint">
|
| <span><kbd>Enter</kbd> enviar · <kbd>Shift+Enter</kbd> nueva línea</span>
|
| <span id="streamStatus"></span>
|
| </div>
|
| </div>
|
| </div>
|
| </div>
|
| </div>
|
| </section>
|
|
|
| <section class="resources">
|
| <div class="section-header">
|
| <h2>Recursos del notebook</h2>
|
| <p>Todos los artifacts generados en NotebookLM con los mismos 10 artículos. Abren en el notebook original.</p>
|
| </div>
|
| <div class="resource-grid">
|
| <a class="resource" href="https://notebooklm.google.com/notebook/d41b8b19-190a-44b2-8aa1-b40c32e98405" target="_blank" rel="noopener">
|
| <div class="icon">🎧</div>
|
| <div class="res-title">Audio Overview</div>
|
| <div class="res-desc">Deep dive narrado en español Latam.</div>
|
| </a>
|
| <a class="resource" href="https://notebooklm.google.com/notebook/d41b8b19-190a-44b2-8aa1-b40c32e98405" target="_blank" rel="noopener">
|
| <div class="icon">🧠</div>
|
| <div class="res-title">Mind Map</div>
|
| <div class="res-desc">The Claude Code Architectural Blueprint, 6 ramas principales.</div>
|
| </a>
|
| <a class="resource" href="https://notebooklm.google.com/notebook/d41b8b19-190a-44b2-8aa1-b40c32e98405" target="_blank" rel="noopener">
|
| <div class="icon">❓</div>
|
| <div class="res-title">FAQ exhaustivo</div>
|
| <div class="res-desc">Preguntas frecuentes agrupadas por sección.</div>
|
| </a>
|
| <a class="resource" href="https://notebooklm.google.com/notebook/d41b8b19-190a-44b2-8aa1-b40c32e98405" target="_blank" rel="noopener">
|
| <div class="icon">📋</div>
|
| <div class="res-title">Briefing Doc (ES)</div>
|
| <div class="res-desc">Informe ejecutivo del ecosistema Claude Code.</div>
|
| </a>
|
| </div>
|
| </section>
|
|
|
| <footer class="footer-credit">
|
| Knowledge base: 10 artículos curados · Mayo 2026 · Generado con NotebookLM + Gemini Free
|
| </footer>
|
|
|
| <div class="modal-bg" id="apiKeyModal">
|
| <div class="modal">
|
| <h3>Configurar API key de Google AI Studio</h3>
|
| <p>Free tier sin tarjeta de crédito. Conseguila en <a href="https://aistudio.google.com/apikey" target="_blank" rel="noopener">aistudio.google.com/apikey</a>. Tu key vive solo en <code>sessionStorage</code> y se borra al cerrar la pestaña.</p>
|
| <input type="password" id="apiKeyInput" placeholder="AIza..." autocomplete="off" />
|
| <div class="actions">
|
| <button class="secondary" id="cancelKeyBtn">Cancelar</button>
|
| <button class="primary" id="saveKeyBtn">Guardar</button>
|
| </div>
|
| <div class="warning">
|
| Para uso personal local. No publiques este HTML con la key dentro.
|
| </div>
|
| </div>
|
| </div>
|
|
|
| <script>
|
| // ============================================================
|
| // DATA: articles (inyectado por build_chatbot.py)
|
| // ============================================================
|
| const ARTICLES_DATA = {"metadata": {"title": "Claude Code Master 2026", "description": "10 articulos curados sobre Claude Code (mayo 2026) - prompting, planning, skills, .md, MCP, novedades", "curated_date": "2026-05-06", "notebook_id": null}, "generated_at": "2026-05-06T23:42:29", "total_chars": 195395, "articles": [{"id": 1, "title": "Best practices for Claude Code", "url": "https://code.claude.com/docs/en/best-practices", "author": "Anthropic", "publisher": "Anthropic Docs", "date": "2026 (continuously updated)", "official": true, "topics": ["prompting", "planning", "mcp", "skills", "claude_md", "subagents", "hooks", "plugins"], "summary": "Guia oficial canonica con todos los patrones probados internamente: explore-plan-implement, CLAUDE.md tactico, permission modes, parallel sessions, fan-out, auto mode.", "content_markdown": "Claude Code is an agentic coding environment. Unlike a chatbot that answers questions and waits, Claude Code can read your files, run commands, make changes, and autonomously work through problems while you watch, redirect, or step away entirely. This changes how you work. Instead of writing code yourself and asking Claude to review it, you describe what you want and Claude figures out how to build it. Claude explores, plans, and implements. But this autonomy still comes with a learning curve. Claude works within certain constraints you need to understand. This guide covers patterns that have proven effective across Anthropic’s internal teams and for engineers using Claude Code across various codebases, languages, and environments. For how the agentic loop works under the hood, see## Documentation Index\n\nFetch the complete documentation index at:\n\n[https://code.claude.com/docs/llms.txt]Use this file to discover all available pages before exploring further.\n\n\n[How Claude Code works](https://code.claude.com/docs/en/how-claude-code-works).\n\nMost best practices are based on one constraint: Claude’s context window fills up fast, and performance degrades as it fills. Claude’s context window holds your entire conversation, including every message, every file Claude reads, and every command output. However, this can fill up fast. A single debugging session or codebase exploration might generate and consume tens of thousands of tokens. This matters since LLM performance degrades as context fills. When the context window is getting full, Claude may start “forgetting” earlier instructions or making more mistakes. The context window is the most important resource to manage. To see how a session fills up in practice,\n\n[watch an interactive walkthrough](https://code.claude.com/docs/en/context-window)of what loads at startup and what each file read costs. Track context usage continuously with a\n\n[custom status line](https://code.claude.com/docs/en/statusline), and see\n\n[Reduce token usage](https://code.claude.com/docs/en/costs#reduce-token-usage)for strategies on reducing token usage.\n\n## Give Claude a way to verify its work\n\nClaude performs dramatically better when it can verify its own work, like run tests, compare screenshots, and validate outputs. Without clear success criteria, it might produce something that looks right but actually doesn’t work. You become the only feedback loop, and every mistake requires your attention.| Strategy | Before | After |\n|---|---|---|\nProvide verification criteria | ”implement a function that validates email addresses\" | \"write a validateEmail function. example test cases:\n|\nVerify UI changes visually | ”make the dashboard look better\" | \"[paste screenshot] implement this design. take a screenshot of the result and compare it to the original. list differences and fix them” |\nAddress root causes, not symptoms | ”the build is failing\" | \"the build fails with this error: [paste error]. fix it and verify the build succeeds. address the root cause, don’t suppress the error” |\n\n[Claude in Chrome extension](https://code.claude.com/docs/en/chrome). It opens new tabs in your browser, tests the UI, and iterates until the code works. Your verification can also be a test suite, a linter, or a Bash command that checks output. Invest in making your verification rock-solid.\n\n## Explore first, then plan, then code\n\nLetting Claude jump straight to coding can produce code that solves the wrong problem. Use[plan mode](https://code.claude.com/docs/en/permission-modes#analyze-before-you-edit-with-plan-mode)to separate exploration from execution. The recommended workflow has four phases:\n\nExplore\n\nEnter plan mode. Claude reads files and answers questions without making changes.\n\nclaude (plan mode)\n\nPlan\n\nAsk Claude to create a detailed implementation plan.Press\n\nclaude (plan mode)\n\n`Ctrl+G`\n\nto open the plan in your text editor for direct editing before Claude proceeds.Implement\n\nSwitch out of plan mode and let Claude code, verifying against its plan.\n\nclaude (default mode)\n\nPlan mode is useful, but also adds overhead.For tasks where the scope is clear and the fix is small (like fixing a typo, adding a log line, or renaming a variable) ask Claude to do it directly.Planning is most useful when you’re uncertain about the approach, when the change modifies multiple files, or when you’re unfamiliar with the code being modified. If you could describe the diff in one sentence, skip the plan.\n\n## Provide specific context in your prompts\n\nClaude can infer intent, but it can’t read your mind. Reference specific files, mention constraints, and point to example patterns.| Strategy | Before | After |\n|---|---|---|\nScope the task. Specify which file, what scenario, and testing preferences. | ”add tests for foo.py\" | \"write a test for foo.py covering the edge case where the user is logged out. avoid mocks.” |\nPoint to sources. Direct Claude to the source that can answer a question. | ”why does ExecutionFactory have such a weird api?\" | \"look through ExecutionFactory’s git history and summarize how its api came to be” |\nReference existing patterns. Point Claude to patterns in your codebase. | ”add a calendar widget\" | \"look at how existing widgets are implemented on the home page to understand the patterns. HotDogWidget.php is a good example. follow the pattern to implement a new calendar widget that lets the user select a month and paginate forwards/backwards to pick a year. build from scratch without libraries other than the ones already used in the codebase.” |\nDescribe the symptom. Provide the symptom, the likely location, and what “fixed” looks like. | ”fix the login bug\" | \"users report that login fails after session timeout. check the auth flow in src/auth/, especially token refresh. write a failing test that reproduces the issue, then fix it” |\n\n`\"what would you improve in this file?\"`\n\ncan surface things you wouldn’t have thought to ask about.\n### Provide rich content\n\nYou can provide rich data to Claude in several ways:**Reference files with**instead of describing where code lives. Claude reads the file before responding.`@`\n\n**Paste images directly**. Copy/paste or drag and drop images into the prompt.**Give URLs**for documentation and API references. Use`/permissions`\n\nto allowlist frequently-used domains.**Pipe in data**by running`cat error.log | claude`\n\nto send file contents directly.**Let Claude fetch what it needs**. Tell Claude to pull context itself using Bash commands, MCP tools, or by reading files.\n\n## Configure your environment\n\nA few setup steps make Claude Code significantly more effective across all your sessions. For a full overview of extension features and when to use each one, see[Extend Claude Code](https://code.claude.com/docs/en/features-overview).\n\n### Write an effective CLAUDE.md\n\nCLAUDE.md is a special file that Claude reads at the start of every conversation. Include Bash commands, code style, and workflow rules. This gives Claude persistent context it can’t infer from code alone. The`/init`\n\ncommand analyzes your codebase to detect build systems, test frameworks, and code patterns, giving you a solid foundation to refine.\nThere’s no required format for CLAUDE.md files, but keep it short and human-readable. For example:\nCLAUDE.md\n\n[skills](https://code.claude.com/docs/en/skills)instead. Claude loads them on demand without bloating every conversation. Keep it concise. For each line, ask:\n\n*“Would removing this cause Claude to make mistakes?”*If not, cut it. Bloated CLAUDE.md files cause Claude to ignore your actual instructions!\n\n| ✅ Include | ❌ Exclude |\n|---|---|\n| Bash commands Claude can’t guess | Anything Claude can figure out by reading code |\n| Code style rules that differ from defaults | Standard language conventions Claude already knows |\n| Testing instructions and preferred test runners | Detailed API documentation (link to docs instead) |\n| Repository etiquette (branch naming, PR conventions) | Information that changes frequently |\n| Architectural decisions specific to your project | Long explanations or tutorials |\n| Developer environment quirks (required env vars) | File-by-file descriptions of the codebase |\n| Common gotchas or non-obvious behaviors | Self-evident practices like “write clean code” |\n\n`@path/to/import`\n\nsyntax:\nCLAUDE.md\n\n**Home folder (**: applies to all Claude sessions`~/.claude/CLAUDE.md`\n\n)**Project root (**: check into git to share with your team`./CLAUDE.md`\n\n)**Project root (**: personal project-specific notes; add this file to your`./CLAUDE.local.md`\n\n)`.gitignore`\n\nso it isn’t shared with your team**Parent directories**: useful for monorepos where both`root/CLAUDE.md`\n\nand`root/foo/CLAUDE.md`\n\nare pulled in automatically**Child directories**: Claude pulls in child CLAUDE.md files on demand when working with files in those directories\n\n### Configure permissions\n\nBy default, Claude Code requests permission for actions that might modify your system: file writes, Bash commands, MCP tools, etc. This is safe but tedious. After the tenth approval you’re not really reviewing anymore, you’re just clicking through. There are three ways to reduce these interruptions:**Auto mode**: a separate classifier model reviews commands and blocks only what looks risky: scope escalation, unknown infrastructure, or hostile-content-driven actions. Best when you trust the general direction of a task but don’t want to click through every step**Permission allowlists**: permit specific tools you know are safe, like`npm run lint`\n\nor`git commit`\n\n**Sandboxing**: enable OS-level isolation that restricts filesystem and network access, allowing Claude to work more freely within defined boundaries\n\n[permission modes](https://code.claude.com/docs/en/permission-modes),\n\n[permission rules](https://code.claude.com/docs/en/permissions), and\n\n[sandboxing](https://code.claude.com/docs/en/sandboxing).\n\n### Use CLI tools\n\nCLI tools are the most context-efficient way to interact with external services. If you use GitHub, install the`gh`\n\nCLI. Claude knows how to use it for creating issues, opening pull requests, and reading comments. Without `gh`\n\n, Claude can still use the GitHub API, but unauthenticated requests often hit rate limits.\nClaude is also effective at learning CLI tools it doesn’t already know. Try prompts like `Use 'foo-cli-tool --help' to learn about foo tool, then use it to solve A, B, C.`\n\n### Connect MCP servers\n\nWith[MCP servers](https://code.claude.com/docs/en/mcp), you can ask Claude to implement features from issue trackers, query databases, analyze monitoring data, integrate designs from Figma, and automate workflows.\n\n### Set up hooks\n\n[Hooks](https://code.claude.com/docs/en/hooks-guide)run scripts automatically at specific points in Claude’s workflow. Unlike CLAUDE.md instructions which are advisory, hooks are deterministic and guarantee the action happens. Claude can write hooks for you. Try prompts like\n\n*“Write a hook that runs eslint after every file edit”*or\n\n*“Write a hook that blocks writes to the migrations folder.”*Edit\n\n`.claude/settings.json`\n\ndirectly to configure hooks by hand, and run `/hooks`\n\nto browse what’s configured.\n### Create skills\n\n[Skills](https://code.claude.com/docs/en/skills)extend Claude’s knowledge with information specific to your project, team, or domain. Claude applies them automatically when relevant, or you can invoke them directly with\n\n`/skill-name`\n\n.\nCreate a skill by adding a directory with a `SKILL.md`\n\nto `.claude/skills/`\n\n:\n.claude/skills/api-conventions/SKILL.md\n\n.claude/skills/fix-issue/SKILL.md\n\n`/fix-issue 1234`\n\nto invoke it. Use `disable-model-invocation: true`\n\nfor workflows with side effects that you want to trigger manually.\n### Create custom subagents\n\n[Subagents](https://code.claude.com/docs/en/sub-agents)run in their own context with their own set of allowed tools. They’re useful for tasks that read many files or need specialized focus without cluttering your main conversation.\n\n.claude/agents/security-reviewer.md\n\n*“Use a subagent to review this code for security issues.”*\n\n### Install plugins\n\n[Plugins](https://code.claude.com/docs/en/plugins)bundle skills, hooks, subagents, and MCP servers into a single installable unit from the community and Anthropic. If you work with a typed language, install a\n\n[code intelligence plugin](https://code.claude.com/docs/en/discover-plugins#code-intelligence)to give Claude precise symbol navigation and automatic error detection after edits. For guidance on choosing between skills, subagents, hooks, and MCP, see\n\n[Extend Claude Code](https://code.claude.com/docs/en/features-overview#match-features-to-your-goal).\n\n## Communicate effectively\n\nThe way you communicate with Claude Code significantly impacts the quality of results.### Ask codebase questions\n\nWhen onboarding to a new codebase, use Claude Code for learning and exploration. You can ask Claude the same sorts of questions you would ask another engineer:- How does logging work?\n- How do I make a new API endpoint?\n- What does\n`async move { ... }`\n\ndo on line 134 of`foo.rs`\n\n? - What edge cases does\n`CustomerOnboardingFlowImpl`\n\nhandle? - Why does this code call\n`foo()`\n\ninstead of`bar()`\n\non line 333?\n\n### Let Claude interview you\n\nClaude asks about things you might not have considered yet, including technical implementation, UI/UX, edge cases, and tradeoffs.## Manage your session\n\nConversations are persistent and reversible. Use this to your advantage!### Course-correct early and often\n\nThe best results come from tight feedback loops. Though Claude occasionally solves problems perfectly on the first attempt, correcting it quickly generally produces better solutions faster.: stop Claude mid-action with the`Esc`\n\n`Esc`\n\nkey. Context is preserved, so you can redirect.: press`Esc + Esc`\n\nor`/rewind`\n\n`Esc`\n\ntwice or run`/rewind`\n\nto open the rewind menu and restore previous conversation and code state, or summarize from a selected message.: have Claude revert its changes.`\"Undo that\"`\n\n: reset context between unrelated tasks. Long sessions with irrelevant context can reduce performance.`/clear`\n\n\n`/clear`\n\nand start fresh with a more specific prompt that incorporates what you learned. A clean session with a better prompt almost always outperforms a long session with accumulated corrections.\n### Manage context aggressively\n\nClaude Code automatically compacts conversation history when you approach context limits, which preserves important code and decisions while freeing space. During long sessions, Claude’s context window can fill with irrelevant conversation, file contents, and commands. This can reduce performance and sometimes distract Claude.- Use\n`/clear`\n\nfrequently between tasks to reset the context window entirely - When auto compaction triggers, Claude summarizes what matters most, including code patterns, file states, and key decisions\n- For more control, run\n`/compact <instructions>`\n\n, like`/compact Focus on the API changes`\n\n- To compact only part of the conversation, use\n`Esc + Esc`\n\nor`/rewind`\n\n, select a message checkpoint, and choose**Summarize from here**. This condenses messages from that point forward while keeping earlier context intact. - Customize compaction behavior in CLAUDE.md with instructions like\n`\"When compacting, always preserve the full list of modified files and any test commands\"`\n\nto ensure critical context survives summarization - For quick questions that don’t need to stay in context, use\n. The answer appears in a dismissible overlay and never enters conversation history, so you can check a detail without growing context.`/btw`\n\n\n### Use subagents for investigation\n\nSince context is your fundamental constraint, subagents are one of the most powerful tools available. When Claude researches a codebase it reads lots of files, all of which consume your context. Subagents run in separate context windows and report back summaries:### Rewind with checkpoints\n\nClaude automatically checkpoints before changes. Double-tap`Escape`\n\nor run `/rewind`\n\nto open the rewind menu. You can restore conversation only, restore code only, restore both, or summarize from a selected message. See [Checkpointing](https://code.claude.com/docs/en/checkpointing)for details. Instead of carefully planning every move, you can tell Claude to try something risky. If it doesn’t work, rewind and try a different approach. Checkpoints persist across sessions, so you can close your terminal and still rewind later.\n\n### Resume conversations\n\nClaude Code saves conversations locally, so when a task spans multiple sittings you don’t have to re-explain the context. Run`claude --continue`\n\nto pick up the most recent session, or `claude --resume`\n\nto choose from a list. Give sessions descriptive names like `oauth-migration`\n\nso you can find them later. See [Manage sessions](https://code.claude.com/docs/en/sessions)for the full set of resume, branch, and naming controls.\n\n## Automate and scale\n\nOnce you’re effective with one Claude, multiply your output with parallel sessions, non-interactive mode, and fan-out patterns. Everything so far assumes one human, one Claude, and one conversation. But Claude Code scales horizontally. The techniques in this section show how you can get more done.### Run non-interactive mode\n\nWith`claude -p \"your prompt\"`\n\n, you can run Claude non-interactively, without a session. [Non-interactive mode](https://code.claude.com/docs/en/headless)is how you integrate Claude into CI pipelines, pre-commit hooks, or any automated workflow. The output formats let you parse results programmatically: plain text, JSON, or streaming JSON.\n\n### Run multiple Claude sessions\n\nPick the parallel approach that fits how much coordination you want to do yourself:[Worktrees](https://code.claude.com/docs/en/worktrees): run separate CLI sessions in isolated git checkouts so edits don’t collide[Desktop app](https://code.claude.com/docs/en/desktop#work-in-parallel-with-sessions): manage multiple local sessions visually, each in its own worktree[Claude Code on the web](https://code.claude.com/docs/en/claude-code-on-the-web): run sessions on Anthropic-managed cloud infrastructure in isolated VMs[Agent teams](https://code.claude.com/docs/en/agent-teams): automated coordination of multiple sessions with shared tasks, messaging, and a team lead\n\n| Session A (Writer) | Session B (Reviewer) |\n|---|---|\n`Implement a rate limiter for our API endpoints` | |\n`Review the rate limiter implementation in @src/middleware/rateLimiter.ts. Look for edge cases, race conditions, and consistency with our existing middleware patterns.` | |\n`Here's the review feedback: [Session B output]. Address these issues.` |\n\n### Fan out across files\n\nFor large migrations or analyses, you can distribute work across many parallel Claude invocations:Generate a task list\n\nHave Claude list all files that need migrating (e.g.,\n\n`list all 2,000 Python files that need migrating`\n\n)`--verbose`\n\nfor debugging during development, and turn it off in production.\n### Run autonomously with auto mode\n\nFor uninterrupted execution with background safety checks, use[auto mode](https://code.claude.com/docs/en/permission-modes#eliminate-prompts-with-auto-mode). A classifier model reviews commands before they run, blocking scope escalation, unknown infrastructure, and hostile-content-driven actions while letting routine work proceed without prompts.\n\n`-p`\n\nflag, auto mode aborts if the classifier repeatedly blocks actions, since there is no user to fall back to. See [when auto mode falls back](https://code.claude.com/docs/en/permission-modes#when-auto-mode-falls-back)for thresholds.\n\n## Avoid common failure patterns\n\nThese are common mistakes. Recognizing them early saves time:**The kitchen sink session.**You start with one task, then ask Claude something unrelated, then go back to the first task. Context is full of irrelevant information.**Fix**:`/clear`\n\nbetween unrelated tasks.**Correcting over and over.**Claude does something wrong, you correct it, it’s still wrong, you correct again. Context is polluted with failed approaches.**Fix**: After two failed corrections,`/clear`\n\nand write a better initial prompt incorporating what you learned.**The over-specified CLAUDE.md.**If your CLAUDE.md is too long, Claude ignores half of it because important rules get lost in the noise.**Fix**: Ruthlessly prune. If Claude already does something correctly without the instruction, delete it or convert it to a hook.**The trust-then-verify gap.**Claude produces a plausible-looking implementation that doesn’t handle edge cases.**Fix**: Always provide verification (tests, scripts, screenshots). If you can’t verify it, don’t ship it.**The infinite exploration.**You ask Claude to “investigate” something without scoping it. Claude reads hundreds of files, filling the context.**Fix**: Scope investigations narrowly or use subagents so the exploration doesn’t consume your main context.\n\n## Develop your intuition\n\nThe patterns in this guide aren’t set in stone. They’re starting points that work well in general, but might not be optimal for every situation. Sometimes you*should*let context accumulate because you’re deep in one complex problem and the history is valuable. Sometimes you should skip planning and let Claude figure it out because the task is exploratory. Sometimes a vague prompt is exactly right because you want to see how Claude interprets the problem before constraining it. Pay attention to what works. When Claude produces great output, notice what you did: the prompt structure, the context you provided, the mode you were in. When Claude struggles, ask why. Was the context too noisy? The prompt too vague? The task too big for one pass? Over time, you’ll develop intuition that no guide can capture. You’ll know when to be specific and when to be open-ended, when to plan and when to explore, when to clear context and when to let it accumulate.\n\n## Related resources\n\n[How Claude Code works](https://code.claude.com/docs/en/how-claude-code-works): the agentic loop, tools, and context management[Extend Claude Code](https://code.claude.com/docs/en/features-overview): skills, hooks, MCP, subagents, and plugins[Common workflows](https://code.claude.com/docs/en/common-workflows): step-by-step recipes for debugging, testing, PRs, and more[CLAUDE.md](https://code.claude.com/docs/en/memory): store project conventions and persistent context", "content_chars": 22463, "fetch_status": "ok"}, {"id": 2, "title": "Equipping agents for the real world with Agent Skills", "url": "https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills", "author": "Anthropic Engineering", "publisher": "Anthropic", "date": "2025-10-16", "official": true, "topics": ["skills", "agents"], "summary": "Anuncio y diseno conceptual de Agent Skills: carpetas con SKILL.md que el modelo descubre y carga on-demand.", "content_markdown": "## Get the developer newsletter\n\nProduct updates, how-tos, community spotlights, and more. Delivered monthly to your inbox.\n\n*Update: We've published* *Agent Skills**as an open standard for cross-platform portability. (December 18, 2025)*\n\nAs model capabilities improve, we can now build general-purpose agents that interact with full-fledged computing environments. [Claude Code](https://claude.com/product/claude-code), for example, can accomplish complex tasks across domains using local code execution and filesystems. But as these agents become more powerful, we need more composable, scalable, and portable ways to equip them with domain-specific expertise.\n\nThis led us to create [ Agent Skills](https://www.anthropic.com/news/skills): organized folders of instructions, scripts, and resources that agents can discover and load dynamically to perform better at specific tasks.\n\nBuilding a skill for an agent is like putting together an onboarding guide for a new hire. Instead of building fragmented, custom-designed agents for each use case, anyone can now specialize their agents with composable capabilities by capturing and sharing their procedural knowledge. In this article, we explain what Skills are, show how they work, and share best practices for building your own.\n\nTo see Skills in action, let’s walk through a real example: one of the skills that powers [Claude’s recently launched document editing abilities](https://www.anthropic.com/news/create-files). Claude already knows a lot about understanding PDFs, but is limited in its ability to manipulate them directly (e.g. to fill out a form). This [PDF skill](https://github.com/anthropics/skills/tree/main/document-skills/pdf) lets us give Claude these new abilities.\n\nAt its simplest, a skill is a directory that contains a `SKILL.md file`\n\n. This file must start with YAML frontmatter that contains some required metadata: `name`\n\nand `description`\n\n. At startup, the agent pre-loads the `name`\n\nand `description`\n\nof every installed skill into its system prompt.\n\nThis metadata is the **first level** of *progressive disclosure*: it provides just enough information for Claude to know when each skill should be used without loading all of it into context. The actual body of this file is the **second level** of detail. If Claude thinks the skill is relevant to the current task, it will load the skill by reading its full `SKILL.md`\n\ninto context.\n\nAs skills grow in complexity, they may contain too much context to fit into a single `SKILL.md`\n\n, or context that’s relevant only in specific scenarios. In these cases, skills can bundle additional files within the skill directory and reference them by name from `SKILL.md`\n\n. These additional linked files are the **third level** (and beyond) of detail, which Claude can choose to navigate and discover only as needed.\n\nIn the PDF skill shown below, the `SKILL.md`\n\nrefers to two additional files (`reference.md`\n\nand `forms.md`\n\n) that the skill author chooses to bundle alongside the core `SKILL.md`\n\n. By moving the form-filling instructions to a separate file (`forms.md`\n\n), the skill author is able to keep the core of the skill lean, trusting that Claude will read `forms.md`\n\nonly when filling out a form.\n\nProgressive disclosure is the core design principle that makes Agent Skills flexible and scalable. Like a well-organized manual that starts with a table of contents, then specific chapters, and finally a detailed appendix, skills let Claude load information only as needed:\n\nAgents with a filesystem and code execution tools don’t need to read the entirety of a skill into their context window when working on a particular task. This means that the amount of context that can be bundled into a skill is effectively unbounded.\n\nThe following diagram shows how the context window changes when a skill is triggered by a user’s message.\n\nThe sequence of operations shown:\n\n- To start, the context window has the core system prompt and the metadata for each of the installed skills, along with the user’s initial message;\n- Claude triggers the PDF skill by invoking a Bash tool to read the contents of\n`pdf/SKILL.md`\n\n; - Claude chooses to read the\n`forms.md`\n\nfile bundled with the skill; - Finally, Claude proceeds with the user’s task now that it has loaded relevant instructions from the PDF skill.\n\nSkills can also include code for Claude to execute as tools at its discretion.\n\nLarge language models excel at many tasks, but certain operations are better suited for traditional code execution. For example, sorting a list via token generation is far more expensive than simply running a sorting algorithm. Beyond efficiency concerns, many applications require the deterministic reliability that only code can provide.\n\nIn our example, the PDF skill includes a pre-written Python script that reads a PDF and extracts all form fields. Claude can run this script without loading either the script or the PDF into context. And because code is deterministic, this workflow is consistent and repeatable.\n\nHere are some helpful guidelines for getting started with authoring and testing skills:\n\n**Start with evaluation:**Identify specific gaps in your agents’ capabilities by running them on representative tasks and observing where they struggle or require additional context. Then build skills incrementally to address these shortcomings.**Structure for scale:**When the`SKILL.md`\n\nfile becomes unwieldy, split its content into separate files and reference them. If certain contexts are mutually exclusive or rarely used together, keeping the paths separate will reduce the token usage. Finally, code can serve as both executable tools and as documentation. It should be clear whether Claude should run scripts directly or read them into context as reference.**Think from Claude’s perspective:**Monitor how Claude uses your skill in real scenarios and iterate based on observations: watch for unexpected trajectories or overreliance on certain contexts. Pay special attention to the`name`\n\nand`description`\n\nof your skill. Claude will use these when deciding whether to trigger the skill in response to its current task.**Iterate with Claude:**As you work on a task with Claude, ask Claude to capture its successful approaches and common mistakes into reusable context and code within a skill. If it goes off track when using a skill to complete a task, ask it to self-reflect on what went wrong. This process will help you discover what context Claude actually needs, instead of trying to anticipate it upfront.\n\nSkills provide Claude with new capabilities through instructions and code. While this makes them powerful, it also means that malicious skills may introduce vulnerabilities in the environment where they’re used or direct Claude to exfiltrate data and take unintended actions.\n\nWe recommend installing skills only from trusted sources. When installing a skill from a less-trusted source, thoroughly audit it before use. Start by reading the contents of the files bundled in the skill to understand what it does, paying particular attention to code dependencies and bundled resources like images or scripts. Similarly, pay attention to instructions or code within the skill that instruct Claude to connect to potentially untrusted external network sources.\n\nAgent Skills are [supported today](https://www.anthropic.com/news/skills) across [Claude.ai](http://claude.ai/redirect/website.v1.3548e342-3ad6-4653-9e38-ced230ca48c6), Claude Code, the Claude Agent SDK, and the Claude Developer Platform.\n\nIn the coming weeks, we’ll continue to add features that support the full lifecycle of creating, editing, discovering, sharing, and using Skills. We’re especially excited about the opportunity for Skills to help organizations and individuals share their context and workflows with Claude. We’ll also explore how Skills can complement [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) servers by teaching agents more complex workflows that involve external tools and software.\n\nLooking further ahead, we hope to enable agents to create, edit, and evaluate Skills on their own, letting them codify their own patterns of behavior into reusable capabilities.\n\nSkills are a simple concept with a correspondingly simple format. This simplicity makes it easier for organizations, developers, and end users to build customized agents and give them new capabilities.\n\nWe’re excited to see what people build with Skills. Get started today by checking out our Skills [docs](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview) and [cookbook](https://github.com/anthropics/claude-cookbooks/tree/main/skills).\n\nWritten by Barry Zhang, Keith Lazuka, and Mahesh Murag, who all really like folders. Special thanks to the many others across Anthropic who championed, supported, and built Skills.\n\nProduct updates, how-tos, community spotlights, and more. Delivered monthly to your inbox.", "content_chars": 8953, "fetch_status": "ok"}, {"id": 3, "title": "Building agents with the Claude Agent SDK", "url": "https://claude.com/blog/building-agents-with-the-claude-agent-sdk", "author": "Anthropic Engineering", "publisher": "Anthropic", "date": "2025-09-29", "official": true, "topics": ["agent_sdk", "skills", "novedades"], "summary": "Guia oficial del Claude Agent SDK (renombrado desde Claude Code SDK), con best practices para construir agentes propios.", "content_markdown": "# Building agents with the Claude Agent SDK\n\nThe Claude Agent SDK is a collection of tools that helps developers build powerful agents on top of Claude Code. In this article, we walk through how to get started and share our best practices.\n\n\nThe Claude Agent SDK is a collection of tools that helps developers build powerful agents on top of Claude Code. In this article, we walk through how to get started and share our best practices.\n\n\n- September 29, 2025\n- 5min\n\nLast year, we shared lessons in [building effective agents](https://www.anthropic.com/engineering/building-effective-agents) alongside our customers. Since then, we've released [Claude Code](https://claude.com/product/claude-code), an agentic coding solution that we originally built to support developer productivity at Anthropic.\n\nOver the past several months, Claude Code has become far more than a coding tool. At Anthropic, we’ve been [using it](https://www.anthropic.com/news/how-anthropic-teams-use-claude-code) for deep research, video creation, and note-taking, among countless other non-coding applications. In fact, it has begun to power almost all of our major agent loops.\n\nIn other words, the agent harness that powers Claude Code (the Claude Code SDK) can power many other types of agents, too. To reflect this broader vision, we're renaming the Claude Code SDK to the Claude Agent SDK.\n\nIn this post, we'll highlight why we built the Claude Agent SDK, how to build your own agents with it, and share the best practices that have emerged from our team’s own deployments.\n\n[The key design principle](https://www.youtube.com/watch?v=vLIDHi-1PVU) behind Claude Code is that Claude needs the same tools that programmers use every day. It needs to be able to find appropriate files in a codebase, write and edit files, lint the code, run it, debug, edit, and sometimes take these actions iteratively until the code succeeds.\n\nWe found that by giving Claude access to the user’s computer (via the terminal), it had what it needed to write code like programmers do.\n\nBut this has also made Claude in Claude Code effective at *non*-coding tasks. By giving it tools to run bash commands, edit files, create files and search files, Claude can read CSV files, search the web, build visualizations, interpret metrics, and do all sorts of other digital work – in short, create general-purpose agents with a computer. The key design principle behind the Claude Agent SDK is to give your agents a computer, allowing them to work like humans do.\n\nWe believe giving Claude a computer unlocks the ability to build agents that are more effective than before. For example, with our SDK, developers can build:\n\n**Finance agents**:Build agents that can understand your portfolio and goals, as well as help you evaluate investments by accessing external APIs, storing data and running code to make calculations.**Personal assistant agents**. Build agents that can help you book travel and manage your calendar, as well as schedule appointments, put together briefs, and more by connecting to your internal data sources and tracking context across applications.**Customer support agents:**Build agents that can handle high ambiguity user requests, like customer service tickets, by collecting and reviewing user data, connecting to external APIs, messaging users back and escalating to humans when needed.**Deep research agents**: Build agents that can conduct comprehensive research across large document collections by searching through file systems, analyzing and synthesizing information from multiple sources, cross-referencing data across files, and generating detailed reports.\n\nAnd much more. At its core, the SDK gives you the primitives to build agents for whatever workflow you're trying to automate.\n\nIn Claude Code, Claude often operates in a specific feedback loop: gather context -> take action -> verify work -> repeat.\n\nThis offers a useful way to think about other agents, and the capabilities they should be given. To illustrate this, we’ll walk through the example of how we might build an email agent in the Claude Agent SDK.\n\nWhen developing an agent, you want to give it more than just a prompt: it needs to be able to fetch and update its own context. Here’s how features in the SDK can help.\n\nThe file system represents information that *could* be pulled into the model's context.\n\nWhen Claude encounters large files, like logs or user-uploaded files, it will decide which way to load these into its context by using bash scripts like `grep`\n\nand `tail`\n\n. In essence, the folder and file structure of an agent becomes a form of [context engineering](http://anthropic.com/news/context-management).\n\nOur email agent might store previous conversations in a folder called ‘Conversations’. This would allow it to search previous these for its context when asked about them.\n\n[Semantic search](https://www.anthropic.com/news/contextual-retrieval) is usually faster than agentic search, but less accurate, more difficult to maintain, and less transparent. It involves ‘chunking’ the relevant context, embedding these chunks as vectors, and then searching for concepts by querying those vectors. Given its limitations, we suggest starting with agentic search, and only adding semantic search if you need faster results or more variations.\n\nClaude Agent SDK supports subagents by default. [Subagents](https://docs.claude.com/en/api/agent-sdk/subagents) are useful for two main reasons. First, they enable parallelization: you can spin up multiple subagents to work on different tasks simultaneously. Second, they help manage context: subagents use their own isolated context windows, and only send relevant information back to the orchestrator, rather than their full context. This makes them ideal for tasks that require sifting through large amounts of information where most of it won't be useful.\n\nWhen designing our email agent, we might give it a 'search subagent' capability. The email agent could then spin off multiple search subagents in parallel—each running different queries against your email history—and have them return only the relevant excerpts rather than full email threads.\n\nWhen agents are running for long periods of time, context maintenance becomes critical. The Claude Agent SDK’s compact feature automatically summarizes previous messages when the context limit approaches, so your agent won’t run out of context. This is built on Claude Code’s [compact slash command](https://docs.claude.com/en/docs/claude-code/sdk/sdk-slash-commands#%2Fcompact-compact-conversation-history).\n\nOnce you’ve gathered context, you’ll want to give your agent flexible ways of taking action.\n\n[Tools](https://www.anthropic.com/engineering/writing-tools-for-agents) are the primary building blocks of execution for your agent. Tools are prominent in Claude's context window, making them the primary actions Claude will consider when deciding how to complete a task. This means you should be conscious about how you design your tools to maximize context efficiency. You can see more best practices in our blog post, [Writing effective tools for agents – with agents](https://www.anthropic.com/engineering/writing-tools-for-agents) .\n\nAs such, your tools should be primary actions you want your agent to take. Learn how to make [custom tools](https://docs.claude.com/en/api/agent-sdk/custom-tools) in the Claude Agent SDK.\n\nFor our email agent, we might define tools like “`fetchInbox`\n\n” or “`searchEmails`\n\n” as the agent’s primary, most frequent actions.\n\nBash is useful as a general-purpose tool to allow the agent to do flexible work using a computer.\n\nIn our email agent, the user might have important information stored in their attachments. Claude could write code to download the PDF, convert it to text, and search across it to find useful information by calling, as depicted below:\n\nThe Claude Agent SDK excels at code generation—and for good reason. Code is precise, composable, and infinitely reusable, making it an ideal output for agents that need to perform complex operations reliably.\n\nWhen building agents, consider: which tasks would benefit from being expressed as code? Often, the answer unlocks significant capabilities.\n\nFor example, our recent launch of [file creation in ](https://www.anthropic.com/news/create-files)[Claude.AI](http://claude.ai/redirect/website.v1.bdb29daa-1a07-41ec-87f6-579dc33634bd) relies entirely on code generation. Claude writes Python scripts to create Excel spreadsheets, PowerPoint presentations, and Word documents, ensuring consistent formatting and complex functionality that would be difficult to achieve any other way.\n\nIn our email agent, we might want to allow users to create rules for inbound emails. To achieve this, we could write code to run on that event:\n\nThe [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) provides standardized integrations to external services, handling authentication and API calls automatically. This means you can connect your agent to tools like Slack, GitHub, Google Drive, or Asana without writing custom integration code or managing OAuth flows yourself.\n\nFor our email agent, we might want to `search Slack messages`\n\nto understand team context, or `check Asana tasks`\n\nto see if someone has already been assigned to handle a customer request. With MCP servers, these integrations work out of the box—your agent can simply call tools like search_slack_messages or get_asana_tasks and the MCP handles the rest.\n\nThe growing [MCP ecosystem](https://github.com/modelcontextprotocol/servers) means you can quickly add new capabilities to your agents as pre-built integrations become available, letting you focus on agent behavior.\n\nThe Claude Code SDK finishes the agentic loop by evaluating its work. Agents that can check and improve their own output are fundamentally more reliable—they catch mistakes before they compound, self-correct when they drift, and get better as they iterate.\n\nThe key is giving Claude concrete ways to evaluate its work. Here are three approaches we've found effective:\n\nThe best form of feedback is providing clearly defined rules for an output, then explaining which rules failed and why.\n\n[Code linting](https://stackoverflow.com/questions/8503559/what-is-linting) is an excellent form of rules-based feedback. The more in-depth in feedback the better. For instance, it is usually better to generate TypeScript and lint it than it is to generate pure JavaScript because it provides you with multiple additional layers of feedback.\n\nWhen generating an email, you may want Claude to check that the email address is valid (if not, throw an error) and that the user has sent an email to them before (if so, throw a warning).\n\nWhen using an agent to complete visual tasks, like UI generation or testing, visual feedback (in the form of screenshots or renders) can be helpful. For example, if sending an email with HTML formatting, you could screenshot the generated email and provide it back to the model for visual verification and iterative refinement. The model would then check whether the visual output matches what was requested.\n\nFor instance:\n\n**Layout**- Are elements positioned correctly? Is spacing appropriate?**Styling**- Do colors, fonts, and formatting appear as intended?**Content hierarchy**- Is information presented in the right order with proper emphasis?**Responsiveness**- Does it look broken or cramped? (though a single screenshot has limited viewport info)\n\nUsing an MCP server like Playwright, you can automate this visual feedback loop—taking screenshots of rendered HTML, capturing different viewport sizes, and even testing interactive elements—all within your agent's workflow.\n\nYou can also have another language model “judge\" the output of your agent based on fuzzy rules. This is generally not a very robust method, and can have heavy latency tradeoffs, but for applications where any boost in performance is worth the cost, it can be helpful.\n\nOur email agent might have a separate subagent judge the tone of its drafts, to see if they fit well with the user’s previous messages.\n\nAfter you’ve gone through the agent loop a few times, we recommend testing your agent, and ensuring that it’s well-equipped for its tasks. The best way to improve an agent is to look carefully at its output, especially the cases where it fails, and to put yourself in its shoes: does it have the [right tools](https://www.anthropic.com/engineering/writing-tools-for-agents) for the job?\n\nHere are some other questions to ask as you’re evaluating whether or not your agent is well-equipped to do its job:\n\n- If your agent misunderstands the task, it might be missing key information. Can you alter the structure of your search APIs to make it easier to find what it needs to know?\n- If your agent fails at a task repeatedly, can you add a formal rule in your tool calls to identify and fix the failure?\n- If your agent can’t fix its errors, can you give it more useful or creative tools to approach the problem differently?\n- If your agent’s performance varies as you add features, build a representative test set for programmatic evaluations (or evals) based on customer usage.\n\nThe Claude Agent SDK makes it easier to build autonomous agents by giving Claude access to a computer where it can write files, run commands, and iterate on its work.\n\nWith the agent loop in mind (gathering context, taking action, and your verifying work), you can build reliable agents that are easy to deploy and iterate on.\n\nYou can [get started](https://docs.claude.com/en/api/agent-sdk/overview) with the Claude Agent SDK today. For developers who are already building on the SDK, we recommend migrating to the latest version by following [this guide](https://docs.claude.com/en/docs/claude-code/sdk/migration-guide).\n\nWritten by Thariq Shihipar with notes and editing from Molly Vorwerck, Suzanne Wang, Alex Isken, Cat Wu, Keir Bradwell, Alexander Bricken & Ashwin Bhat.\n\nGet the developer newsletter\n\nProduct updates, how-tos, community spotlights, and more. Delivered monthly to your inbox.", "content_chars": 14109, "fetch_status": "ok"}, {"id": 4, "title": "How Claude remembers your project (Memory)", "url": "https://code.claude.com/docs/en/memory", "author": "Anthropic", "publisher": "Anthropic Docs", "date": "2026 (continuously updated)", "official": true, "topics": ["claude_md", "memoria", "auto_memory", "rules", "subagent_memory"], "summary": "Doc canonico del sistema de memoria: CLAUDE.md vs auto memory, .claude/rules/, path-scoped rules, MEMORY.md, troubleshooting.", "content_markdown": "Each Claude Code session begins with a fresh context window. Two mechanisms carry knowledge across sessions:## Documentation Index\n\nFetch the complete documentation index at:\n\n[https://code.claude.com/docs/llms.txt]Use this file to discover all available pages before exploring further.\n\n\n**CLAUDE.md files**: instructions you write to give Claude persistent context**Auto memory**: notes Claude writes itself based on your corrections and preferences\n\n[Write and organize CLAUDE.md files](https://code.claude.com#claude-md-files)[Scope rules to specific file types](https://code.claude.com#organize-rules-with-claude/rules/)with`.claude/rules/`\n\n[Configure auto memory](https://code.claude.com#auto-memory)so Claude takes notes automatically[Troubleshoot](https://code.claude.com#troubleshoot-memory-issues)when instructions aren’t being followed\n\n## CLAUDE.md vs auto memory\n\nClaude Code has two complementary memory systems. Both are loaded at the start of every conversation. Claude treats them as context, not enforced configuration. The more specific and concise your instructions, the more consistently Claude follows them.| CLAUDE.md files | Auto memory | |\n|---|---|---|\nWho writes it | You | Claude |\nWhat it contains | Instructions and rules | Learnings and patterns |\nScope | Project, user, or org | Per working tree |\nLoaded into | Every session | Every session (first 200 lines or 25KB) |\nUse for | Coding standards, workflows, project architecture | Build commands, debugging insights, preferences Claude discovers |\n\n[subagent configuration](https://code.claude.com/docs/en/sub-agents#enable-persistent-memory)for details.\n\n## CLAUDE.md files\n\nCLAUDE.md files are markdown files that give Claude persistent instructions for a project, your personal workflow, or your entire organization. You write these files in plain text; Claude reads them at the start of every session.### When to add to CLAUDE.md\n\nTreat CLAUDE.md as the place you write down what you’d otherwise re-explain. Add to it when:- Claude makes the same mistake a second time\n- A code review catches something Claude should have known about this codebase\n- You type the same correction or clarification into chat that you typed last session\n- A new teammate would need the same context to be productive\n\n[skill](https://code.claude.com/docs/en/skills)or a\n\n[path-scoped rule](https://code.claude.com#organize-rules-with-claude/rules/)instead. The\n\n[extension overview](https://code.claude.com/docs/en/features-overview#build-your-setup-over-time)covers when to use each mechanism.\n\n### Choose where to put CLAUDE.md files\n\nCLAUDE.md files can live in several locations, each with a different scope. More specific locations take precedence over broader ones.| Scope | Location | Purpose | Use case examples | Shared with |\n|---|---|---|---|---|\nManaged policy | • macOS: `/Library/Application Support/ClaudeCode/CLAUDE.md` • Linux and WSL: `/etc/claude-code/CLAUDE.md` • Windows: `C:\\Program Files\\ClaudeCode\\CLAUDE.md` | Organization-wide instructions managed by IT/DevOps | Company coding standards, security policies, compliance requirements | All users in organization |\nProject instructions | `./CLAUDE.md` or `./.claude/CLAUDE.md` | Team-shared instructions for the project | Project architecture, coding standards, common workflows | Team members via source control |\nUser instructions | `~/.claude/CLAUDE.md` | Personal preferences for all projects | Code styling preferences, personal tooling shortcuts | Just you (all projects) |\nLocal instructions | `./CLAUDE.local.md` | Personal project-specific preferences; add to `.gitignore` | Your sandbox URLs, preferred test data | Just you (current project) |\n\n[How CLAUDE.md files load](https://code.claude.com#how-claude-md-files-load)for the full resolution order. For large projects, you can break instructions into topic-specific files using\n\n[project rules](https://code.claude.com#organize-rules-with-claude/rules/). Rules let you scope instructions to specific file types or subdirectories.\n\n### Set up a project CLAUDE.md\n\nA project CLAUDE.md can be stored in either`./CLAUDE.md`\n\nor `./.claude/CLAUDE.md`\n\n. Create this file and add instructions that apply to anyone working on the project: build and test commands, coding standards, architectural decisions, naming conventions, and common workflows. These instructions are shared with your team through version control, so focus on project-level standards rather than personal preferences.\n### Write effective instructions\n\nCLAUDE.md files are loaded into the context window at the start of every session, consuming tokens alongside your conversation. The[context window visualization](https://code.claude.com/docs/en/context-window)shows where CLAUDE.md loads relative to the rest of the startup context. Because they’re context rather than enforced configuration, how you write instructions affects how reliably Claude follows them. Specific, concise, well-structured instructions work best.\n\n**Size**: target under 200 lines per CLAUDE.md file. Longer files consume more context and reduce adherence. If your instructions are growing large, use\n\n[path-scoped rules](https://code.claude.com#path-specific-rules)so instructions load only when Claude works with matching files. You can also split content into\n\n[imports](https://code.claude.com#import-additional-files)for organization, though imported files still load and enter the context window at launch.\n\n**Structure**: use markdown headers and bullets to group related instructions. Claude scans structure the same way readers do: organized sections are easier to follow than dense paragraphs.\n\n**Specificity**: write instructions that are concrete enough to verify. For example:\n\n- “Use 2-space indentation” instead of “Format code properly”\n- “Run\n`npm test`\n\nbefore committing” instead of “Test your changes” - “API handlers live in\n`src/api/handlers/`\n\n” instead of “Keep files organized”\n\n**Consistency**: if two rules contradict each other, Claude may pick one arbitrarily. Review your CLAUDE.md files, nested CLAUDE.md files in subdirectories, and\n\n[periodically to remove outdated or conflicting instructions. In monorepos, use](https://code.claude.com#organize-rules-with-claude/rules/)\n\n`.claude/rules/`\n\n[to skip CLAUDE.md files from other teams that aren’t relevant to your work.](https://code.claude.com#exclude-specific-claude-md-files)\n\n`claudeMdExcludes`\n\n### Import additional files\n\nCLAUDE.md files can import additional files using`@path/to/import`\n\nsyntax. Imported files are expanded and loaded into context at launch alongside the CLAUDE.md that references them.\nBoth relative and absolute paths are allowed. Relative paths resolve relative to the file containing the import, not the working directory. Imported files can recursively import other files, with a maximum depth of five hops.\nTo pull in a README, package.json, and a workflow guide, reference them with `@`\n\nsyntax anywhere in your CLAUDE.md:\n`CLAUDE.local.md`\n\nat the project root. It loads alongside `CLAUDE.md`\n\nand is treated the same way. Add `CLAUDE.local.md`\n\nto your `.gitignore`\n\nso it isn’t committed; running `/init`\n\nand choosing the personal option does this for you.\nIf you work across multiple git worktrees of the same repository, a gitignored `CLAUDE.local.md`\n\nonly exists in the worktree where you created it. To share personal instructions across worktrees, import a file from your home directory instead:\n[.](https://code.claude.com#organize-rules-with-claude/rules/)\n\n`.claude/rules/`\n\n### AGENTS.md\n\nClaude Code reads`CLAUDE.md`\n\n, not `AGENTS.md`\n\n. If your repository already uses `AGENTS.md`\n\nfor other coding agents, create a `CLAUDE.md`\n\nthat imports it so both tools read the same instructions without duplicating them. You can also add Claude-specific instructions below the import. Claude loads the imported file at session start, then appends the rest:\nCLAUDE.md\n\n### How CLAUDE.md files load\n\nClaude Code reads CLAUDE.md files by walking up the directory tree from your current working directory, checking each directory along the way for`CLAUDE.md`\n\nand `CLAUDE.local.md`\n\nfiles. This means if you run Claude Code in `foo/bar/`\n\n, it loads instructions from `foo/bar/CLAUDE.md`\n\n, `foo/CLAUDE.md`\n\n, and any `CLAUDE.local.md`\n\nfiles alongside them.\nAll discovered files are concatenated into context rather than overriding each other. Across the directory tree, content is ordered from the filesystem root down to your working directory. For the `foo/bar/`\n\nexample, `foo/CLAUDE.md`\n\nappears in context before `foo/bar/CLAUDE.md`\n\n, so instructions closer to where you launched Claude are read last. Within each directory, `CLAUDE.local.md`\n\nis appended after `CLAUDE.md`\n\n, so your personal notes are the last thing Claude reads at that level.\nClaude also discovers `CLAUDE.md`\n\nand `CLAUDE.local.md`\n\nfiles in subdirectories under your current working directory. Instead of loading them at launch, they are included when Claude reads files in those subdirectories.\nIf you work in a large monorepo where other teams’ CLAUDE.md files get picked up, use [to skip them. Block-level HTML comments (](https://code.claude.com#exclude-specific-claude-md-files)\n\n`claudeMdExcludes`\n\n``\n\n) in CLAUDE.md files are stripped before the content is injected into Claude’s context. Use them to leave notes for human maintainers without spending context tokens on them. Comments inside code blocks are preserved. When you open a CLAUDE.md file directly with the Read tool, comments remain visible.\n#### Load from additional directories\n\nThe`--add-dir`\n\nflag gives Claude access to additional directories outside your main working directory. By default, CLAUDE.md files from these directories are not loaded.\nTo also load memory files from additional directories, set the `CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD`\n\nenvironment variable:\n`CLAUDE.md`\n\n, `.claude/CLAUDE.md`\n\n, `.claude/rules/*.md`\n\n, and `CLAUDE.local.md`\n\nfrom the additional directory. `CLAUDE.local.md`\n\nis skipped if you exclude `local`\n\nfrom [.](https://code.claude.com/docs/en/cli-reference)\n\n`--setting-sources`\n\n### Organize rules with `.claude/rules/`\n\n\nFor larger projects, you can organize instructions into multiple files using the `.claude/rules/`\n\ndirectory. This keeps instructions modular and easier for teams to maintain. Rules can also be [scoped to specific file paths](https://code.claude.com#path-specific-rules), so they only load into context when Claude works with matching files, reducing noise and saving context space.\n\nRules load into context every session or when matching files are opened. For task-specific instructions that don’t need to be in context all the time, use\n\n[skills](https://code.claude.com/docs/en/skills)instead, which only load when you invoke them or when Claude determines they’re relevant to your prompt.#### Set up rules\n\nPlace markdown files in your project’s`.claude/rules/`\n\ndirectory. Each file should cover one topic, with a descriptive filename like `testing.md`\n\nor `api-design.md`\n\n. All `.md`\n\nfiles are discovered recursively, so you can organize rules into subdirectories like `frontend/`\n\nor `backend/`\n\n:\n[are loaded at launch with the same priority as](https://code.claude.com#path-specific-rules)\n\n`paths`\n\nfrontmatter`.claude/CLAUDE.md`\n\n.\n#### Path-specific rules\n\nRules can be scoped to specific files using YAML frontmatter with the`paths`\n\nfield. These conditional rules only apply when Claude is working with files matching the specified patterns.\n`paths`\n\nfield are loaded unconditionally and apply to all files. Path-scoped rules trigger when Claude reads files matching the pattern, not on every tool use.\nUse glob patterns in the `paths`\n\nfield to match files by extension, directory, or any combination:\n| Pattern | Matches |\n|---|---|\n`**/*.ts` | All TypeScript files in any directory |\n`src/**/*` | All files under `src/` directory |\n`*.md` | Markdown files in the project root |\n`src/components/*.tsx` | React components in a specific directory |\n\n#### Share rules across projects with symlinks\n\nThe`.claude/rules/`\n\ndirectory supports symlinks, so you can maintain a shared set of rules and link them into multiple projects. Symlinks are resolved and loaded normally, and circular symlinks are detected and handled gracefully.\nThis example links both a shared directory and an individual file:\n#### User-level rules\n\nPersonal rules in`~/.claude/rules/`\n\napply to every project on your machine. Use them for preferences that aren’t project-specific:\n### Manage CLAUDE.md for large teams\n\nFor organizations deploying Claude Code across teams, you can centralize instructions and control which CLAUDE.md files are loaded.#### Deploy organization-wide CLAUDE.md\n\nOrganizations can deploy a centrally managed CLAUDE.md that applies to all users on a machine. This file cannot be excluded by individual settings.Create the file at the managed policy location\n\n- macOS:\n`/Library/Application Support/ClaudeCode/CLAUDE.md`\n\n- Linux and WSL:\n`/etc/claude-code/CLAUDE.md`\n\n- Windows:\n`C:\\Program Files\\ClaudeCode\\CLAUDE.md`\n\n\nDeploy with your configuration management system\n\nUse MDM, Group Policy, Ansible, or similar tools to distribute the file across developer machines. See\n\n[managed settings](https://code.claude.com/docs/en/permissions#managed-settings)for other organization-wide configuration options.[managed settings](https://code.claude.com/docs/en/settings#settings-files)serve different purposes. Use settings for technical enforcement and CLAUDE.md for behavioral guidance:\n\n| Concern | Configure in |\n|---|---|\n| Block specific tools, commands, or file paths | Managed settings: `permissions.deny` |\n| Enforce sandbox isolation | Managed settings: `sandbox.enabled` |\n| Environment variables and API provider routing | Managed settings: `env` |\n| Authentication method and organization lock | Managed settings: `forceLoginMethod` , `forceLoginOrgUUID` |\n| Code style and quality guidelines | Managed CLAUDE.md |\n| Data handling and compliance reminders | Managed CLAUDE.md |\n| Behavioral instructions for Claude | Managed CLAUDE.md |\n\n#### Exclude specific CLAUDE.md files\n\nIn large monorepos, ancestor CLAUDE.md files may contain instructions that aren’t relevant to your work. The`claudeMdExcludes`\n\nsetting lets you skip specific files by path or glob pattern.\nThis example excludes a top-level CLAUDE.md and a rules directory from a parent folder. Add it to `.claude/settings.local.json`\n\nso the exclusion stays local to your machine:\n`claudeMdExcludes`\n\nat any [settings layer](https://code.claude.com/docs/en/settings#settings-files): user, project, local, or managed policy. Arrays merge across layers. Managed policy CLAUDE.md files cannot be excluded. This ensures organization-wide instructions always apply regardless of individual settings.\n\n## Auto memory\n\nAuto memory lets Claude accumulate knowledge across sessions without you writing anything. Claude saves notes for itself as it works: build commands, debugging insights, architecture notes, code style preferences, and workflow habits. Claude doesn’t save something every session. It decides what’s worth remembering based on whether the information would be useful in a future conversation.Auto memory requires Claude Code v2.1.59 or later. Check your version with\n\n`claude --version`\n\n.### Enable or disable auto memory\n\nAuto memory is on by default. To toggle it, open`/memory`\n\nin a session and use the auto memory toggle, or set `autoMemoryEnabled`\n\nin your project settings:\n`CLAUDE_CODE_DISABLE_AUTO_MEMORY=1`\n\n.\n### Storage location\n\nEach project gets its own memory directory at`~/.claude/projects/<project>/memory/`\n\n. The `<project>`\n\npath is derived from the git repository, so all worktrees and subdirectories within the same repo share one auto memory directory. Outside a git repo, the project root is used instead.\nTo store auto memory in a different location, set `autoMemoryDirectory`\n\nin your user settings at `~/.claude/settings.json`\n\n:\n`~/`\n\n. This setting is accepted from policy and user settings, and from the `--settings`\n\nflag. It is not accepted from project or local settings, since both files live inside the project directory and a cloned repository could supply either to redirect auto memory writes to sensitive locations.\nThe directory contains a `MEMORY.md`\n\nentrypoint and optional topic files:\n`MEMORY.md`\n\nacts as an index of the memory directory. Claude reads and writes files in this directory throughout your session, using `MEMORY.md`\n\nto keep track of what’s stored where.\nAuto memory is machine-local. All worktrees and subdirectories within the same git repository share one auto memory directory. Files are not shared across machines or cloud environments.\n### How it works\n\nThe first 200 lines of`MEMORY.md`\n\n, or the first 25KB, whichever comes first, are loaded at the start of every conversation. Content beyond that threshold is not loaded at session start. Claude keeps `MEMORY.md`\n\nconcise by moving detailed notes into separate topic files.\nThis limit applies only to `MEMORY.md`\n\n. CLAUDE.md files are loaded in full regardless of length, though shorter files produce better adherence.\nTopic files like `debugging.md`\n\nor `patterns.md`\n\nare not loaded at startup. Claude reads them on demand using its standard file tools when it needs the information.\nClaude reads and writes memory files during your session. When you see “Writing memory” or “Recalled memory” in the Claude Code interface, Claude is actively updating or reading from `~/.claude/projects/<project>/memory/`\n\n.\n### Audit and edit your memory\n\nAuto memory files are plain markdown you can edit or delete at any time. Run[to browse and open memory files from within a session.](https://code.claude.com#view-and-edit-with-memory)\n\n`/memory`\n\n## View and edit with `/memory`\n\n\nThe `/memory`\n\ncommand lists all CLAUDE.md, CLAUDE.local.md, and rules files loaded in your current session, lets you toggle auto memory on or off, and provides a link to open the auto memory folder. Select any file to open it in your editor.\nWhen you ask Claude to remember something, like “always use pnpm, not npm” or “remember that the API tests require a local Redis instance,” Claude saves it to auto memory. To add instructions to CLAUDE.md instead, ask Claude directly, like “add this to CLAUDE.md,” or edit the file yourself via `/memory`\n\n.\n## Troubleshoot memory issues\n\nThese are the most common issues with CLAUDE.md and auto memory, along with steps to debug them.### Claude isn’t following my CLAUDE.md\n\nCLAUDE.md content is delivered as a user message after the system prompt, not as part of the system prompt itself. Claude reads it and tries to follow it, but there’s no guarantee of strict compliance, especially for vague or conflicting instructions. To debug:- Run\n`/memory`\n\nto verify your CLAUDE.md and CLAUDE.local.md files are being loaded. If a file isn’t listed, Claude can’t see it. - Check that the relevant CLAUDE.md is in a location that gets loaded for your session (see\n[Choose where to put CLAUDE.md files](https://code.claude.com#choose-where-to-put-claude-md-files)). - Make instructions more specific. “Use 2-space indentation” works better than “format code nicely.”\n- Look for conflicting instructions across CLAUDE.md files. If two files give different guidance for the same behavior, Claude may pick one arbitrarily.\n\n[. This must be passed every invocation, so it’s better suited to scripts and automation than interactive use.](https://code.claude.com/docs/en/cli-reference#system-prompt-flags)\n\n`--append-system-prompt`\n\n### I don’t know what auto memory saved\n\nRun`/memory`\n\nand select the auto memory folder to browse what Claude has saved. Everything is plain markdown you can read, edit, or delete.\n### My CLAUDE.md is too large\n\nFiles over 200 lines consume more context and may reduce adherence. Use[path-scoped rules](https://code.claude.com#path-specific-rules)to load instructions only when Claude works with matching files, or trim content that isn’t needed in every session. Splitting into\n\n[helps organization but does not reduce context, since imported files load at launch.](https://code.claude.com#import-additional-files)\n\n`@path`\n\nimports### Instructions seem lost after `/compact`\n\n\nProject-root CLAUDE.md survives compaction: after `/compact`\n\n, Claude re-reads it from disk and re-injects it into the session. Nested CLAUDE.md files in subdirectories are not re-injected automatically; they reload the next time Claude reads a file in that subdirectory.\nIf an instruction disappeared after compaction, it was either given only in conversation or lives in a nested CLAUDE.md that hasn’t reloaded yet. Add conversation-only instructions to CLAUDE.md to make them persist. See [What survives compaction](https://code.claude.com/docs/en/context-window#what-survives-compaction)for the full breakdown. See\n\n[Write effective instructions](https://code.claude.com#write-effective-instructions)for guidance on size, structure, and specificity.\n\n## Related resources\n\n[Debug your configuration](https://code.claude.com/docs/en/debug-your-config): diagnose why CLAUDE.md or settings aren’t taking effect[Skills](https://code.claude.com/docs/en/skills): package repeatable workflows that load on demand[Settings](https://code.claude.com/docs/en/settings): configure Claude Code behavior with settings files[Subagent memory](https://code.claude.com/docs/en/sub-agents#enable-persistent-memory): let subagents maintain their own auto memory", "content_chars": 21593, "fetch_status": "ok"}, {"id": 5, "title": "Claude Code Changelog (oficial)", "url": "https://code.claude.com/docs/en/changelog", "author": "Anthropic", "publisher": "Anthropic Docs", "date": "Updated continuously (last entry 2026-05-06)", "official": true, "topics": ["novedades", "changelog", "releases"], "summary": "Changelog oficial version por version (v2.1.x). Source of truth para que cambia mes a mes.", "content_markdown": "This page is generated from the## Documentation Index\n\nFetch the complete documentation index at:\n\n[https://code.claude.com/docs/llms.txt]Use this file to discover all available pages before exploring further.\n\n\n[CHANGELOG.md on GitHub](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md). Run\n\n`claude --version`\n\nto check your installed version.\n- Added\n`CLAUDE_CODE_SESSION_ID`\n\nenvironment variable to the Bash tool subprocess environment, matching the`session_id`\n\npassed to hooks - Added\n`CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1`\n\nenv var to opt out of the fullscreen alternate-screen renderer and keep the conversation in the terminal’s native scrollback - Added a “Pasting…” footer hint while a Ctrl+V image paste is being read from the clipboard\n- Fixed external SIGINT (e.g. IDE stop button,\n`kill -INT`\n\n) not running graceful shutdown — terminal modes are now restored and the`--resume`\n\nhint is printed instead of an abrupt exit - Fixed an uncaught exception when the terminal is closed or SSH disconnects mid-session under the native build\n- Fixed\n`--resume`\n\nfailing with`no low surrogate in string`\n\nwhen a tool error truncation split an emoji; pre-corrupted sessions are sanitized on load - Fixed\n`--permission-mode`\n\nflag being ignored when resuming a plan-mode session with`-p --continue`\n\n/`--resume`\n\n, and plan mode not being re-applied after`ExitPlanMode`\n\nwithin the same session - Fixed fullscreen mode showing a blank screen after laptop sleep/wake or Ctrl+Z/\n`fg`\n\nuntil the next keystroke or stream output - Fixed cursor landing mid-grapheme on Ctrl+E/A/K/U/arrow keys when an Indic conjunct or ZWJ emoji wraps across lines\n- Fixed vim operators corrupting text containing decomposed (NFD) accented characters\n- Fixed pasting text starting with\n`/`\n\nsilently swallowing the input or triggering an unknown-command reply - Fixed pasting dumping stray escape sequences into the prompt when focus events or mouse-tracking reports interleave with the bracketed paste\n- Fixed mouse wheel scrolling being too fast in Cursor and VS Code 1.92–1.104 due to an upstream xterm.js bug\n- Fixed scroll-wheel handling in JetBrains IDE 2025.2 terminals (spurious arrow keys, wrong-direction events, runaway acceleration)\n- Fixed\n`/usage`\n\nCtrl+S hanging when copying the stats screenshot to the clipboard on Linux/X11 - Fixed\n`/terminal-setup`\n\nshowing a contradictory error in Windows Terminal — Shift+Enter is natively supported there - Fixed\n`/effort`\n\npicker not reflecting the`CLAUDE_CODE_EFFORT_LEVEL`\n\nenv var override - Fixed\n`/status`\n\nshowing the wrong default model for some users - Fixed slash command autocomplete popup being capped at ~3–5 visible commands instead of scaling with terminal height\n- Fixed statusline\n`context_window`\n\ntoken counts reflecting cumulative session totals instead of current context usage - Fixed Alt+T (thinking toggle) not working on macOS terminals without “Option as Meta” enabled (iTerm2, Terminal.app defaults)\n- Fixed dead keyboard input on Windows after re-opening a background session from\n`claude agents`\n\n- Fixed unbounded memory growth (10GB+ RSS) when a stdio MCP server writes non-protocol data to stdout\n- Fixed MCP servers that connect but fail\n`tools/list`\n\nsilently showing 0 tools — they now retry once and show “connected · tools fetch failed” in`/mcp`\n\n- Fixed unauthorized claude.ai MCP connectors showing as “failed” instead of “needs auth”, and headless\n`-p`\n\nmode retrying non-transient 4xx connection failures - Improved visual consistency in slash command dialogs and\n`/login`\n\n,`/upgrade`\n\n,`/extra-usage`\n\ndialog spacing - Updated the\n`/tui fullscreen`\n\nstartup banner to describe additional renderer benefits (lower memory usage, mouse support, auto-copy on select) - Fixed Bedrock and Vertex 400 errors when\n`ENABLE_PROMPT_CACHING_1H`\n\nis set\n\n- Fixed VS Code extension failing to activate on Windows due to a hardcoded build path in the bundled SDK (\n`createRequire`\n\npolyfill bug) - Fixed Mantle endpoint authentication failing with missing\n`x-api-key`\n\nheader\n\n- Added\n`--plugin-url <url>`\n\nflag to fetch a plugin`.zip`\n\narchive from a URL for the current session - Added\n`CLAUDE_CODE_FORCE_SYNC_OUTPUT=1`\n\nenv var to force-enable synchronized output on terminals that auto-detection misses (e.g. Emacs`eat`\n\n) - Added\n`CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE`\n\n: when set on Homebrew or WinGet installations, Claude Code runs the upgrade command in the background and prompts to restart - Plugin manifests:\n`themes`\n\nand`monitors`\n\nshould now be declared under`\"experimental\": { ... }`\n\n. Top-level declarations still work but`claude plugin validate`\n\nwill warn - Gateway\n`/v1/models`\n\ndiscovery for the`/model`\n\npicker is now opt-in via`CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1`\n\n(was automatic in 2.1.126–2.1.128) - Ctrl+R history picker now defaults to searching all prompts across all projects, matching pre-2.1.124 behavior. Press Ctrl+S to narrow to the current project or session\n- Third-party deployments (Bedrock, Vertex, Foundry, or\n`ANTHROPIC_BASE_URL`\n\ngateway) no longer see spinner tips pointing at first-party Anthropic surfaces `skillOverrides`\n\nsetting now works:`off`\n\nhides from model and`/`\n\n,`user-invocable-only`\n\nhides from model only,`name-only`\n\ncollapses description- The\n`claude_code.pull_request.count`\n\nOTel metric now counts PRs/MRs created via MCP tools, not just shell commands - Policy refusal error messages now include the API Request ID for easier support debugging\n- Fixed API errors with unrecognized 400 status codes showing raw JSON instead of the underlying error message\n- Fixed\n`/clear`\n\nnot resetting the terminal tab title after a conversation - Fixed session title chip from\n`/rename`\n\ndisappearing while a permission or other dialog is active - Fixed agent panel below the prompt being hidden when subagents are running (regression in 2.1.122)\n- Fixed external-editor handoff (Ctrl+G) blanking the conversation history above the prompt\n- Fixed\n`/context`\n\ndumping its rendered ASCII visualization grid into the conversation, wasting ~1.6k tokens per call - Fixed\n`/agents`\n\nLibrary list arrow-key navigation: the highlighted agent now stays visible when the list exceeds the viewport - Fixed\n`/branch`\n\nsuccess message not including the new branch’s session id for`/resume`\n\n- Fixed bold headers with keycap/ZWJ/skin-tone emoji losing trailing characters in fullscreen mode\n- Fixed server-managed settings policy not applying for enterprise/team users whose stored OAuth credentials lacked the\n`user:inference`\n\nscope - Fixed OAuth refresh race after wake-from-sleep that could log out all running sessions\n- Fixed 1-hour prompt cache TTL being silently downgraded to 5 minutes\n- Fixed cache-miss warning appearing spuriously after\n`/clear`\n\nor compaction when changing`/effort`\n\nor`/model`\n\n- Fixed\n`Bash(mkdir *)`\n\n,`Bash(touch *)`\n\nand similar allow rules not being honored for in-project paths - Fixed\n`deniedMcpServers`\n\npatterns with a`*://`\n\nscheme wildcard not matching mixed-case hostnames - Fixed harmless WebSocket warning being logged as an error in\n`--debug`\n\nduring voice mode - [VSCode] Fixed\n`/clear`\n\nnot clearing the conversation context and displayed transcript\n\n- Bare\n`/color`\n\n(no args) now picks a random session color `/mcp`\n\nnow shows the tool count for connected servers and flags servers that connected with 0 tools`--plugin-dir`\n\nnow accepts`.zip`\n\nplugin archives in addition to directories`--channels`\n\nnow works with console (API key) authentication — console orgs with managed settings must set`channelsEnabled: true`\n\nto enable- Updated\n`/model`\n\npicker: collapsed duplicate Opus 4.7 entries, and current Opus now shows as “Opus” instead of “Opus 4.7” - Subprocesses (Bash, hooks, MCP, LSP) no longer inherit\n`OTEL_*`\n\nenvironment variables, so OTEL-instrumented apps run via the Bash tool no longer pick up the CLI’s own OTLP endpoint - MCP:\n`workspace`\n\nis now a reserved server name — existing servers with that name will be skipped with a warning - Reconnecting MCP servers no longer flood the conversation with full tool-name lists on every reconnect — re-announced tools are summarized by server prefix\n- SDK hosts now receive a persistent\n`localSettings`\n\nsuggestion for Bash permission prompts, so “Always allow” writes to`.claude/settings.local.json`\n\n`EnterWorktree`\n\nnow creates the new branch from local HEAD as documented, instead of`origin/<default-branch>`\n\n— unpushed commits are no longer dropped- Auto mode: when the classifier can’t evaluate an action, the error now includes a hint (retry,\n`/compact`\n\n, or run with`--debug`\n\n) - Fixed focus mode briefly dimming the previous response when submitting a new prompt\n- Fixed stray “4;0;” desktop notification on every\n`/exit`\n\nin Kitty and other terminals that interpret OSC 9 as a notification - Fixed Remote Control showing an empty “Opening your options…” message on rate limit instead of actionable upsell options\n- Fixed drag-and-drop image upload hanging on “Pasting text…” when the image read fails\n- Fixed crash loop when piping very large input (>10 MB) to\n`claude -p`\n\nvia stdin - Fixed long URLs not being individually clickable on every wrapped row in fullscreen mode\n- Fixed\n`/plugin`\n\nComponents panel showing “Marketplace ‘inline’ not found” for plugins loaded via`--plugin-dir`\n\n- Fixed MCP tool results dropping images when the server returns both structured content and content blocks\n- Fixed fenced code blocks inside list items carrying leading whitespace into the clipboard on copy-paste\n- Fixed tab navigation in\n`/config`\n\nstranding focus — the tab header now stays focused so arrows and Esc keep working - Fixed markdown link labels being lost on terminals without OSC 8 hyperlink support — links now render as\n`label (url)`\n\ninstead of just the URL - Fixed sessions on 1M-context models with a smaller autocompact window being falsely blocked with “Prompt is too long” before reaching the actual API limit\n- Fixed parallel shell tool calls: a failing read-only command (grep, git diff, ls) no longer cancels sibling calls\n- Fixed banner showing “with X effort” on models that don’t support effort\n- Fixed\n`/fast`\n\non 3P providers fuzzy-matching to an unrelated skill instead of showing “not available” - Fixed Bedrock default model resolving to\n`global.*`\n\ninstead of the region-appropriate prefix - Fixed vim mode:\n`Space`\n\nin NORMAL mode now moves the cursor right, matching standard vi/vim behavior - Fixed terminal progress indicator (OSC 9;4) flickering off between tool calls — stays visible across the full turn\n- Fixed\n`/rename`\n\nwithout args failing on resumed sessions whose last entry is a compact boundary - Fixed stale “remote-control is active” status lines from prior sessions appearing after\n`--resume`\n\n/`--continue`\n\n- Fixed stale\n`installed_plugins.json`\n\nentries pointing at deleted cache directories polluting PATH - Fixed MCP stdio servers receiving corrupted arguments when\n`CLAUDE_CODE_SHELL_PREFIX`\n\nis set and an argument contains spaces or shell metacharacters - Fixed sub-agent progress summaries missing the prompt cache (~3×\n`cache_creation`\n\nreduction) - Fixed\n`/plugin update`\n\nnever detecting new versions of npm-sourced plugins - Fixed sub-agent summaries firing repeatedly while a sub-agent’s transcript is static, capping worst-case token cost on idle sub-agents\n- Headless\n`--output-format stream-json`\n\n:`init.plugin_errors`\n\nnow includes`--plugin-dir`\n\nload failures in addition to dependency demotions\n\n- The\n`/model`\n\npicker now lists models from your gateway’s`/v1/models`\n\nendpoint when`ANTHROPIC_BASE_URL`\n\npoints at an Anthropic-compatible gateway -\n- Added\n`claude project purge [path]`\n\nto delete all Claude Code state for a project (transcripts, tasks, file history, config entry) — supports`--dry-run`\n\n,`-y/--yes`\n\n,`-i/--interactive`\n\n, and`--all`\n\n\n- Added\n`--dangerously-skip-permissions`\n\nnow bypasses prompts for writes to`.claude/`\n\n,`.git/`\n\n,`.vscode/`\n\n, shell config files, and other previously-protected paths (catastrophic removal commands still prompt as a safety net)`claude auth login`\n\nnow accepts the OAuth code pasted into the terminal when the browser callback can’t reach localhost (WSL2, SSH, containers)`claude_code.skill_activated`\n\nOpenTelemetry event now fires for user-typed slash commands and carries a new`invocation_trigger`\n\nattribute (`\"user-slash\"`\n\n,`\"claude-proactive\"`\n\n, or`\"nested-skill\"`\n\n)- Auto mode: the spinner now turns red when a permission check stalls, instead of looking like the tool is running\n- Host-managed deployments (\n`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`\n\n) no longer auto-disable analytics on Bedrock/Vertex/Foundry - Windows: PowerShell 7 installed via the Microsoft Store, MSI without PATH, or\n`.NET global tool`\n\nis now detected - Windows: when the PowerShell tool is enabled, Claude now treats PowerShell as the primary shell instead of defaulting to Bash\n- Read tool: removed the per-file malware-assessment reminder that could cause spurious refusals and “this is not malware” commentary on legacy models\n**Security:**Fixed`allowManagedDomainsOnly`\n\n/`allowManagedReadPathsOnly`\n\nbeing ignored when a higher-priority managed-settings source lacked a`sandbox`\n\nblock- Fixed pasting an image larger than 2000px breaking the session — images are now downscaled on paste, and oversized images in history are automatically removed and the request retried\n- Fixed showing the login screen for “OAuth not allowed for organization” errors — now shows guidance to contact your admin\n- Fixed OAuth login failing with timeout on slow or proxied connections, in IPv6-only devcontainers, and when the browser callback can’t reach localhost\n- Fixed a rare race where a concurrent credential write could clear a valid OAuth refresh token\n- Fixed API retry countdown sticking at “0s” instead of counting down between attempts\n- Fixed “Stream idle timeout” error after waking Mac from sleep mid-request\n- Fixed background and remote sessions falsely aborting with “Stream idle timeout” during long model thinking pauses\n- Fixed a hang where the assistant could finish thinking but show no output after a run of empty turns\n- Fixed overly fast trackpad scrolling in Cursor and VS Code 1.92–1.104 integrated terminals\n- Fixed claude.ai MCP connectors being suppressed by manual servers stuck in needs-auth state\n- Fixed Japanese/Korean/Chinese text rendering as garbled characters on Windows in no-flicker mode\n- Fixed\n`Ctrl+L`\n\nclearing the prompt input — it now only forces a screen redraw, matching readline behavior - Fixed deferred tools (WebSearch, WebFetch, etc.) not being available to skills with\n`context: fork`\n\nand other subagents on their first turn - Fixed plan-mode tools being unavailable in interactive sessions launched with\n`--channels`\n\n- Fixed\n`/plugin`\n\nUninstall reporting “Enabled” instead of “Uninstalled” - Bounded total size of file-modified reminders when a linter touches many files at once\n- Fixed\n`/remote-control`\n\nretries appearing stuck on “connecting…” — each retry now shows its result - Fixed Remote Control failure notification not showing the error reason for initial connection failures\n- Windows: clipboard writes no longer expose copied content in process command-line arguments visible to EDR/SIEM telemetry; also fixes >22KB selections not reaching the clipboard\n- PowerShell tool: bare\n`--`\n\n(e.g.`git diff -- file`\n\n) is no longer mis-flagged as the`--%`\n\nstop-parsing token - Fixed Agent SDK hang when the model emits a malformed tool name in a parallel tool call batch\n\n- Fixed OAuth authentication failing with a 401 retry loop when\n`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1`\n\nis set\n\n- Added\n`ANTHROPIC_BEDROCK_SERVICE_TIER`\n\nenvironment variable to select a Bedrock service tier (`default`\n\n,`flex`\n\n, or`priority`\n\n), sent as the`X-Amzn-Bedrock-Service-Tier`\n\nheader - Pasting a PR URL into the\n`/resume`\n\nsearch box now finds the session that created that PR (GitHub, GitHub Enterprise, GitLab, and Bitbucket) `/mcp`\n\nnow shows claude.ai connectors hidden by a manually-added server with the same URL, with a hint to remove the duplicate- Clarified the\n`/mcp`\n\nmessage shown when an MCP server is still unauthorized after the browser sign-in flow - OpenTelemetry: numeric attributes on\n`api_request`\n\n/`api_error`\n\nlog events are now emitted as numbers, not strings - OpenTelemetry: added\n`claude_code.at_mention`\n\nlog event for`@`\n\n-mention resolution - Fixed\n`/branch`\n\nproducing forks that fail with “tool_use ids were found without tool_result blocks” when the source session contained entries from rewound timelines - Fixed\n`/model`\n\nnot showing the Effort option for Bedrock application inference profile ARNs, and those ARNs not receiving`output_config.effort`\n\n- Fixed Vertex AI / Bedrock returning\n`invalid_request_error: output_config: Extra inputs are not permitted`\n\non session-title generation and other structured-output queries - Fixed Vertex AI\n`count_tokens`\n\nendpoint returning 400 errors for users behind proxy gateways - Fixed\n`spinnerTipsOverride.excludeDefault`\n\nnot suppressing the time-based spinner tips - Fixed ToolSearch missing MCP tools that connected after session start in nonblocking mode\n- Fixed\n`!exit`\n\n/`!quit`\n\nin bash mode terminating the CLI instead of running as a shell command - Fixed images sent to newer models being resized to 2576px per side instead of the correct 2000px maximum\n- Fixed remote control session idle status redrawing twice per second, which could flood\n`tmux -CC`\n\ncontrol pipes and pause the terminal - Fixed assistant messages appearing blank in some sessions due to a stale view preference\n- Fixed a malformed hooks entry in\n`settings.json`\n\nno longer invalidating the entire file - Voice mode: keybindings bound to Caps Lock now show an error since terminals don’t deliver Caps Lock as a key event\n\n- Added\n`alwaysLoad`\n\noption to MCP server config — when`true`\n\n, all tools from that server skip tool-search deferral and are always available - Added\n`claude plugin prune`\n\nto remove orphaned auto-installed plugin dependencies;`plugin uninstall --prune`\n\ncascades - Added a type-to-filter search box to\n`/skills`\n\nso you can find a skill in long lists without scrolling - PostToolUse hooks can now replace tool output for all tools via\n`hookSpecificOutput.updatedToolOutput`\n\n(previously MCP-only) - Fullscreen mode: typing into the prompt no longer jumps scroll back to the bottom after you’ve scrolled up to read earlier output\n- Dialogs that overflow the terminal are now scrollable with arrow keys, PgUp/PgDn, home/end, and mouse wheel in both fullscreen and non-fullscreen modes\n- Clicking any line of a long URL that wraps across rows in fullscreen mode now opens the full URL\n- SDK and\n`claude -p`\n\n:`CLAUDE_CODE_FORK_SUBAGENT=1`\n\nnow works in non-interactive sessions `--dangerously-skip-permissions`\n\nno longer prompts for writes to`.claude/skills/`\n\n,`.claude/agents/`\n\n, and`.claude/commands/`\n\n`/terminal-setup`\n\nnow enables iTerm2’s “Applications in terminal may access clipboard” setting so`/copy`\n\nworks, including from tmux- MCP servers that hit a transient error during startup now auto-retry up to 3 times instead of staying disconnected\n- The terminal tab session title is now generated in your configured\n`language`\n\nsetting - Claude.ai connectors with the same upstream URL are now deduplicated instead of appearing as duplicates\n- Vertex AI: support X.509 certificate-based Workload Identity Federation (mTLS ADC)\n- Faster startup after upgrading: removed the Recent Activity panel from the release-notes splash\n- LSP diagnostic summaries now expand on click/ctrl+o and show the expand hint\n- SDK:\n`mcp_authenticate`\n\nnow supports`redirectUri`\n\nfor custom scheme completion and claude.ai connectors - OpenTelemetry: added\n`stop_reason`\n\n,`gen_ai.response.finish_reasons`\n\n, and`user_system_prompt`\n\n(gated behind`OTEL_LOG_USER_PROMPTS`\n\n) to LLM request spans - [VSCode] Voice dictation now respects the\n`accessibility.voice.speechLanguage`\n\nsetting when no Claude Code language is configured - [VSCode]\n`/context`\n\nnow opens a native token usage dialog - Fixed unbounded memory growth (multi-GB RSS) when processing many images in a session\n- Fixed\n`/usage`\n\nleaking up to ~2GB of memory on machines with large transcript histories - Fixed memory leak when long-running tools fail to emit a clear progress event\n- Fixed Bash tool becoming permanently unusable when the directory Claude was started in is deleted or moved mid-session\n- Fixed\n`--resume`\n\ncrashing on startup in external builds - Fixed\n`--resume`\n\nfailing on large sessions when a transcript line was corrupted by an unclean shutdown — the corrupt line is now skipped - Fixed\n`thinking.type.enabled is not supported`\n\nerror when using Bedrock application inference profile ARNs - Fixed Microsoft 365 MCP OAuth failing with duplicate or unsupported\n`prompt`\n\nparameter - Fixed scrollback duplication when pressing Ctrl+L or triggering a redraw in non-fullscreen mode on tmux, GNOME Terminal, Windows Terminal, and Konsole\n- Fixed claude.ai MCP connectors silently disappearing when the connector-list fetch hits a transient auth error at startup\n- Fixed “Always allow” rules for built-in tools in remote sessions not surviving worker restarts\n- Fixed\n`NO_PROXY`\n\nnot being respected for all HTTP clients when set via`managed-settings.json`\n\nunder the native build - Fixed managed settings approval prompt exiting the session even when accepted — now applies settings and continues\n- Fixed\n`/usage`\n\nreturning “rate limited” after a stale OAuth token — now refreshes automatically - Fixed invalid legacy enum values in\n`settings.json`\n\ninvalidating the entire settings file - Fixed\n`/usage`\n\ndialog content being clipped when no-flicker mode is off - Fixed\n`/focus`\n\nshowing “Unknown command” when the fullscreen renderer is off — now explains how to enable it - Fixed embedded grep/find/rg shell wrappers failing when the running binary is deleted mid-session — now falls back to installed tools\n- Reduced peak file descriptor usage during\n`find`\n\nin the Bash tool on large directory trees\n\n- Windows: Git for Windows (Git Bash) is no longer required — when absent, Claude Code uses PowerShell as the shell tool\n- Added\n`claude ultrareview [target]`\n\nsubcommand to run`/ultrareview`\n\nnon-interactively from CI or scripts — prints findings to stdout (`--json`\n\nfor raw output) and exits 0 on completion or 1 on failure - Skills can now reference the current effort level with\n`${CLAUDE_EFFORT}`\n\nin their content - Set\n`AI_AGENT`\n\nenvironment variable for subprocesses so`gh`\n\ncan attribute traffic to Claude Code - Spinner tips that recommend installing the desktop app or creating skills/agents are now hidden when you already have them\n- Show a “use PgUp/PgDn to scroll” hint when the terminal sends arrow keys instead of scroll events\n- Faster session start when you have many claude.ai connectors configured but not authorized\n- The auto mode denial message now links to the configuration docs\n`claude plugin validate`\n\nnow accepts`$schema`\n\n,`version`\n\n, and`description`\n\nat the top level of`marketplace.json`\n\nand`$schema`\n\nin`plugin.json`\n\n- Auto-compact in auto mode now displays\n`auto`\n\n(lowercase, no token count) instead of a misleading token value - Fixed pressing Esc during a stdio MCP tool call closing the entire server connection (regression in 2.1.105)\n- Fixed\n`/rewind`\n\nand other interactive overlays not responding to keyboard input after launching with`claude --resume`\n\n- Fixed terminal scrollback duplication in non-fullscreen mode (resize, dialog dismiss, long sessions)\n- Fixed\n`DISABLE_TELEMETRY`\n\n/`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`\n\nnot suppressing usage metrics telemetry for API and enterprise users - Fixed false-positive “Dangerous rm operation” permission prompts in auto mode for multi-line bash commands containing both a pipe and a redirect\n- Fixed long selection menus clipping below the terminal in fullscreen mode — the focused option now stays on screen as you scroll\n- Fixed Write tool output collapsing instead of expanding when clicking “+N lines” in fullscreen\n- Fixed slash command picker jumping while typing, and improved highlight to only match contiguous substrings in blue\n- Fixed\n`/plugin`\n\nmarketplace failing to load when one entry uses an unrecognized source format — that entry is shown but installing it prompts you to update - [VSCode]\n`/usage`\n\nnow opens the native Account & Usage dialog instead of returning plain-text session cost - [VSCode] Voice dictation now respects the\n`language`\n\nsetting in`~/.claude/settings.json`\n\n- Fixed\n`find`\n\nin the Bash tool exhausting open file descriptors on large directory trees, causing host-wide crashes (macOS/Linux native builds)\n\n`/config`\n\nsettings (theme, editor mode, verbose, etc.) now persist to`~/.claude/settings.json`\n\nand participate in project/local/policy override precedence- Added\n`prUrlTemplate`\n\nsetting to point the footer PR badge at a custom code-review URL instead of github.com - Added\n`CLAUDE_CODE_HIDE_CWD`\n\nenvironment variable to hide the working directory in the startup logo `--from-pr`\n\nnow accepts GitLab merge-request, Bitbucket pull-request, and GitHub Enterprise PR URLs`--print`\n\nmode now honors the agent’s`tools:`\n\nand`disallowedTools:`\n\nfrontmatter, matching interactive-mode behavior`--agent <name>`\n\nnow honors the agent definition’s`permissionMode`\n\nfor built-in agents- PowerShell tool commands can now be auto-approved in permission mode, matching Bash behavior\n- Hooks:\n`PostToolUse`\n\nand`PostToolUseFailure`\n\nhook inputs now include`duration_ms`\n\n(tool execution time, excluding permission prompts and PreToolUse hooks) - Subagent and SDK MCP server reconfiguration now connects servers in parallel instead of serially\n- Plugins pinned by another plugin’s version constraint now auto-update to the highest satisfying git tag\n- Vim mode: Esc in INSERT no longer pulls a queued message back into the input; press Esc again to interrupt\n- Slash command suggestions now highlight the characters that matched your query\n- Slash command picker now wraps long descriptions onto a second line instead of truncating\n`owner/repo#N`\n\nshorthand links in output now use your git remote’s host instead of always pointing at github.com- Security:\n`blockedMarketplaces`\n\nnow correctly enforces`hostPattern`\n\nand`pathPattern`\n\nentries - OpenTelemetry:\n`tool_result`\n\nand`tool_decision`\n\nevents now include`tool_use_id`\n\n;`tool_result`\n\nalso includes`tool_input_size_bytes`\n\n- Status line: stdin JSON now includes\n`effort.level`\n\nand`thinking.enabled`\n\n- Fixed pasting CRLF content (Windows clipboards, Xcode console) inserting an extra blank line between every line\n- Fixed multi-line paste losing newlines in terminals using kitty keyboard protocol sequences inside bracketed paste\n- Fixed Glob and Grep tools disappearing on native macOS/Linux builds when the Bash tool is denied via permissions\n- Fixed scrolling up in fullscreen mode snapping back to the bottom every time a tool finishes\n- Fixed MCP HTTP connections failing with “Invalid OAuth error response” when servers returned non-JSON bodies for OAuth discovery requests\n- Fixed Rewind overlay showing “(no prompt)” for messages with image attachments\n- Fixed auto mode overriding plan mode with conflicting “Execute immediately” instructions\n- Fixed async\n`PostToolUse`\n\nhooks that emit no response payload writing empty entries to the session transcript - Fixed spinner staying on when a subagent task notification is orphaned in the queue\n- Tool search is now disabled by default on Vertex AI to avoid an unsupported beta header error (opt in with\n`ENABLE_TOOL_SEARCH`\n\n) - Fixed\n`@`\n\n-file Tab completion replacing the entire prompt when used inside a slash command with an absolute path - Fixed a stray\n`p`\n\ncharacter appearing at the prompt on startup in macOS Terminal.app via Docker or SSH - Fixed\n`${ENV_VAR}`\n\nplaceholders in`headers`\n\nfor HTTP/SSE/WebSocket MCP servers not being substituted before requests - Fixed MCP OAuth client secret stored via\n`--client-secret`\n\nnot being sent during token exchange for servers requiring`client_secret_post`\n\n- Fixed\n`/skills`\n\nEnter key closing the dialog instead of pre-filling`/<skill-name>`\n\nin the prompt - Fixed\n`/agents`\n\ndetail view mislabeling built-in tools unavailable to subagents as “Unrecognized” - Fixed MCP servers from plugins not spawning on Windows when the plugin cache was incomplete\n- Fixed\n`/export`\n\nshowing the current default model instead of the model the conversation actually used - Fixed verbose output setting not persisting after restart\n- Fixed\n`/usage`\n\nprogress bars overlapping with their “Resets …” labels - Fixed plugin MCP servers failing when\n`${user_config.*}`\n\nreferences an optional field left blank - Fixed list items containing a sentence-final number wrapping the number onto its own line\n- Fixed\n`/plan`\n\nand`/plan open`\n\nnot acting on the existing plan when entering plan mode - Fixed skills invoked before auto-compaction being re-executed against the next user message\n- Fixed\n`/reload-plugins`\n\nand`/doctor`\n\nreporting load errors for disabled plugins - Fixed Agent tool with\n`isolation: \"worktree\"`\n\nreusing stale worktrees from prior sessions - Fixed disabled MCP servers appearing as “failed” in\n`/status`\n\n- Fixed\n`TaskList`\n\nreturning tasks in arbitrary filesystem order instead of sorted by ID - Fixed spurious “GitHub API rate limit exceeded” hints when\n`gh`\n\noutput contained PR titles mentioning “rate limit” - Fixed SDK/bridge\n`read_file`\n\nnot correctly enforcing size cap on growing files - Fixed PR not linked to session when working in a git worktree\n- Fixed\n`/doctor`\n\nwarning about MCP server entries overridden by a higher-precedence scope - Windows: removed false-positive “Windows requires ‘cmd /c’ wrapper” MCP config warning\n- [VSCode] Fixed voice dictation’s first recording producing nothing on macOS while the microphone permission prompt is showing\n\n- Added vim visual mode (\n`v`\n\n) and visual-line mode (`V`\n\n) with selection, operators, and visual feedback - Merged\n`/cost`\n\nand`/stats`\n\ninto`/usage`\n\n— both remain as typing shortcuts that open the relevant tab - Create and switch between named custom themes from\n`/theme`\n\n, or hand-edit JSON files in`~/.claude/themes/`\n\n; plugins can also ship themes via a`themes/`\n\ndirectory - Hooks can now invoke MCP tools directly via\n`type: \"mcp_tool\"`\n\n- Added\n`DISABLE_UPDATES`\n\nenv var to completely block all update paths including manual`claude update`\n\n— stricter than`DISABLE_AUTOUPDATER`\n\n- WSL on Windows can now inherit Windows-side managed settings via the\n`wslInheritsWindowsSettings`\n\npolicy key - Auto mode: include\n`\"$defaults\"`\n\nin`autoMode.allow`\n\n,`autoMode.soft_deny`\n\n, or`autoMode.environment`\n\nto add custom rules alongside the built-in list instead of replacing it - Added a “Don’t ask again” option to the auto mode opt-in prompt\n- Added\n`claude plugin tag`\n\nto create release git tags for plugins with version validation `--continue`\n\n/`--resume`\n\nnow find sessions that added the current directory via`/add-dir`\n\n`/color`\n\nnow syncs the session accent color to claude.ai/code when Remote Control is connected- The\n`/model`\n\npicker now honors`ANTHROPIC_DEFAULT_*_MODEL_NAME`\n\n/`_DESCRIPTION`\n\noverrides when using a custom`ANTHROPIC_BASE_URL`\n\ngateway - When auto-update skips a plugin due to another plugin’s version constraint, the skip now appears in\n`/doctor`\n\nand the`/plugin`\n\nErrors tab - Fixed\n`/mcp`\n\nmenu hiding OAuth Authenticate/Re-authenticate actions for servers configured with`headersHelper`\n\n, and HTTP/SSE MCP servers with custom headers being stuck in “needs authentication” after a transient 401 - Fixed MCP servers whose OAuth token response omits\n`expires_in`\n\nrequiring re-authentication every hour - Fixed MCP step-up authorization silently refreshing instead of prompting for re-consent when the server’s\n`insufficient_scope`\n\n403 names a scope the current token already has - Fixed an unhandled promise rejection when an MCP server’s OAuth flow times out or is cancelled\n- Fixed MCP OAuth refresh proceeding without its cross-process lock under contention\n- Fixed macOS keychain race where a concurrent MCP token refresh could overwrite a freshly-refreshed OAuth token, causing unexpected “Please run /login” prompts\n- Fixed OAuth token refresh failing when the server revokes a token before its local expiry time\n- Fixed credential save crash on Linux/Windows corrupting\n`~/.claude/.credentials.json`\n\n- Fixed\n`/login`\n\nhaving no effect in a session launched with`CLAUDE_CODE_OAUTH_TOKEN`\n\n— the env token is now cleared so disk credentials take effect - Fixed unreadable text in the “new messages” scroll pill and\n`/plugin`\n\nbadges - Fixed plan acceptance dialog offering “auto mode” instead of “bypass permissions” when running with\n`--dangerously-skip-permissions`\n\n- Fixed agent-type hooks failing with “Messages are required for agent hooks” when configured for events other than\n`Stop`\n\nor`SubagentStop`\n\n- Fixed\n`prompt`\n\nhooks re-firing on tool calls made by an agent-hook verifier subagent - Fixed\n`/fork`\n\nwriting the full parent conversation to disk per fork — now writes a pointer and hydrates on read - Fixed Alt+K / Alt+X / Alt+^ / Alt+_ freezing keyboard input\n- Fixed connecting to a remote session overwriting your local\n`model`\n\nsetting in`~/.claude/settings.json`\n\n- Fixed typeahead showing “No commands match” error when pasting file paths that start with\n`/`\n\n- Fixed\n`plugin install`\n\non an already-installed plugin not re-resolving a dependency installed at the wrong version - Fixed unhandled errors from file watcher on invalid paths or fd exhaustion\n- Fixed Remote Control sessions getting archived on transient CCR initialization blips during JWT refresh\n- Fixed subagents resumed via\n`SendMessage`\n\nnot restoring the explicit`cwd`\n\nthey were spawned with\n\n- Forked subagents can now be enabled on external builds by setting\n`CLAUDE_CODE_FORK_SUBAGENT=1`\n\n- Agent frontmatter\n`mcpServers`\n\nare now loaded for main-thread agent sessions via`--agent`\n\n- Improved\n`/model`\n\n: selections now persist across restarts even when the project pins a different model, and the startup header shows when the active model comes from a project or managed-settings pin - The\n`/resume`\n\ncommand now offers to summarize stale, large sessions before re-reading them, matching the existing`--resume`\n\nbehavior - Faster startup when both local and claude.ai MCP servers are configured (concurrent connect now default)\n`plugin install`\n\non an already-installed plugin now installs any missing dependencies instead of stopping at “already installed”- Plugin dependency errors now say “not installed” with an install hint, and\n`claude plugin marketplace add`\n\nnow auto-resolves missing dependencies from configured marketplaces - Managed-settings\n`blockedMarketplaces`\n\nand`strictKnownMarketplaces`\n\nare now enforced on plugin install, update, refresh, and autoupdate - Advisor Tool (experimental): dialog now carries an “experimental” label, learn-more link, and startup notification when enabled; sessions no longer get stuck with “Advisor tool result content could not be processed” errors on every prompt and\n`/compact`\n\n- The\n`cleanupPeriodDays`\n\nretention sweep now also covers`~/.claude/tasks/`\n\n,`~/.claude/shell-snapshots/`\n\n, and`~/.claude/backups/`\n\n- OpenTelemetry:\n`user_prompt`\n\nevents now include`command_name`\n\nand`command_source`\n\nfor slash commands;`cost.usage`\n\n,`token.usage`\n\n,`api_request`\n\n, and`api_error`\n\nnow include an`effort`\n\nattribute when the model supports effort levels. Custom/MCP command names are redacted unless`OTEL_LOG_TOOL_DETAILS=1`\n\nis set - Native builds on macOS and Linux: the\n`Glob`\n\nand`Grep`\n\ntools are replaced by embedded`bfs`\n\nand`ugrep`\n\navailable through the Bash tool — faster searches without a separate tool round-trip (Windows and npm-installed builds unchanged) - Windows: cached\n`where.exe`\n\nexecutable lookups per process for faster subprocess launches - Default effort for Pro/Max subscribers on Opus 4.6 and Sonnet 4.6 is now\n`high`\n\n(was`medium`\n\n) - Fixed Plain-CLI OAuth sessions dying with “Please run /login” when the access token expires mid-session — the token is now refreshed reactively on 401\n- Fixed\n`WebFetch`\n\nhanging on very large HTML pages by truncating input before HTML-to-markdown conversion - Fixed a crash when a proxy returns HTTP 204 No Content — now surfaces a clear error instead of a\n`TypeError`\n\n- Fixed\n`/login`\n\nhaving no effect when launched with`CLAUDE_CODE_OAUTH_TOKEN`\n\nenv var and that token expires - Fixed prompt-input undo (\n`Ctrl+_`\n\n) doing nothing immediately after typing, and skipping a state on each undo step - Fixed\n`NO_PROXY`\n\nnot being respected for remote API requests when running under Bun - Fixed rare spurious escape/return triggers when key names arrive as coalesced text over slow connections\n- Fixed SDK\n`reload_plugins`\n\nreconnecting all user MCP servers serially - Fixed Bedrock application-inference-profile requests failing with 400 when backed by Opus 4.7 with thinking disabled\n- Fixed MCP\n`elicitation/create`\n\nrequests auto-cancelling in print/SDK mode when the server finishes connecting mid-turn - Fixed subagents running a different model than the main agent incorrectly flagging file reads with a malware warning\n- Fixed idle re-render loop when background tasks are present, reducing memory growth on Linux\n- [VSCode] Fixed “Manage Plugins” panel breaking when multiple large marketplaces are configured\n- Fixed Opus 4.7 sessions showing inflated\n`/context`\n\npercentages and autocompacting too early — Claude Code was computing against a 200K context window instead of Opus 4.7’s native 1M\n\n`/resume`\n\non large sessions is significantly faster (up to 67% on 40MB+ sessions) and handles sessions with many dead-fork entries more efficiently- Faster MCP startup when multiple stdio servers are configured;\n`resources/templates/list`\n\nis now deferred to first`@`\n\n-mention - Smoother fullscreen scrolling in VS Code, Cursor, and Windsurf terminals —\n`/terminal-setup`\n\nnow configures the editor’s scroll sensitivity - Thinking spinner now shows progress inline (“still thinking”, “thinking more”, “almost done thinking”), replacing the separate hint row\n`/config`\n\nsearch now matches option values (e.g. searching “vim” finds the Editor mode setting)`/doctor`\n\ncan now be opened while Claude is responding, without waiting for the current turn to finish`/reload-plugins`\n\nand background plugin auto-update now auto-install missing plugin dependencies from marketplaces you’ve already added- Bash tool now surfaces a hint when\n`gh`\n\ncommands hit GitHub’s API rate limit, so agents can back off instead of retrying - The Usage tab in Settings now shows your 5-hour and weekly usage immediately and no longer fails when the usage endpoint is rate-limited\n- Agent frontmatter\n`hooks:`\n\nnow fire when running as a main-thread agent via`--agent`\n\n- Slash command menu now shows “No commands match” when your filter has zero results, instead of disappearing\n- Security: sandbox auto-allow no longer bypasses the dangerous-path safety check for\n`rm`\n\n/`rmdir`\n\ntargeting`/`\n\n,`$HOME`\n\n, or other critical system directories - Claude Code and installer now use\n`https://downloads.claude.ai/claude-code-releases`\n\ninstead of`https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases`\n\n- Fixed Devanagari and other Indic scripts rendering with broken column alignment in the terminal UI\n- Fixed Ctrl+- not triggering undo in terminals using the Kitty keyboard protocol (iTerm2, Ghostty, kitty, WezTerm, Windows Terminal)\n- Fixed Cmd+Left/Right not jumping to line start/end in terminals that use the Kitty keyboard protocol (Warp fullscreen, kitty, Ghostty, WezTerm)\n- Fixed Ctrl+Z hanging the terminal when Claude Code is launched via a wrapper process (e.g.\n`npx`\n\n,`bun run`\n\n) - Fixed scrollback duplication in inline mode where resizing the terminal or large output bursts would repeat earlier conversation history\n- Fixed modal search dialogs overflowing the screen at short terminal heights, hiding the search box and keyboard hints\n- Fixed scattered blank cells and disappearing composer chrome in the VS Code integrated terminal during scrolling\n- Fixed an intermittent API 400 error related to cache control TTL ordering that could occur when a parallel request completed during request setup\n- Fixed\n`/branch`\n\nrejecting conversations with transcripts larger than 50MB - Fixed\n`/resume`\n\nsilently showing an empty conversation on large session files instead of reporting the load error - Fixed\n`/plugin`\n\nInstalled tab showing the same item twice when it appears under Needs attention or Favorites - Fixed\n`/update`\n\nand`/tui`\n\nnot working after entering a worktree mid-session\n\n- Fixed a crash in the permission dialog when an agent teams teammate requested tool permission\n\n- Changed the CLI to spawn a native Claude Code binary (via a per-platform optional dependency) instead of bundled JavaScript\n- Added\n`sandbox.network.deniedDomains`\n\nsetting to block specific domains even when a broader`allowedDomains`\n\nwildcard would otherwise permit them - Fullscreen mode: Shift+↑/↓ now scrolls the viewport when extending a selection past the visible edge\n`Ctrl+A`\n\nand`Ctrl+E`\n\nnow move to the start/end of the current logical line in multiline input, matching readline behavior- Windows:\n`Ctrl+Backspace`\n\nnow deletes the previous word - Long URLs in responses and bash output stay clickable when they wrap across lines (in terminals with OSC 8 hyperlinks)\n- Improved\n`/loop`\n\n: pressing Esc now cancels pending wakeups, and wakeups display as “Claude resuming /loop wakeup” for clarity `/extra-usage`\n\nnow works from Remote Control (mobile/web) clients- Remote Control clients can now query\n`@`\n\n-file autocomplete suggestions - Improved\n`/ultrareview`\n\n: faster launch with parallelized checks, diffstat in the launch dialog, and animated launching state - Subagents that stall mid-stream now fail with a clear error after 10 minutes instead of hanging silently\n- Bash tool: multi-line commands whose first line is a comment now show the full command in the transcript, closing a UI-spoofing vector\n- Running\n`cd <current-directory> && git …`\n\nno longer triggers a permission prompt when the`cd`\n\nis a no-op - Security: on macOS,\n`/private/{etc,var,tmp,home}`\n\npaths are now treated as dangerous removal targets under`Bash(rm:*)`\n\nallow rules - Security: Bash deny rules now match commands wrapped in\n`env`\n\n/`sudo`\n\n/`watch`\n\n/`ionice`\n\n/`setsid`\n\nand similar exec wrappers - Security:\n`Bash(find:*)`\n\nallow rules no longer auto-approve`find -exec`\n\n/`-delete`\n\n- Fixed MCP concurrent-call timeout handling where a message for one tool call could silently disarm another call’s watchdog\n- Fixed Cmd-backspace /\n`Ctrl+U`\n\nto once again delete from the cursor to the start of the line - Fixed markdown tables breaking when a cell contains an inline code span with a pipe character\n- Fixed session recap auto-firing while composing unsent text in the prompt\n- Fixed\n`/copy`\n\n“Full response” not aligning markdown table columns for pasting into GitHub, Notion, or Slack - Fixed messages typed while viewing a running subagent being hidden from its transcript and misattributed to the parent AI\n- Fixed Bash\n`dangerouslyDisableSandbox`\n\nrunning commands outside the sandbox without a permission prompt - Fixed\n`/effort auto`\n\nconfirmation — now says “Effort level set to max” to match the status bar label - Fixed the “copied N chars” toast overcounting emoji and other multi-code-unit characters\n- Fixed\n`/insights`\n\ncrashing with`EBUSY`\n\non Windows - Fixed exit confirmation dialog mislabeling one-shot scheduled tasks as recurring — now shows a countdown\n- Fixed slash/@ completion menu not sitting flush against the prompt border in fullscreen mode\n- Fixed\n`CLAUDE_CODE_EXTRA_BODY`\n\n`output_config.effort`\n\ncausing 400 errors on subagent calls to models that don’t support effort and on Vertex AI - Fixed prompt cursor disappearing when\n`NO_COLOR`\n\nis set - Fixed\n`ToolSearch`\n\nranking so pasted MCP tool names surface the actual tool instead of description-matching siblings - Fixed compacting a resumed long-context session failing with “Extra usage is required for long context requests”\n- Fixed\n`plugin install`\n\nsucceeding when a dependency version conflicts with an already-installed plugin — now reports`range-conflict`\n\n- Fixed “Refine with Ultraplan” not showing the remote session URL in the transcript\n- Fixed SDK image content blocks that fail to process crashing the session — now degrade to a text placeholder\n- Fixed Remote Control sessions not streaming subagent transcripts\n- Fixed Remote Control sessions not being archived when Claude Code exits\n- Fixed\n`thinking.type.enabled is not supported`\n\n400 error when using Opus 4.7 via a Bedrock Application Inference Profile ARN\n\n- Fixed “claude-opus-4-7 is temporarily unavailable” for auto mode\n\n- Claude Opus 4.7 xhigh is now available! Use /effort to tune speed vs. intelligence\n- Auto mode is now available for Max subscribers when using Opus 4.7\n- Added\n`xhigh`\n\neffort level for Opus 4.7, sitting between`high`\n\nand`max`\n\n. Available via`/effort`\n\n,`--effort`\n\n, and the model picker; other models fall back to`high`\n\n`/effort`\n\nnow opens an interactive slider when called without arguments, with arrow-key navigation between levels and Enter to confirm- Added “Auto (match terminal)” theme option that matches your terminal’s dark/light mode — select it from\n`/theme`\n\n- Added\n`/less-permission-prompts`\n\nskill — scans transcripts for common read-only Bash and MCP tool calls and proposes a prioritized allowlist for`.claude/settings.json`\n\n- Added\n`/ultrareview`\n\nfor running comprehensive code review in the cloud using parallel multi-agent analysis and critique — invoke with no arguments to review your current branch, or`/ultrareview <PR#>`\n\nto fetch and review a specific GitHub PR - Auto mode no longer requires\n`--enable-auto-mode`\n\n- Windows: PowerShell tool is progressively rolling out. Opt in or out with\n`CLAUDE_CODE_USE_POWERSHELL_TOOL`\n\n. On Linux and macOS, enable with`CLAUDE_CODE_USE_POWERSHELL_TOOL=1`\n\n(requires`pwsh`\n\non PATH) - Read-only bash commands with glob patterns (e.g.\n`ls *.ts`\n\n) and commands starting with`cd <project-dir> &&`\n\nno longer trigger a permission prompt - Suggest the closest matching subcommand when\n`claude <word>`\n\nis invoked with a near-miss typo (e.g.`claude udpate`\n\n→ “Did you mean`claude update`\n\n?”) - Plan files are now named after your prompt (e.g.\n`fix-auth-race-snug-otter.md`\n\n) instead of purely random words - Improved\n`/setup-vertex`\n\nand`/setup-bedrock`\n\nto show the actual`settings.json`\n\npath when`CLAUDE_CONFIG_DIR`\n\nis set, seed model candidates from existing pins on re-run, and offer a “with 1M context” option for supported models `/skills`\n\nmenu now supports sorting by estimated token count — press`t`\n\nto toggle`Ctrl+U`\n\nnow clears the entire input buffer (previously: delete to start of line); press`Ctrl+Y`\n\nto restore`Ctrl+L`\n\nnow forces a full screen redraw in addition to clearing the prompt input- Transcript view footer now shows\n`[`\n\n(dump to scrollback) and`v`\n\n(open in editor) shortcuts - The “+N lines” marker for truncated long pastes is now a full-width rule for easier scanning\n- Headless\n`--output-format stream-json`\n\nnow includes`plugin_errors`\n\non the init event when plugins are demoted for unsatisfied dependencies - Added\n`OTEL_LOG_RAW_API_BODIES`\n\nenvironment variable to emit full API request and response bodies as OpenTelemetry log events for debugging - Suppressed spurious decompression, network, and transient error messages that could appear in the TUI during normal operation\n- Reverted the v2.1.110 cap on non-streaming fallback retries — it traded long waits for more outright failures during API overload\n- Fixed terminal display tearing (random characters, drifting input) in iTerm2 + tmux setups when terminal notifications are sent\n- Fixed\n`@`\n\nfile suggestions re-scanning the entire project on every turn in non-git working directories, and showing only config files in freshly-initialized git repos with no tracked files - Fixed LSP diagnostics from before an edit appearing after it, causing the model to re-read files it just edited\n- Fixed tab-completing\n`/resume`\n\nimmediately resuming an arbitrary titled session instead of showing the session picker - Fixed\n`/context`\n\ngrid rendering with extra blank lines between rows - Fixed\n`/clear`\n\ndropping the session name set by`/rename`\n\n, causing statusline output to lose`session_name`\n\n- Improved plugin error handling: dependency errors now distinguish conflicting, invalid, and overly complex version requirements; fixed stale resolved versions after\n`plugin update`\n\n;`plugin install`\n\nnow recovers from interrupted prior installs - Fixed Claude calling a non-existent\n`commit`\n\nskill and showing “Unknown skill: commit” for users without a custom`/commit`\n\ncommand - Fixed 429 rate-limit errors on Bedrock/Vertex/Foundry referencing status.claude.com (it only covers Anthropic-operated providers)\n- Fixed feedback surveys appearing back-to-back after dismissing one\n- Fixed bare URLs in bash/PowerShell/MCP tool output being unclickable when the terminal wraps them across lines\n- Windows:\n`CLAUDE_ENV_FILE`\n\nand SessionStart hook environment files now apply (previously a no-op) - Windows: permission rules with drive-letter paths are now correctly root-anchored, and paths differing only by drive-letter case are recognized as the same path\n\n- Added\n`/tui`\n\ncommand and`tui`\n\nsetting — run`/tui fullscreen`\n\nto switch to flicker-free rendering in the same conversation - Added push notification tool — Claude can send mobile push notifications when Remote Control and “Push when Claude decides” config are enabled\n- Changed\n`Ctrl+O`\n\nto toggle between normal and verbose transcript only; focus view is now toggled separately with the new`/focus`\n\ncommand - Added\n`autoScrollEnabled`\n\nconfig to disable conversation auto-scroll in fullscreen mode - Added option to show Claude’s last response as commented context in the\n`Ctrl+G`\n\nexternal editor (enable via`/config`\n\n) - Improved\n`/plugin`\n\nInstalled tab — items needing attention and favorites appear at the top, disabled items are hidden behind a fold, and`f`\n\nfavorites the selected item - Improved\n`/doctor`\n\nto warn when an MCP server is defined in multiple config scopes with different endpoints `--resume`\n\n/`--continue`\n\nnow resurrects unexpired scheduled tasks`/context`\n\n,`/exit`\n\n, and`/reload-plugins`\n\nnow work from Remote Control (mobile/web) clients- Write tool now informs the model when you edit the proposed content in the IDE diff before accepting\n- Bash tool now enforces the documented maximum timeout instead of accepting arbitrarily large values\n- SDK/headless sessions now read\n`TRACEPARENT`\n\n/`TRACESTATE`\n\nfrom the environment for distributed trace linking - Session recap is now enabled for users with telemetry disabled (Bedrock, Vertex, Foundry,\n`DISABLE_TELEMETRY`\n\n). Opt out via`/config`\n\nor`CLAUDE_CODE_ENABLE_AWAY_SUMMARY=0`\n\n. - Fixed MCP tool calls hanging indefinitely when the server connection drops mid-response on SSE/HTTP transports\n- Fixed non-streaming fallback retries causing multi-minute hangs when the API is unreachable\n- Fixed session recap, local slash-command output, and other system status lines not appearing in focus mode\n- Fixed high CPU usage in fullscreen when text is selected while a tool is running\n- Fixed plugin install not honoring dependencies declared in\n`plugin.json`\n\nwhen the marketplace entry omits them;`/plugin`\n\ninstall now lists auto-installed dependencies - Fixed skills with\n`disable-model-invocation: true`\n\nfailing when invoked via`/<skill>`\n\nmid-message - Fixed\n`--resume`\n\nsometimes showing the first prompt instead of the`/rename`\n\nname for sessions still running or exited uncleanly - Fixed queued messages briefly appearing twice during multi-tool-call turns\n- Fixed session cleanup not removing the full session directory including subagent transcripts\n- Fixed dropped keystrokes after the CLI relaunches (e.g.\n`/tui`\n\n, provider setup wizards) - Fixed garbled startup rendering in macOS Terminal.app and other terminals that don’t support synchronized output\n- Hardened “Open in editor” actions against command injection from untrusted filenames\n- Fixed\n`PermissionRequest`\n\nhooks returning`updatedInput`\n\nnot being re-checked against`permissions.deny`\n\nrules;`setMode:'bypassPermissions'`\n\nupdates now respect`disableBypassPermissionsMode`\n\n- Fixed\n`PreToolUse`\n\nhook`additionalContext`\n\nbeing dropped when the tool call fails - Fixed stdio MCP servers that print stray non-JSON lines to stdout being disconnected on the first stray line (regression in 2.1.105)\n- Fixed headless/SDK session auto-title firing an extra Haiku request when\n`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`\n\nor`CLAUDE_CODE_DISABLE_TERMINAL_TITLE`\n\nis set - Fixed potential excessive memory allocation when piped (non-TTY) Ink output contains a single very wide line\n- Fixed\n`/skills`\n\nmenu not scrolling when the list overflows the modal in fullscreen mode - Fixed Remote Control sessions showing a generic error instead of prompting for re-login when the session is too old\n- Fixed Remote Control session renames from claude.ai not persisting the title to the local CLI session\n\n- Improved the extended-thinking indicator with a rotating progress hint\n\n- Added\n`ENABLE_PROMPT_CACHING_1H`\n\nenv var to opt into 1-hour prompt cache TTL on API key, Bedrock, Vertex, and Foundry (`ENABLE_PROMPT_CACHING_1H_BEDROCK`\n\nis deprecated but still honored), and`FORCE_PROMPT_CACHING_5M`\n\nto force 5-minute TTL - Added recap feature to provide context when returning to a session, configurable in\n`/config`\n\nand manually invocable with`/recap`\n\n; force with`CLAUDE_CODE_ENABLE_AWAY_SUMMARY`\n\nif telemetry disabled. - The model can now discover and invoke built-in slash commands like\n`/init`\n\n,`/review`\n\n, and`/security-review`\n\nvia the Skill tool `/undo`\n\nis now an alias for`/rewind`\n\n- Improved\n`/model`\n\nto warn before switching models mid-conversation, since the next response re-reads the full history uncached - Improved\n`/resume`\n\npicker to default to sessions from the current directory; press`Ctrl+A`\n\nto show all projects - Improved error messages: server rate limits are now distinguished from plan usage limits; 5xx/529 errors show a link to status.claude.com; unknown slash commands suggest the closest match\n- Reduced memory footprint for file reads, edits, and syntax highlighting by loading language grammars on demand\n- Added “verbose” indicator when viewing the detailed transcript (\n`Ctrl+O`\n\n) - Added a warning at startup when prompt caching is disabled via\n`DISABLE_PROMPT_CACHING*`\n\nenvironment variables - Fixed paste not working in the\n`/login`\n\ncode prompt (regression in 2.1.105) - Fixed subscribers who set\n`DISABLE_TELEMETRY`\n\nfalling back to 5-minute prompt cache TTL instead of 1 hour - Fixed Agent tool prompting for permission in auto mode when the safety classifier’s transcript exceeded its context window\n- Fixed Bash tool producing no output when\n`CLAUDE_ENV_FILE`\n\n(e.g.`~/.zprofile`\n\n) ends with a`#`\n\ncomment line - Fixed\n`claude --resume <session-id>`\n\nlosing the session’s custom name and color set via`/rename`\n\n- Fixed session titles showing placeholder example text when the first message is a short greeting\n- Fixed terminal escape codes appearing as garbage text in the prompt input after\n`--teleport`\n\n- Fixed\n`/feedback`\n\nretry: pressing Enter to resubmit after a failure now works without first editing the description - Fixed\n`--teleport`\n\nand`--resume <id>`\n\nprecondition errors (e.g. dirty git tree, session not found) exiting silently instead of showing the error message - Fixed Remote Control session titles set in the web UI being overwritten by auto-generated titles after the third message\n- Fixed\n`--resume`\n\ntruncating sessions when the transcript contained a self-referencing message - Fixed transcript write failures (e.g., disk full) being silently dropped instead of being logged\n- Fixed diacritical marks (accents, umlauts, cedillas) being dropped from responses when the\n`language`\n\nsetting is configured - Fixed policy-managed plugins never auto-updating when running from a different project than where they were first installed\n\n- Show thinking hints sooner during long operations\n\n- Added\n`path`\n\nparameter to the`EnterWorktree`\n\ntool to switch into an existing worktree of the current repository - Added PreCompact hook support: hooks can now block compaction by exiting with code 2 or returning\n`{\"decision\":\"block\"}`\n\n- Added background monitor support for plugins via a top-level\n`monitors`\n\nmanifest key that auto-arms at session start or on skill invoke `/proactive`\n\nis now an alias for`/loop`\n\n- Improved stalled API stream handling: streams now abort after 5 minutes of no data and retry non-streaming instead of hanging indefinitely\n- Improved network error messages: connection errors now show a retry message immediately instead of a silent spinner\n- Improved file write display: long single-line writes (e.g. minified JSON) are now truncated in the UI instead of paginating across many screens\n- Improved\n`/doctor`\n\nlayout with status icons; press`f`\n\nto have Claude fix reported issues - Improved\n`/config`\n\nlabels and descriptions for clarity - Improved skill description handling: raised the listing cap from 250 to 1,536 characters and added a startup warning when descriptions are truncated\n- Improved\n`WebFetch`\n\nto strip`<style>`\n\nand`<script>`\n\ncontents from fetched pages so CSS-heavy pages no longer exhaust the content budget before reaching actual text - Improved stale agent worktree cleanup to remove worktrees whose PR was squash-merged instead of keeping them indefinitely\n- Improved MCP large-output truncation prompt to give format-specific recipes (e.g.\n`jq`\n\nfor JSON, computed Read chunk sizes for text) - Fixed images attached to queued messages (sent while Claude is working) being dropped\n- Fixed screen going blank when the prompt input wraps to a second line in long conversations\n- Fixed leading whitespace getting copied when selecting multi-line assistant responses in fullscreen mode\n- Fixed leading whitespace being trimmed from assistant messages, breaking ASCII art and indented diagrams\n- Fixed garbled bash output when commands print clickable file links (e.g. Python\n`rich`\n\n/`loguru`\n\nlogging) - Fixed alt+enter not inserting a newline in terminals using ESC-prefix alt encoding, and Ctrl+J not inserting a newline (regression in 2.1.100)\n- Fixed duplicate “Creating worktree” text in EnterWorktree/ExitWorktree tool display\n- Fixed queued user prompts disappearing from focus mode\n- Fixed one-shot scheduled tasks re-firing repeatedly when the file watcher missed the post-fire cleanup\n- Fixed inbound channel notifications being silently dropped after the first message for Team/Enterprise users\n- Fixed marketplace plugins with\n`package.json`\n\nand lockfile not having dependencies installed automatically after install/update - Fixed marketplace auto-update leaving the official marketplace in a broken state when a plugin process holds files open during the update\n- Fixed “Resume this session with…” hint not printing on exit after\n`/resume`\n\n,`--worktree`\n\n, or`/branch`\n\n- Fixed feedback survey shortcut keys firing when typed at the end of a longer prompt\n- Fixed stdio MCP server emitting malformed (non-JSON) output hanging the session instead of failing fast with “Connection closed”\n- Fixed MCP tools missing on the first turn of headless/remote-trigger sessions when MCP servers connect asynchronously\n- Fixed\n`/model`\n\npicker on AWS Bedroc\n\n---\n\n*[Changelog truncated to first 60K chars - most recent ~3-4 months. Full changelog at https://code.claude.com/docs/en/changelog]*", "content_chars": 60136, "fetch_status": "ok", "truncated": true, "original_chars": 278861}, {"id": 6, "title": "The Complete Claude Code Guide (2026): Planning, Context Engineering, and High-Leverage Development", "url": "https://www.generative.inc/the-complete-claude-code-guide-2026-planning-context-engineering-and-high-leverage-development", "author": "Stan Sedberry", "publisher": "Generative.inc", "date": "2026-03-19", "official": false, "topics": ["planning", "context_engineering", "prompting", "scaling"], "summary": "Guia comunitaria solida que sintetiza: setup, context structuring, plan mode workflows, cost optimization, scaling.", "content_markdown": "Most people approach AI coding tools like better autocomplete.\n\nThat's a mistake.\n\nClaude Code is not a faster editor. It's a system for orchestrating work through context, plans, and execution loops. If you use it like a chat box, you'll get mediocre results. If you treat it like an environment you actively shape, you get leverage that looks closer to managing a team of engineers than writing code yourself.\n\nThe numbers back this up. Anthropic's internal study of 132 engineers, 200,000+ session transcripts found that developers using Claude Code saw merged PRs per day increase 67%, and 27% of Claude-assisted work involved tasks that wouldn't have been attempted otherwise. Engineers weren't just coding faster. They were expanding what they were willing to take on.\n\nThis guide distills what actually matters when using Claude Code at a high level: how to set up your environment, structure context, plan work, execute reliably, manage costs, and scale beyond a single session.\n\nPart I: Foundations\n\n## What Claude Code Actually Is\n\nClaude Code is not \"AI that writes code.\"\n\nIt's a **context engine + execution agent**.\n\nIt builds a working understanding of your codebase. It operates inside a constrained context window. It executes tasks based on that context. And it improves through feedback loops of validation, rules, iteration.\n\nEverything that follows comes back to one principle:\n\n**The quality of output is a direct function of the quality of context.**\n\nIf you internalize nothing else from this guide, internalize that. Every technique here — CLAUDE.md files, plan mode, context management, subagents — exists to serve that single principle.\n\n## Getting Started the Right Way\n\n### System Requirements\n\nClaude Code runs on macOS 10.15+, Ubuntu 20.04+ / Debian 10+, or Windows 10+ (with WSL or Git for Windows). You need Node.js 18+, at least 4GB RAM, and an internet connection. Bash, Zsh, PowerShell, and CMD are all supported.\n\n### Installation\n\nFive ways to install, depending on your environment:\n\n**npm (standard — recommended for most users):**\n\n`npm install -g @anthropic-ai/claude-code`\n\n\nDo NOT use `sudo`\n\n. It causes permission and security issues.\n\n**Homebrew (macOS/Linux):**\n\n`brew install claude-code`\n\n\n**Native binary (macOS/Linux/WSL):**\n\n`curl -fsSL https:
|
|
|
|
|
|
|
|
|
| const TOPIC_CARDS = [
|
| { label: 'CLAUDE.md', title: '¿Cómo escribir un CLAUDE.md efectivo?', q: 'Cómo escribir un CLAUDE.md efectivo? Mostrame las reglas más importantes y un ejemplo concreto.', hint: 'Reglas + ejemplo concreto' },
|
| { label: 'Skills vs MCP', title: '¿Cuándo usar Skills y cuándo MCP?', q: 'Cuál es la diferencia entre Skills y MCP servers? Cuándo uso cada uno?', hint: 'Diferencias y casos de uso' },
|
| { label: 'Plan Mode', title: 'El patrón explore → plan → code', q: 'Cuál es el patrón recomendado para usar plan mode en tareas grandes?', hint: 'Workflow para tareas grandes' },
|
| { label: 'Auto Memory', title: '¿Cómo funciona la auto memory?', q: 'Cómo funciona el sistema de auto memory y cómo lo configuro bien?', hint: '4 capas de memoria' },
|
| { label: 'Hooks', title: 'Hooks vs CLAUDE.md vs Rules', q: 'Qué son los hooks en Claude Code y cuándo me convienen sobre rules en CLAUDE.md?', hint: 'Cuándo determinístico vs heurístico' },
|
| { label: 'Novedades 2026', title: '¿Qué cambió en abril/mayo?', q: 'Qué cambió en Claude Code en abril/mayo 2026? Resumen de las novedades clave del changelog.', hint: 'Sub-agents, hooks, plugins' },
|
| ];
|
|
|
|
|
|
|
|
|
| const state = {
|
| apiKey: '',
|
| model: 'gemini-2.5-flash',
|
| messages: [],
|
| topicFilter: null,
|
| streaming: false,
|
| };
|
|
|
|
|
|
|
|
|
| document.addEventListener('DOMContentLoaded', () => {
|
| state.apiKey = sessionStorage.getItem('gemini_api_key') || '';
|
| state.model = localStorage.getItem('chatbot_model_gemini') || 'gemini-2.5-flash';
|
| document.getElementById('modelSelect').value = state.model;
|
|
|
| renderTopicCards();
|
| renderTopics();
|
| renderArticles();
|
| updateKeyStatus();
|
|
|
| document.getElementById('modelSelect').addEventListener('change', (e) => {
|
| state.model = e.target.value;
|
| localStorage.setItem('chatbot_model_gemini', state.model);
|
| });
|
|
|
| document.getElementById('changeKeyBtn').addEventListener('click', showApiKeyModal);
|
| document.getElementById('keyStatus').addEventListener('click', showApiKeyModal);
|
| document.getElementById('saveKeyBtn').addEventListener('click', saveApiKey);
|
| document.getElementById('cancelKeyBtn').addEventListener('click', hideApiKeyModal);
|
| document.getElementById('apiKeyInput').addEventListener('keydown', (e) => {
|
| if (e.key === 'Enter') saveApiKey();
|
| });
|
|
|
| document.getElementById('goToChatBtn').addEventListener('click', () => {
|
| document.getElementById('chat-section').scrollIntoView({ behavior: 'smooth', block: 'start' });
|
| setTimeout(() => document.getElementById('composer').focus(), 700);
|
| });
|
|
|
| const composer = document.getElementById('composer');
|
| composer.addEventListener('keydown', (e) => {
|
| if (e.key === 'Enter' && !e.shiftKey) {
|
| e.preventDefault();
|
| sendMessage();
|
| }
|
| });
|
| composer.addEventListener('input', () => {
|
| composer.style.height = 'auto';
|
| composer.style.height = Math.min(composer.scrollHeight, 180) + 'px';
|
| });
|
| document.getElementById('sendBtn').addEventListener('click', sendMessage);
|
|
|
|
|
| const audio = document.getElementById('audio');
|
| document.querySelectorAll('.speed-buttons button').forEach(btn => {
|
| btn.addEventListener('click', () => {
|
| audio.playbackRate = parseFloat(btn.dataset.speed);
|
| document.querySelectorAll('.speed-buttons button').forEach(b => b.classList.remove('active'));
|
| btn.classList.add('active');
|
| });
|
| });
|
|
|
| marked.setOptions({
|
| highlight: function(code, lang) {
|
| if (lang && hljs.getLanguage(lang)) {
|
| try { return hljs.highlight(code, { language: lang }).value; } catch (e) {}
|
| }
|
| return hljs.highlightAuto(code).value;
|
| },
|
| breaks: true,
|
| gfm: true,
|
| });
|
| });
|
|
|
|
|
|
|
|
|
| function renderTopicCards() {
|
| const grid = document.getElementById('topicGrid');
|
| grid.innerHTML = '';
|
| for (const t of TOPIC_CARDS) {
|
| const el = document.createElement('button');
|
| el.className = 'topic-card';
|
| el.innerHTML = `
|
| <div class="card-label">${escapeHtml(t.label)}</div>
|
| <div class="card-title">${escapeHtml(t.title)}</div>
|
| <div class="card-hint">${escapeHtml(t.hint)}</div>`;
|
| el.addEventListener('click', () => {
|
| document.getElementById('composer').value = t.q;
|
| document.getElementById('chat-section').scrollIntoView({ behavior: 'smooth', block: 'start' });
|
| setTimeout(() => sendMessage(), 600);
|
| });
|
| grid.appendChild(el);
|
| }
|
| }
|
|
|
| function renderTopics() {
|
| const allTopics = [...new Set(ARTICLES_DATA.articles.flatMap(a => a.topics || []))].sort();
|
| const container = document.getElementById('topicFilter');
|
| container.innerHTML = '';
|
| const allBtn = document.createElement('div');
|
| allBtn.className = 'topic-pill active';
|
| allBtn.textContent = 'todos';
|
| allBtn.dataset.topic = '';
|
| allBtn.addEventListener('click', () => setTopicFilter(null));
|
| container.appendChild(allBtn);
|
| for (const t of allTopics) {
|
| const el = document.createElement('div');
|
| el.className = 'topic-pill';
|
| el.textContent = t.replace(/_/g, ' ');
|
| el.dataset.topic = t;
|
| el.addEventListener('click', () => setTopicFilter(t));
|
| container.appendChild(el);
|
| }
|
| }
|
|
|
| function setTopicFilter(topic) {
|
| state.topicFilter = topic;
|
| document.querySelectorAll('#topicFilter .topic-pill').forEach(el => {
|
| el.classList.toggle('active', (el.dataset.topic || '') === (topic || ''));
|
| });
|
| renderArticles();
|
| }
|
|
|
| function renderArticles() {
|
| const container = document.getElementById('articleList');
|
| container.innerHTML = '';
|
| for (const a of ARTICLES_DATA.articles) {
|
| const dimmed = state.topicFilter && !(a.topics || []).includes(state.topicFilter);
|
| const el = document.createElement('a');
|
| el.className = 'article' + (dimmed ? ' dimmed' : '');
|
| el.href = a.url;
|
| el.target = '_blank';
|
| el.rel = 'noopener';
|
| el.title = a.summary || '';
|
| const badgeClass = a.official ? '' : 'community';
|
| const badgeLabel = a.official ? 'oficial' : 'comunidad';
|
| el.innerHTML = `
|
| <div class="article-title">${escapeHtml(a.title)}</div>
|
| <div class="article-meta">
|
| <span class="badge ${badgeClass}">${badgeLabel}</span>
|
| <span>${escapeHtml(a.author || a.publisher || '')}</span>
|
| </div>`;
|
| container.appendChild(el);
|
| }
|
| }
|
|
|
|
|
|
|
|
|
| function showApiKeyModal() {
|
| document.getElementById('apiKeyModal').classList.add('show');
|
| document.getElementById('apiKeyInput').value = state.apiKey;
|
| setTimeout(() => document.getElementById('apiKeyInput').focus(), 50);
|
| }
|
| function hideApiKeyModal() {
|
| document.getElementById('apiKeyModal').classList.remove('show');
|
| }
|
| function saveApiKey() {
|
| const v = document.getElementById('apiKeyInput').value.trim();
|
| if (!v.startsWith('AIza')) {
|
| alert('La key de Google AI Studio tiene que empezar con AIza');
|
| return;
|
| }
|
| state.apiKey = v;
|
| sessionStorage.setItem('gemini_api_key', v);
|
| updateKeyStatus();
|
| hideApiKeyModal();
|
| }
|
| function updateKeyStatus() {
|
| const st = document.getElementById('keyStatus');
|
| const lbl = document.getElementById('keyStatusLabel');
|
| if (state.apiKey) {
|
| st.classList.add('ok');
|
| lbl.textContent = 'API key activa';
|
| } else {
|
| st.classList.remove('ok');
|
| lbl.textContent = 'Sin API key';
|
| }
|
| }
|
|
|
|
|
|
|
|
|
| function buildSystemInstruction() {
|
| const role = `Eres "Claude Code Master", un experto que responde preguntas sobre Claude Code (la CLI agentica de Anthropic) basandote estrictamente en los 10 articulos curados de mayo 2026 que vienen abajo en la seccion <articles>.
|
|
|
| REGLAS:
|
| 1. Responde SIEMPRE en espanol, claro y directo.
|
| 2. Cuando uses informacion de un articulo, citalo asi al final del parrafo o seccion: [#N: titulo corto](URL). Multiples citas separadas con espacio.
|
| 3. Si la pregunta no esta cubierta por los articulos, decilo explicitamente y ofrece la mejor inferencia, marcandola como "(inferencia, no esta en los articulos)".
|
| 4. Para codigo, usa fences \`\`\`con el lenguaje. Para listas largas usa tablas markdown cuando ayuden.
|
| 5. Si el usuario pregunta sobre novedades o changelog, prioriza las citas con id 3, 5 y 9.
|
| 6. Si pregunta sobre prompting o tactica diaria, prioriza 1, 6, 7, 8.
|
| 7. Si pregunta sobre skills, prioriza 1, 2, 3, 10.
|
| 8. Cierra cada respuesta con una lista "**Fuentes:**" con los articulos efectivamente citados.
|
| 9. No inventes funcionalidades que no esten en los articulos. Si una feature suena familiar pero no la encontras, decilo.`;
|
|
|
| let articlesBlock = '<articles>\n';
|
| for (const a of ARTICLES_DATA.articles) {
|
| articlesBlock += `\n<article id="${a.id}" title=${JSON.stringify(a.title)} url="${a.url}" author=${JSON.stringify(a.author || '')} date="${a.date || ''}" official="${a.official ? 'true' : 'false'}" topics=${JSON.stringify((a.topics || []).join(','))}>\n`;
|
| articlesBlock += a.content_markdown || '';
|
| articlesBlock += '\n</article>\n';
|
| }
|
| articlesBlock += '\n</articles>';
|
|
|
| return {
|
| parts: [
|
| { text: role + '\n\n' + articlesBlock },
|
| ],
|
| };
|
| }
|
|
|
|
|
|
|
|
|
| async function sendMessage() {
|
| if (state.streaming) return;
|
| const composer = document.getElementById('composer');
|
| const text = composer.value.trim();
|
| if (!text) return;
|
| if (!state.apiKey) { showApiKeyModal(); return; }
|
|
|
| const empty = document.getElementById('emptyChat');
|
| if (empty) empty.remove();
|
|
|
| state.messages.push({ role: 'user', content: text });
|
| appendMessage('user', text);
|
| composer.value = '';
|
| composer.style.height = 'auto';
|
|
|
| const asstEl = appendMessage('assistant', '');
|
| state.streaming = true;
|
| document.getElementById('sendBtn').disabled = true;
|
| document.getElementById('streamStatus').textContent = 'Pensando...';
|
|
|
| try {
|
| await streamCompletion(asstEl);
|
| } catch (err) {
|
| asstEl.querySelector('.bubble-content').innerHTML = `<p style="color: var(--danger);">Error: ${escapeHtml(err.message || String(err))}</p>`;
|
| } finally {
|
| state.streaming = false;
|
| document.getElementById('sendBtn').disabled = false;
|
| document.getElementById('streamStatus').textContent = '';
|
| }
|
| }
|
|
|
| async function streamCompletion(asstEl) {
|
| const contents = state.messages.map(m => ({
|
| role: m.role === 'assistant' ? 'model' : 'user',
|
| parts: [{ text: m.content }],
|
| }));
|
|
|
| const body = {
|
| systemInstruction: buildSystemInstruction(),
|
| contents,
|
| generationConfig: {
|
| maxOutputTokens: 4096,
|
| temperature: 0.7,
|
| },
|
| };
|
|
|
| const url = `https://generativelanguage.googleapis.com/v1beta/models/${encodeURIComponent(state.model)}:streamGenerateContent?alt=sse`;
|
|
|
| const resp = await fetch(url, {
|
| method: 'POST',
|
| headers: {
|
| 'content-type': 'application/json',
|
| 'x-goog-api-key': state.apiKey,
|
| },
|
| body: JSON.stringify(body),
|
| });
|
|
|
| if (!resp.ok) {
|
| let msg = `HTTP ${resp.status}`;
|
| try {
|
| const j = await resp.json();
|
| msg = j.error?.message || j.message || msg;
|
| } catch {}
|
| throw new Error(msg);
|
| }
|
|
|
| const reader = resp.body.getReader();
|
| const decoder = new TextDecoder();
|
| let buffer = '';
|
| let assistantText = '';
|
| const bubble = asstEl.querySelector('.bubble-content');
|
| let cursor = document.createElement('span');
|
| cursor.className = 'cursor';
|
| bubble.appendChild(cursor);
|
|
|
| let usage = { prompt: 0, output: 0, total: 0, cached: 0 };
|
|
|
| while (true) {
|
| const { done, value } = await reader.read();
|
| if (done) break;
|
| buffer += decoder.decode(value, { stream: true });
|
| const lines = buffer.split('\n');
|
| buffer = lines.pop() || '';
|
| for (const line of lines) {
|
| if (!line.startsWith('data: ')) continue;
|
| const data = line.slice(6).trim();
|
| if (!data || data === '[DONE]') continue;
|
| try {
|
| const evt = JSON.parse(data);
|
| const parts = evt.candidates?.[0]?.content?.parts || [];
|
| for (const p of parts) {
|
| if (typeof p.text === 'string') assistantText += p.text;
|
| }
|
| if (parts.length) {
|
| renderAssistantStream(bubble, assistantText, cursor);
|
| autoScroll();
|
| }
|
| if (evt.usageMetadata) {
|
| usage.prompt = evt.usageMetadata.promptTokenCount || usage.prompt;
|
| usage.output = evt.usageMetadata.candidatesTokenCount || usage.output;
|
| usage.total = evt.usageMetadata.totalTokenCount || usage.total;
|
| usage.cached = evt.usageMetadata.cachedContentTokenCount || usage.cached;
|
| }
|
| } catch (e) { }
|
| }
|
| }
|
|
|
| cursor.remove();
|
| bubble.innerHTML = marked.parse(assistantText);
|
| bubble.querySelectorAll('pre code').forEach(b => hljs.highlightElement(b));
|
|
|
| const info = document.createElement('div');
|
| info.className = 'tokens-info';
|
| const cachedNote = usage.cached > 0
|
| ? `<span class="hit">cached: ${usage.cached.toLocaleString()} tokens</span> · `
|
| : '';
|
| info.innerHTML = `${cachedNote}prompt: ${usage.prompt.toLocaleString()} · output: ${usage.output.toLocaleString()} · ${state.model}`;
|
| asstEl.querySelector('.bubble').appendChild(info);
|
|
|
| state.messages.push({ role: 'assistant', content: assistantText });
|
| }
|
|
|
| function renderAssistantStream(bubble, text, cursor) {
|
| bubble.innerHTML = marked.parse(text);
|
| bubble.appendChild(cursor);
|
| }
|
|
|
| function appendMessage(role, text) {
|
| const wrap = document.createElement('div');
|
| wrap.className = 'message ' + role;
|
| const avatar = role === 'user' ? 'T' : 'C';
|
| wrap.innerHTML = `
|
| <div class="avatar">${avatar}</div>
|
| <div class="bubble"><div class="bubble-content">${role === 'user' ? escapeHtml(text).replace(/\n/g, '<br>') : ''}</div></div>`;
|
| document.getElementById('messages').appendChild(wrap);
|
| autoScroll();
|
| return wrap;
|
| }
|
|
|
| function autoScroll() {
|
| const m = document.getElementById('messages');
|
| m.scrollTop = m.scrollHeight;
|
| }
|
|
|
| function escapeHtml(s) {
|
| return String(s).replace(/[&<>"']/g, c => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
| }
|
| </script>
|
| </body>
|
| </html>
|
|
|