Sponsor Suno AI Music arrow_forward
Subagent

Write Intent Principle

Announce intent before writing files — one sentence stating what, where, and why, with an idempotence check that skips the Write entirely when state is already correct.

Type
Subagent
GitHub stars
4.1k
License
MIT
Repo last updated
Sep 26, 2026

What Write Intent Principle is

Write Intent Principle is a subagent published in the nyldn/claude-octopus repository on GitHub, which has about 4.1k stars. The repository describes itself as: “Run multiple AI models against the same research, design, or coding task. Surface disagreements before you ship.”

A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.

Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Write Intent Principle and get back a compact result.

How to install Write Intent Principle

Claude Code

  1. Download write-intent.md from the repository.
  2. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
  3. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Claude Cowork

  1. Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
  2. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.

Inside the source file

An excerpt from agents/principles/write-intent.md, shared under the repository's MIT license. Read the full file on GitHub.

Before creating, overwriting, or rewriting any file as part of a command, skill, or agent workflow, you MUST:

1. Check for idempotence first

If the desired state already matches the current state, do not call Write at all. Confirm the state to the user and exit. The most common bug this prevents is writing config for a mode / setting / flag the user is already in — that's noise, not value.

Examples of state to check before writing:

  • Target mode matches current mode → skip
  • Target frontmatter field matches current field → skip
  • Generated file is byte-identical to what you'd write → skip

2. Announce intent in one sentence

When a Write is needed, say what you're about to do before calling the tool. Format:

> Writing (create | update | overwrite) — <field/change> — because .

Example:

> Updating .claude/claude-octopus.local.md — setting knowledge_mode: false (was true) — because the user requested /octo:dev.

3. Never write "empty" config

Do not create a config file populated with defaults just to "mark" a state. Absent config is a legitimate state — it means "use defaults". Creating a file to restate defaults adds noise, makes diffs confusing, and implies the user opted into something they didn't.

4. Respect scope

Before writing to .claude/, ~/.claude-octopus/, ~/.claude/, or any user-owned directory from a command/skill, consider whether the file should live in:

  • The plugin (committed, shipped to all users)
  • The user's home (~/.claude/) — persists across projects
  • The project workspace (.claude/) — per-project
  • ~/.claude/scratchpad/ / — ephemeral working files

A user-facing command that writes to an unexpected scope (e.g. a "mode switch" that writes to project .claude/) needs to say which scope in its intent sentence.

Anti-Patterns (reject in review)

  • ❌ /octo:dev writes .claude/claude-octopus.local.md when the file didn't exist and the user was already in default Dev Work Mode.
  • ❌ A "setup" wizard silently creates configuration for every possible option even when not selected.
  • ❌ An idempotent-looking operation overwrites a file with identical content, bumping its mtime and confusing build systems.
  • ❌ A skill announces "I'll update your config" and then writes without showing the diff or field being changed.

Correct Patterns

  • ✅ Check current state → already matches target → confirm to user → exit without Write.
  • ✅ "Switching Knowledge Work → Dev Work — updating .claude/claude-octopus.local.md (knowledge_mode: true → false)." followed by the Write.
  • ✅ "No .claude/claude-octopus.local.md exists — you're in default Dev Work Mode. Nothing to change." followed by no Write.

Scope

This principle applies to all Write operations initiated by skills, commands, and agents in this plugin. Tests in tests/unit/test-write-intent.sh enforce that user-facing mode-switch commands carry the idempotence check in their implementation instructions.

Before you install

  • Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
  • Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
  • Try it in a test project or a copy of your files before pointing it at real work.
  • Pin the version you tested, and review changes before updating.
  • Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.

FAQ

What is Write Intent Principle?

Write Intent Principle is a subagent for Claude Code and Claude Cowork from the nyldn/claude-octopus repository on GitHub. Announce intent before writing files — one sentence stating what, where, and why, with an idempotence check that skips the Write entirely when state is already correct.

How do I install Write Intent Principle in Claude Code?

Download write-intent.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Can I use Write Intent Principle in Claude Cowork?

Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

Is Write Intent Principle safe to install?

It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.

Similar resources

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.