agterm: Instructions file for Claude Code

CLAUDE.md

agterm CLAUDE.md is an instructions file for Claude Code from umputun/agterm. It costs 7,360 tokens per session, scanned B, original, MIT.

Project notes for agterm, a native macOS SwiftUI terminal built on libghostty with a sidebar that connects workspaces to terminal sessions.

In plain words
What is it for?
Changing terminal UI, workspace sessions, AppKit or SwiftUI behavior, control commands, settings, or Swift and C integration.
Why use it?
They identify the project's reference documents and set review expectations for UI, command-line control, preferences, and concurrency-sensitive bridge code.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions Claude Code; reads ~/.codex paths.

This is umputun/agterm's own configuration. It tells Claude Code how to work on agterm itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything agterm configures →

Reuse

Borrowing it

Nothing to install: this file belongs to umputun/agterm. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/umputun/agterm/master/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/umputun/agterm

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agterm CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/umputun/agterm/claude-md/github.svg)](https://agentmods.dev/instructions/umputun/agterm/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/umputun/agterm/claude-md"><img src="https://agentmods.dev/badge/instructions/umputun/agterm/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agterm CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/umputun/agterm/claude-md"><img src="https://agentmods.dev/badge/instructions/umputun/agterm/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 7,360 This file is loaded in full into every session.
When invoked 7,360 The same file — it is already loaded in full.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.07360 $0.07360
Opus 5.5 $0.02944 $0.02944
Sonnet 5.5 $0.01472 $0.01472
Haiku 4.5 $0.00736 $0.00736

Measured yesterday against content hash d7d75dec98da, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

agterm CLAUDE.md scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

`~/.claude/settings.json`, and `~/.codex/`, which `AGTERM_STATE_DIR` does not isolate, and bake
CLAUDE.md · 379 lines

How it starts

The opening of the file, as written. The whole thing — 379 lines — stays where its author put it; the contents beside it link to each section on GitHub.

agterm project notes

agterm is a native macOS SwiftUI terminal on libghostty with a workspace-to-session sidebar. Read site/docs.html for product behavior and ARCHITECTURE.md for modules, surface ownership, and C-boundary concurrency before changing the bridge. README.md is the product synopsis, not the reference.

Working norms

  • For nonstandard or risky UI requests, first explain the AppKit/SwiftUI cost and offer the standard alternative. Proceed if the user still prefers the custom behavior.
  • Design every UI behavior to be consistent and unsurprising: a key or gesture does one thing for what the user is looking at and never reaches a layer hidden behind the visible one. A rule whose exceptions depend on state the user cannot see on screen is a defect: propose the single rule, and ask before adding a case. Existing behavior next to the change that breaks this rule is a defect to fix with it, not a pre-existing one: name it with its fix as a question, never as out of scope. A control that already exists elsewhere in the app (a search bar, a button, a picker) looks and behaves the same in the new place: reuse its component, and show the user the rendered result before writing tests.
  • Judge any change that can leave a long-standing visual artifact by what the user is left looking at, never by whether the mechanism is sound. A panel, badge, marker or overlay that outlives the thing it describes is a defect however correct the code that posted it. Give it a way to clear itself, and put that in the control API rather than in a private timer inside one caller, or every other caller ships the same artifact.
  • For every new capability, propose useful control API/CLI coverage: protocol command and arguments, dispatch, agtermctl, read-back, and tests. Control-native features count; skip only chrome with nothing meaningful to drive.
  • For each hideable titlebar/sidebar element, ask whether it should join host-free InterfaceElement and Settings > Interface. Never add that preference without approval. A control enabled there stays visible and is disabled when it cannot act; never show or hide it by state.
  • The HTML overlay displays HTML over a session; it is not a browser. Following links, history and back are the browser's job, so link features that turn the overlay into one are declined. What a mouse-capturing program does with a click is that program's, not agterm's.
  • A decline of a feature request that a custom command covers explains the extension model with the request as the worked example: README's "bind X yourself", site/docs.html#extend, the agent skill, the cookbook. It also points "can you add X" requests to Discussions ▸ Ideas instead of issues.
  • When adding a process that runs user commands or reparents a session, weigh its effect on macOS TCC attribution per service, up front. The responsible process is not always TCC's authorization subject: the #574 microphone test recorded agterm-session-host as responsible, com.umputun.agterm as the subject, and access allowed. Check each service rather than assuming one answer covers all of them. A passive AXIsProcessTrusted false can also be a stale grant, not a code bug: a stored grant may require a specific old cdhash (an ad-hoc build's requirement is a bare cdhash), so verify the row's full requirement against the running binary before suspecting attribution.
  • Start Swift work with the relevant skills: swiftui-expert for UI/AppKit/Observation/rendering, swift-testing-expert for tests, and swift-concurrency for actors, Sendable, async, and C callbacks.
  • “Show me” means build and launch a separate interactive Debug instance, not a screenshot. Use isolated state and socket paths, leave it running, and explain how to reach the feature.
  • An isolated state dir also redirects config to <stateDir>/config. Copy keymap.conf, ghostty.conf, and restore-denylist.conf when real custom behavior is required. Set only a short /tmp AGTERM_STATE_DIR so app and inherited CLI derive the same socket. Prepend the Debug app's Contents/MacOS to PATH for custom commands; login shells may restore the deployed CLI, so manual commands should use the Debug binary's full path.
  • open -n passes the caller's environment to the app, including inherited CLAUDE* markers and live-terminal AGTERM_*/GHOSTTY_* variables; a claude started in that instance warns that transcript saving is off. Launch through env -u NAME ... naming every such variable, which drops AGTERM_STATE_DIR too, so pass the isolated one back with open -n --env AGTERM_STATE_DIR=...; verify with ps eww -p <pid>.
  • A fresh isolated state dir reads as a first launch and opens the welcome alert. mkdir -p "$AGTERM_STATE_DIR/windows" before launching to skip it: FirstRunWelcome.hasPriorState looks for settings.json, workspaces.json, or windows before the app writes anything. Leave the marker out only when the welcome itself is under test.
  • The control socket binds from the window scene's task, so a backgrounded open -n -g can leave the app running with no socket until a window renders. If the socket is still absent 10 s after launch, activate the instance; never leave a socket wait unbounded.
  • agtermctl never reads AGTERM_SOCKET; it resolves --socket, then AGTERM_STATE_DIR, then ~/Library/Application Support/agterm. A shell inside the live terminal therefore defaults onto the live socket, and exporting a short AGTERM_STATE_DIR is what keeps inherited commands off it.
  • After launching an instance for manual testing, do not touch it. For an assisted experiment, announce every action. Ask before acting when unclear.
  • Put nontrivial work in an isolated worktree and remove it after merge. See the build section for artifact links and cleanup.
  • Comments and docs are liabilities kept short. Keep only non-obvious constraints, rejected alternatives, or reasons the obvious implementation fails. Never narrate code, repeat a fact across surfaces, use a paragraph where a clause works, or preserve change history. Own each contract once and cross-reference it. If 25 lines of logic seem to need 100 lines of comment, fix the code.
  • A doc comment longer than the body it documents is wrong. The usual cause is writing it to justify a review fix rather than to document the code, which belongs in the commit message.
  • Test comments are rare and one line. Add one only when neither the test name nor setup reveals the goal. Never label arrange/act/assert, restate an assertion, or explain why a test exists.
  • Review severity follows user-visible consequences: critical for data loss or broken primary paths, major for wrong results or broken secondary paths, minor otherwise. Documentation inaccuracies are never critical or major. Documentation-heavy review findings usually call for less prose.

