# Code Window: AI & chat element for AI agents

> Show code being written in a dark editor window, line by line with syntax colour

Canonical page: https://agentframes.ai/elements/clay-ink/code-window/
Markdown: https://agentframes.ai/elements/clay-ink/code-window.md

## Overview

- Name: Code Window (`codeWindow`), an element: one HyperFrames block per size
- Part of: the [Clay & Ink](https://agentframes.ai/packs/clay-ink.md) pack (14 of 48). Available only through the All-access subscription.
- Category: AI & chat
- Purpose: Show code being written in a dark editor window, line by line with syntax colour
- Pack: [Clay & Ink](https://agentframes.ai/packs/clay-ink.md), included in All-access (from $14/month billed annually ($168/year), or $19 monthly)
- Subscribe: POST https://agentframes.ai/api/checkout/subscribe with interval=month or interval=year (optional currency=USD|GBP|EUR|AUD|CAD; 303 redirect to Stripe checkout; a human pays there). Then download any pack with the subscriber key: https://agentframes.ai/account.md
- Aspects: 16:9 (native), 9:16 (stage-fit), 4:5 (stage-fit), 1:1 (stage-fit)
- Canvases: works on ivory paper (`w`), warm ink (`k`), clay (`o`); avoid none
- Typical duration: 5.5s
- Speaker-safe: no
- Preview video (watermarked): https://agentframes.ai/media/clay-ink/code-window.mp4
- Poster: https://agentframes.ai/media/clay-ink/code-window.jpg
- Licence: [AgentFrames Licence](https://agentframes.ai/licence.md)

## Paste this into Claude Code

```text
Use the AgentFrames Clay & Ink pack. Add a `codeWindow` beat to plan.json on a `w` canvas with slots `filename`, `language`, `code` and `fontSize` from my script. Then run validate → build → qa and show me qa/contact.jpg.
```

## Variables

| Variable | Type | Label | Description | Default |
|---|---|---|---|---|
| `filename` | string | Filename | Plain text. | summarise.js |
| `language` | string | Language | Plain text. | JavaScript |
| `code` | string | Code | Plain text. Wrap the ONE accent word in *stars*. | // Summarise the call notes with Claude import Anthropic from "@anthropic-ai/sdk";  const client = new Anthropic(); const msg = await client.messages.create({   model: "claude-sonnet-4-5",   max_tokens: 1024,   messages: [{ role: "user", content: notes }], }); |
| `fontSize` | number | Font Size |  | 36 |

## What your agent can change

### Surface

Show code being written in a dark editor window, line by line with syntax colour. Set: `ai-at-work`. Category: `ai`. Canvases: ok `w, k, o`. Typical 5.5s; settles at 4.5s.

### Editable (fill through plan.json `slots`)

- `filename` (string) **EXAMPLE DATA: replace or get client sign-off**. Plain text.
- `language` (string). Plain text.
- `code` (string) **EXAMPLE DATA: replace or get client sign-off**. Plain text. Wrap the ONE accent word in *stars*.
- `fontSize` (number). 

Optional style/layout overrides: `cps`. Use them only to fix fit or pacing, never to change the brand.

### Protected

Do not change the motion, easing, timing, the palette roles (colours come from frame.md → tokens.css), fonts, or the element's internal layout. Keep copy close to the default length (±30%) so it fits.

### Safe editing

Set values in the beat's `slots` in plan.json, run `tools/validate.mjs`, rebuild, and check `qa/contact.jpg`. Never hand-edit the generated index.html or this element's code for a single video.

## FAQ

### What can my AI agent change in Code Window?

Your agent fills the `filename`, `language`, `code` and `fontSize` slots through plan.json. Motion, timing, palette, fonts and the internal layout are protected, so the result keeps the Clay & Ink look.

### Which aspect ratios does Code Window support?

Code Window is designed natively for 16:9 and stage-fits into 9:16, 4:5 and 1:1. A typical beat lasts 5.5s.

### How do I get Code Window?

Code Window is included in the Clay & Ink pack, which is part of the AgentFrames All-access subscription along with 47 other templates in this pack and every other pack on the store. You get the full source, the editing contracts and the agent instructions.

## More in Clay & Ink

- [Artifact Panel](https://agentframes.ai/elements/clay-ink/artifact-panel.md): Show the AI producing a document/artifact: chat on the left, the document panel slides in with a chart
- [Chat Exchange](https://agentframes.ai/elements/clay-ink/chat-exchange.md): Show a question to the AI and its answer streaming back, word by word
- [Chat Home](https://agentframes.ai/elements/clay-ink/chat-home.md): The Claude home screen: spark and greeting, the composer with Chat/Cowork and the model, and a prompt typing in
- [Chat Session](https://agentframes.ai/elements/clay-ink/chat-session.md): A whole Claude session in one beat: home screen, prompt typed and sent, then the answer streaming in

## Community

Coming soon.
