Field Notes

Workbench

What I’m exploring now.

A small public notebook of questions, experiments and things that clicked. Results to build on, and ideas to come back to.

Last updated

Exploring

3

Following a question.

Exploring

Test Claude Code's "code mode": batching tool calls as one JS script

The question
Try the Claude Code mode where the model writes one JS script that orchestrates several tool calls, instead of making them one by one. Check: does it cut round-trips and tokens on a multi-step task, e.g. a cvnext PR triage (list PRs → pull failed logs → grep failures)? How do errors, permissions and hooks behave inside the script? Does the output stay readable? Compare against the same task done with normal one-call-at-a-time tools. Possible blog angle.

Exploring

Build with the Claude Java SDK from Scala (converters), capped at $100 of credits

The question
Experiment with the Anthropic Java SDK (anthropic-java, now 3.x) from Scala, using scala.jdk converters (CollectionConverters, OptionConverters, FutureConverters) to bridge Java Optional/List/CompletableFuture to idiomatic Scala. Starting point: what BuildCV Assist already does in ClaudeAssistProvider. Budget guardrail: create a dedicated Anthropic Console workspace with a hard $100 monthly spend limit and a key scoped to it, so the experiment can never run past $100. Ideas to check: a thin Scala wrapper (Future/EitherT), streaming, structured output, prompt caching hits, and the 3.x Bearer-auth change. Possible blog angle: "Claude from Scala without a Scala SDK".

Exploring

Check the Hugging Face tutorial on open OCR models

The question
https://huggingface.co/blog/ocr-open-models Hugging Face blog post on doing OCR and document AI with open models. Worth checking which ones run locally on the Strix Halo (llama.cpp / GGUF).

Learned

5

A result to build on.

Learned

Scala 2.13.18 fundamentals

The question
How do I build up Scala from the Java and Spring concepts I already know?
Result so far
The fundamentals build-up is done: values, case classes, collections, traits, implicits and typed error handling, explored through runnable examples.
Next to understand
Put that foundation to work in Cats Core, starting with combining values and validation results.

Learned

ASD-STE100

The idea
Simplified Technical English is a controlled language developed for aircraft maintenance documentation. Its writing rules and limited vocabulary could help make LLM explanations easier to read.
To try
Ask an LLM to explain something in ASD-STE100, then compare it with a softer version: "80% of the way to ASD-STE100".

Learned

Learning CC's Monitor tool: turn long-running jobs into event streams instead of blocking waits.