Read the full file on GitHub · 379 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · +8 lines · +159 tokens per session d7d75dec98da
  2. 2d ago Changed · +8 lines · +146 tokens per session 4a89f469a438
  3. 3d ago Changed · +5 lines · +105 tokens per session 9f9937301bbe
  4. 8d ago Changed · +5 lines · +120 tokens per session fbfbb3192d62
  5. 10d ago Changed · +3 lines · +41 tokens per session ab73d2316108
  6. 17d ago Changed · +1 lines · +35 tokens per session 85a6d83dfa5c
  7. 19d ago Changed · +1 lines · +16 tokens per session a9bb55d1c048
  8. 21d ago Changed · +3 lines · +67 tokens per session 6a49dad15b01
  9. 22d ago Changed · +6 lines · +121 tokens per session bca793071ece
  10. 24d ago First seen · 339 lines · 6,550 tokens per session scan B 209b3beed6f8

Subscribe to this mod's changes

agterm CLAUDE.md is an instructions file published in the GitHub repository umputun/agterm (727 stars, last pushed yesterday), licensed MIT. It adds 7,360 tokens to every session, about $0.0294 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

agterm CLAUDE.md compared with instructions from other repositories

agterm CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
agterm CLAUDE.mdumputun/agtermInstructions file727yesterdayMITB7,360Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode