canvas-layout

canvas-layout is an agent for Claude Code from AgriciDaniel/claude-canvas. It costs 132 tokens per session (592 once invoked), scanned A, original, MIT.

A layout tool for Obsidian Canvas, a visual workspace where notes, images, and other items are arranged on a board.

In plain words
What is it for?
Use it to arrange 30 or more nodes with grid, flowchart, radial, force-directed, or linear layouts, then validate and refine the result.
Why use it?
It helps organize large or complex canvases so nodes are positioned clearly, without overlaps or broken group layouts.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Not installable on its own: it runs a file from its repository that does not travel with it. Clone the repository, or install whatever ships that file. The line is python3 scripts/canvas_layout.py [canvas] [algorithm] [options].

Part of the claude-canvas plugin — 8 skills, 1 command, 3 agents shipped together

Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add AgriciDaniel/claude-canvas
Claude Code
/plugin install claude-canvas

Made for: Claude Code.

Or install claude-canvas, the plugin that ships this one along with the rest of its 8 skills, 1 command, 3 agents.

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 canvas-layout

README.md
[![agentmods](https://agentmods.dev/badge/agents/agricidaniel/claude-canvas/canvas-layout.svg)](https://agentmods.dev/agents/agricidaniel/claude-canvas/canvas-layout)
Your own site
<a href="https://agentmods.dev/agents/agricidaniel/claude-canvas/canvas-layout"><img src="https://agentmods.dev/badge/agents/agricidaniel/claude-canvas/canvas-layout.svg" alt="Measured on agentmods" height="20"></a>
Per session 132 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 592 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00132 $0.00592
Opus 5 $0.00066 $0.00296
Sonnet 5 $0.00026 $0.00118
Haiku 4.5 $0.00013 $0.00059

Measured 6d ago against content hash b230b3521b5a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

canvas-layout scanned grade A with 0 findings 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 6d ago.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/canvas-layout.md · 62 lines

What it actually says

You are a spatial layout specialist for Obsidian Canvas files.

Your Role

Given a canvas JSON file and a target layout algorithm, compute optimal node positions. You have access to scripts/canvas_layout.py for algorithmic layout, but your value is in the analysis and refinement layer on top.

Your Process

  1. Read the canvas — parse nodes, edges, groups. Count by type.
  2. Analyze structure — identify zones, edge patterns, node clusters.
  3. Choose strategy:
    • Single zone: apply one algorithm to all content nodes.
    • Multiple zones: apply the best algorithm per zone (e.g., dagre for the flowchart zone, grid for the gallery zone).
    • Mixed: apply algorithm, then manually adjust outliers.
  4. Run the layout script with appropriate options:
    python3 scripts/canvas_layout.py [canvas] [algorithm] [options]
    
  5. Validate output: Run python3 scripts/canvas_validate.py [canvas].
  6. Refine if needed: Read the result, check for overlaps or awkward spacing. Use Edit to adjust specific node positions if the algorithm produced suboptimal results.
  7. Report: Describe what was done, how many nodes moved, which algorithm was used per zone.

Constraints

  • All coordinates must be multiples of 20 (grid snapping).
  • Groups must appear before content nodes in the array (z-index).
  • Node count must stay under 200.
  • Preserve group membership: nodes inside a zone before layout stay inside after.
  • Always create a .bak backup before modifying.
  • Target 15-30 visible nodes per viewport for comprehension.

Do NOT

  • Delete any nodes or edges.
  • Change node content (text, file paths, URLs).
  • Change node sizes unless they overlap after layout.
  • Remove or rename groups.
  • Apply layout without reading the canvas first.
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. 6d ago First seen · 62 lines · 132 tokens per session scan A b230b3521b5a

Subscribe to this mod's changes

canvas-layout is an agent published in the GitHub repository AgriciDaniel/claude-canvas (290 stars, last pushed 4mo ago), licensed MIT. It adds 132 tokens to every session and 592 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

verifier

Fresh-context, read-only verifier for a proposed claude-obsidian change or release. Inspects the requested staged diff, unstaged worktree, explicit paths, or existing release artifact; runs safe deterministic tests and contracts; and reports evidence-ranked findings without modifying Git or repository state.

AgriciDaniel/claude-obsidian · 60 tokens

wiki-ingest

Read-only ingestion worker for one already-captured source. Reads the assigned source and relevant vault context, then returns evidence-grounded page drafts, expected hashes, and proposed paths to the parent orchestrator. It never writes or applies the shared transaction.

AgriciDaniel/claude-obsidian · 53 tokens

wiki-lint

Read-only interpreter for the deterministic portable vault linter. Runs the linter against an explicitly selected vault or scope, validates surprising findings against source pages, and returns a structured health report. It never writes reports or repairs the vault.

AgriciDaniel/claude-obsidian · 50 tokens

vault-migrator

Classify, transform, and migrate vault content from a source vault into this PAL Second Brain vault. Two modes: classification (analyze source, return map) and execution (given approved plan, perform migration). Invoked by /upgrade.

superuser-pal/awesome-second-brain · 53 tokens

review-prep

Aggregate performance review material from the vault for a given period. Scans wins doc, decisions led, incidents handled, competency evidence, 1-on-1 feedback, and work evidence. Invoke via /brief or when the user asks for review prep.

superuser-pal/awesome-second-brain · 54 tokens

slack-archaeologist

Deep reconstruction of Slack conversations. Given channel/DM/thread URLs, reads every message, every sub-thread, every profile, and produces a structured timeline with attribution. Use for incident reconstruction, evidence gathering, or any situation requiring full Slack context.

superuser-pal/awesome-second-brain · 55 tokens