Result so far
Learn the Monitor tool in Claude Code - ✅ Watched a 36 GB download (blog post) - ✅ /ship step 5.5: PR checks + review verdict through watch-pr.sh (PR #524, blog draft) - ⬜ Try the ws: WebSocket source instead of polling - ⬜ Decide whether the deploy watch in deploy.md should become a monitor too - ⬜ Write down the patterns: flush every pipe stage, merge stderr, print a line for every way the script can end, re-arm after the

Learned

Enumeratum

The question
How can I model a closed set of values in Scala 2.13 without loose strings, and still parse and serialize them safely?
To try
Replace a hand-written sealed trait and its lookup code with an Enumeratum enum. Then check safe lookup by name and the mapping to JSON and database columns.
Next to understand
Compare it with a plain sealed trait, to see what the library adds and what it costs. See how this relate to DB mapping.

Learned

Cats Core in Scala 2.13.18

The question
How can I combine independent inputs and keep useful validation errors?
Result so far
A policy form combines checks with mapN. A custom Semigroup now keeps field names and messages together in structured validation errors.
Invalid(ValidationErrors(List(
  FieldError("number", "is missing"),
  FieldError("annualPremium",
    "must be positive")
)))
Next to understand
Explore how these combination rules scale from two fields to a collection of inputs.

Parked

4

Set aside for later.

Parked

Add llms.txt to anthropic4s.zakaria.lu

The question
Serve https://anthropic4s.zakaria.lu/llms.txt (llmstxt.org format) so coding agents can find the docs: a one-paragraph summary of the library, then links to the Quick start and Learn chapters (/docs/), the Play guide (/play/), the 20 API reference pages (/reference/) and the javadoc.io Scaladoc of the seven 2.13 modules. Optionally add llms-full.txt with the page text inlined. Where: a static file under frontend/public/anthropic4s/ and HostRouting's anthropic4s robots/sitemap allowlist (Set("/robots.txt", "/sitemap.xml")), plus a HostRoutingSpec case. Generate the link list from docs-shell.ts PAGES so it can't drift from the sidebar, the way the routing spec already checks it.

Parked

Try Code Mode in Claude Code: Claude writes JS that batches tool calls

The question
Source: https://code.claude.com/docs/fr/code-mode (experimental, off by default) WHAT IT IS Without Code Mode, Claude calls Bash/Read/Edit one by one and reads every result before the next step. With Code Mode, Claude writes a JavaScript snippet that makes the tool calls, and Claude Code runs it in the session (the REPL tool). One snippet can run commands in parallel, feed one result into the next call, and return only the part of the output Claude needs to read. Example: const files = await $`rg -l "function retryPolicy" src`.text(); await edit(files.trim().split("\n")[0], "maxAttempts: 3", "maxAttempts: 5"); ({ tests: $`npm test -- retryPolicy`.nothrow() }); The conversation still shows the tool calls (diffs etc.). Ctrl+O opens the transcript, where each snippet is a collapsed "Code" row. GOOD FOR - The same edit across many files - Searches whose results should be filtered before Claude reads them - Independent commands that can run at the same time ENABLE - Claude Code v2.1.323+ (v2.1.327+ with mods, v2.1.329+ with OpenTelemetry events/metrics), native build, Git for Windows, interactive terminal only (no VS Code panel, Desktop or cloud sessions) - Models: Opus 5.5 / Sonnet 5.5 / Haiku 5.5 / Fable 5.2 (pass full ids, not aliases) - PowerShell: $env:CLAUDE_CODE_EXPERIMENTAL_CODE_MODE='1'; claude - Or set it in the env block of ~/.claude/settings.json. Project settings ignore it, so a cloned repo can't turn it on for you. - Confirm "Yes, turn on Code Mode". The banner reads: "Code Mode (experimental) is on · this session can be resumed only with Code Mode on" - Subagents that have a tools list: add REPL (tools: Read, Bash, REPL) - Turn off: remove the var or set it to 0 (a 0 anywhere wins). Orgs can block it with managed settings env = 0. PERMISSIONS / HOOKS (the interesting part) - deny/ask rules and PreToolUse hooks still match each inner call by its normal tool name (Bash, MCP names...) - Auto mode: the classifier reviews the snippet, not each call, and can't see values computed at runtime. Keep rules/hooks for anything that must be enforced. - Shell hooks must split compound commands: a git push can reach the hook as "cd 'app' && git push" - ask: ["REPL"] makes you approve every snippet first. A PreToolUse hook on REPL can read the JS from tool_input.code. - PostToolUse on REPL can redact output through updatedToolOutput (code/result/stdout/stderr). refusedCalls is NOT redacted. - Hooks: a PreToolUse timeout = call refused; other hook failures go on to normal checks unless "onFailure": "block" - Sandbox only covers shell commands. The JS itself and its file/web/MCP calls run outside it. - Long code: 10-min cap when Claude waits; up to 2h in the background (auto/bypassPermissions only). Stop it with Esc or /tasks -> x. - OTel: calls made from code have tool_use_id starting repl_ or toolu_cc_. Tracing (beta) must stay off. LIMITS Resume only with Code Mode on. No Remote Control, Claude in Chrome or computer use. Can't move the session to Desktop or the background. TO CHECK FOR MY SETUP - cvnext .claude/hooks guards (master commits/push, migrations, secrets): do they still catch calls made from code, and do they split "cd x && git push"? Run node --test .claude/hooks/guards.test.mjs with compound inputs. - My OTLP ingest to obs.zakaria.lu: is enhanced tracing on? That blocks Code Mode. - zakverse mod: needs v2.1.327+ - Blog angle (promote to Workbench): "Tool calls as a program". Before/after on a multi-file refactor, token and turn counts, what the classifier can't see.

Parked

Dig into "MCP 2.0" in Claude Code: v2 client runtime (TS SDK 2.0 + protocol 2026-07-28)

The question
Sources: https://code.claude.com/docs/en/mcp (section "MCP client runtimes", Tasks, Elicitation, Skills over MCP) + changelog 2.1.329-2.1.332 WHAT "MCP 2.0" IS IN CLAUDE CODE No "MCP 2.0" spec. It is the v2 client runtime: the same Claude Code MCP code rebuilt on MCP TypeScript SDK 2.0 (ts.sdk.modelcontextprotocol.io/v2), which adds MCP protocol revision 2026-07-28. v1 = TS SDK 1.x. The runtime is chosen at startup and kept until exit. - Default on v2.1.232+ when feature flags are fetched; on v2.1.274+ also on Bedrock/Vertex/Foundry, a Claude apps gateway, or with DISABLE_TELEMETRY - Force it: MCP_SDK_GENERATION=v1|v2 - Negotiation: MCP_PROTOCOL_NEGOTIATION=auto|legacy. Unset, a stdio server that exits during the check isn't asked again for 7 days; auto re-asks sooner. - On v2, HTTP, stdio and claude.ai connector servers get asked whether they speak 2026-07-28. Servers that don't (and sse/ws) connect as on v1. A connected server's /mcp page shows a "Protocol" row. WHAT CHANGES ON v2 - list_changed notifications come over a stream held open. It reopens 3x if it closes within 10s; after 5 reopens in an hour it waits about 6h. - Channels: a channel server that negotiates 2026-07-28 is NOT registered (the revision can't carry channel messages). Use MCP_PROTOCOL_NEGOTIATION=legacy for stdio channel servers. - OAuth hardening: sign-in fails if the issuer in the authorization response is unexpected; credentials go only to HTTPS token endpoints (or localhost/127.0.0.1/::1). - Elicitation: declares elicitation {form:{}, url:{}} on 2026-07-28 connections (also on older revisions for user-configured servers since v2.1.287). Java MCP SDK 0.17.0 or older may reject that declaration. NEW CAPABILITIES THAT RIDE ON IT 1) Tasks extension io.modelcontextprotocol/tasks (v2.1.304+): tools/call can return resultType "task" (taskId, status working|input_required|completed|failed|cancelled, pollIntervalMs). Claude Code polls with tasks/get (interval clamped to 250-30000ms, default 2000). input_required uses inputRequests -> tasks/update with inputResponses (max 16 keys). tasks/cancel is sent on stop. Calls move to the background after 2 min (CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS). Answer a pending elicitation later through Esc then /tasks (v2.1.324+). Subagents/VS Code/Desktop on v2.1.331. 2.1.332 fixed task IDs over 128 chars (now up to 1024). 2) Skills over MCP (public beta, v2.1.331+): servers serve skills through the Skills extension (modelcontextprotocol.io/extensions/skills). They show as /<server>:<skill> (connector: claude_ai_Docs:pdf). Max 100 per server. Rules: deny Skill(mcp__docs__*) / Skill(docs:pdf); ask/allow likewise. Auto mode loads them without a prompt (the classifier doesn't read the skill). Needs a direct Anthropic connection + feature flags; not in claude -p / the Agent SDK. Managed settings: disableDirectMcpSkills. No Protocol row = the server isn't on 2026-07-28. 3) Transports: http (alias streamable-http) recommended; SSE deprecated with auto fallback (v2.1.265); ws in JSON only (no OAuth). Discovery cache: MCP_DISCOVERY_CACHE=1. TO CHECK FOR MY STUFF - cvnext mcp/ (Spring Boot, FOCUS capture, bearer token): which Java MCP SDK version? Does it negotiate 2026-07-28 or fall back? Check the Protocol row in /mcp for zakaria-focus. If it's 0.17.0 or older, the elicitation form+url declaration could break the connection. - Upgrading mcp/ to 2026-07-28 would allow skills served next to create_focus_todo (e.g. a "triage my week" skill). This keeps the two-tool rule because skills aren't tools, but it needs an ADR. - anthropic4s: a Scala MCP client/tasks angle? Blog/tutorial episode idea: "MCP's new revision from the client side". - Run claude --debug=mcp once to see the negotiation in practice.