shapa-llm: Instructions file for Claude Code

AGENTS.md

shapa-llm AGENTS.md is an instructions file for Claude Code, Codex, OpenCode from Roukh/shapa-llm. It costs 11,337 tokens per session, scanned D, original, MIT.

Repository-specific instructions for a coding agent working on Roukh/shapa-llm. They describe how to navigate the project, which commands to use, who owns it, and what boundaries to respect.

In plain words
What is it for?
Use them as operating guidance when inspecting or editing the shapa-llm repository.
Why use it?
They give an automated coding tool the project context and limits it needs before changing files.

Instructions file for Claude CodeCodexOpenCode

Written for Claude Code and Codex and OpenCode: SessionStart hook event, but also the file is AGENTS.md. Also seen: mentions CLAUDE.md; mentions subagents; mentions Claude Code.

This is Roukh/shapa-llm's own configuration. It tells Claude Code, Codex and OpenCode how to work on shapa-llm 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 shapa-llm configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Roukh/shapa-llm. 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/Roukh/shapa-llm/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/Roukh/shapa-llm

Made for: Claude Code, Codex, OpenCode.

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 shapa-llm AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/roukh/shapa-llm/agents-md/github.svg)](https://agentmods.dev/instructions/roukh/shapa-llm/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/roukh/shapa-llm/agents-md"><img src="https://agentmods.dev/badge/instructions/roukh/shapa-llm/agents-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 shapa-llm AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/roukh/shapa-llm/agents-md"><img src="https://agentmods.dev/badge/instructions/roukh/shapa-llm/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11,337 This file is loaded in full into every session.
When invoked 11,337 The same file — it is already loaded in full.
Security scan D 3 findings. 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.11337 $0.11337
Opus 5.5 $0.04535 $0.04535
Sonnet 5.5 $0.02267 $0.02267
Haiku 4.5 $0.01134 $0.01134

Measured 7d ago against content hash 11d6f1f363da, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade D, and why

shapa-llm AGENTS.md scanned grade D with 3 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 7d 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

- `install.sh` wires hooks, MCP and the skill from a clone. `bootstrap.sh` is the `curl | sh` installer.

Reads agent configuration directoriesmediumAgent snooping

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

- Touched by the installers: Claude Code `settings.json`, `~/.codex/config.toml`, `opencode.json` (merged with `jq`), and Obsidian when present; `shapa harness` additionally edits user-level files only, each backed up on

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Hosted store (opt-in): `remote.py` (`shapa remote`), `remotesync.py` (wiki keys, scope, the hook mode), `remotehttp.py` (stdlib `urllib` client, injectable transport), `sync.py` (snapshot, classify, exchange), `syncapp
AGENTS.md · 83 lines

How it starts

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

shapa-llm

Source of the shapa tool: an operational-memory engine for LLM agents (one SQLite database per wiki holding the work ledger and memory/rule/issue rows, ranked recall, self-healing maintenance). This file is for agents working on the tool itself. The note schema a wiki follows is shapa/assets/AGENTS.md, which shapa init installs into every wiki; this repo's own wiki is .shapa/.

  • shapa/ is the engine package; cli.py is the shapa command (python3 -m shapa from a clone).
    • Wiki resolution and discovery: config.py, registry.py (~/.shapa/wikis.json).
    • Read path: bootstrap.py (SessionStart, the order is in Contracts; --full for the old overview), fetch.py, rank.py, bm25.py, embed.py, get.py.
    • Code map and partitions: codemap.py (shapa map: a bounded, incremental graph of the checkout in the derived .shapa-code.db; Python by ast, JS/TS by regex), partition.py (shapa partition, the MCP tool partition, the session-start line). Local only; the Worker holds none of it.
    • Focus and skills (documents told apart by tags, no new kind): focus.py (shapa focus: northstar, three fires, promotion), skills.py (shapa skill: versions, activation, lessons from rows, uproot, match), skillmirror.py (shapa skill mirror: skill FILES into those versions; run by upgrade and the session catch-up of commit --hook); the lean gate (one document per project) is db.add_doc. The Worker's skills.ts and skillmatch.ts serve them and the MCP skill_match.
    • Learning loop (documents of rows, no new kind): learn.py (shapa learn: repeat detection when a correction is filed, pending, apply with its merge, supersede, conflict, churn and meta-cap guards, split, principles, the session-start helpers), node.py (shapa node: each repo wiki's node in the global wiki, and the promotion candidates) and metrics.py (shapa metrics: per-device raw events in the gitignored index, daily snapshots in metrics_daily, the roll-up, latency against record count, frustration). ledger.record_correction calls both. learnimport.py is shapa learn import (the operator's curated file of principles, mistakes and memories for one wiki, one transaction, privileged CLI only, no MCP tool).
    • Hierarchy (data in TOML, nothing named in code): hierarchy.py (shapa hierarchy, shapa repo, the MCP tools hierarchy and repo: level names, repo types and the tree in <global wiki>/shapa.toml, each repo's type, read_stage and global_access in <repo wiki>/shapa.toml, the session-start line, a small TOML writer beside tomllib). The Worker reads it from the repo's node (hosted/src/nodes.ts).
    • Central brain (the global wiki as the operator's one brain): stages.py (shapa stage: the baseline), tasks.py (shapa tasks, standalone human_task/agent_task), projectfile.py (shapa project, template assets/project-template.md), relate.py (shapa tags, shapa related, fetch --tag).
    • Database (format 4, schema 2): db.py (schema, work ledger, rows, documents, tombstones, sweep, worktree resolution), docs.py (shapa doc), ledger.py (shapa ledger/row/correction and the git and harness triggers), migrate4.py (format 3 to 4), commit.py (shapa commit: the wiki commits itself on the default branch, as a SessionEnd/SessionStart hook).
    • Write path: capture.py (Stop hook), redact.py (masks secrets), pii.py and piitable.py (the personal-data gate and its one pattern table, assets/pii-patterns.json, byte-copied to hosted/src/pii-patterns.json; the Worker twin is hosted/src/pii.ts and piigate.ts), memlog.py (format-3 log, and the derived index that also mirrors database rows), save.py.
    • Index and daemon: store.py, serve.py. MCP server: mcp.py.
    • Hosted store (opt-in): remote.py (shapa remote), remotesync.py (wiki keys, scope, the hook mode), remotehttp.py (stdlib urllib client, injectable transport), sync.py (snapshot, classify, exchange), syncapply.py (the one-transaction apply step), syncrec.py (wire records, validation of server input, note file safety), syncstate.py (credentials, per-wiki state and lock), dbsync.py (explicit-id upserts, relabel). The Worker itself is hosted/; the contract is .shapa/arch/hosted.md.
    • System prompt per harness: harness.py (shapa harness install|uninstall|status|watch: composes assets/prompts/core.md plus assets/prompts/adapters/<harness>.md into ~/.shapa/prompts/ and wires it), harnesswatch.py (hashes and heading lists of the harness defaults, offline), hookcap.py (caps the SessionStart hook output; cli.py routes shapa bootstrap through it).
    • Maintenance: maintain.py, heartbeat.py, score.py. Format: frontmatter.py, nodes.py, validate.py, upgrade.py, status.py, reconfigure.py (the session-start restructure directive; its prompt is assets/prompts/reconfigure.md), upkeep.py (the session-start upkeep directive). Opt-in importer: memri_import.py.
  • shapa/assets/ ships into user wikis: AGENTS.md (schema and wiki marker), placement.md, the arch/index.md template, prompts/ (the shared core and the per-harness adapters that shapa harness installs, never into a wiki) and skills/shapa-upgrade (installed into harnesses, never into a wiki).
  • tests/ is the pytest suite, with fixtures under tests/fixtures/. tests/test_parity.py reads the Worker's constants from hosted/src and holds them equal to the Python ones (baseline budget, project template, section keys, system tags, caps, precedence sentence): change one side and it names the other.
  • install.sh wires hooks, MCP and the skill from a clone. bootstrap.sh is the curl | sh installer.
  • .shapa/ is this repo's wiki: shapa.db holds its work ledger and rows (shapa ledger, shapa row list), arch/ the design docs.
  • .github/workflows/test.yml is CI.

Read the full file on GitHub · 83 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. 7d ago Changed · +3 lines · +1,573 tokens per session 11d6f1f363da
  2. 9d ago Changed · +4 lines · +3,581 tokens per session 5a797333de85
  3. 10d ago Changed · +291 tokens per session dd90ccc50d9b
  4. 15d ago Changed · +13 lines · +3,886 tokens per session ba3d908881dc
  5. 1mo ago Changed · +1 lines · +194 tokens per session ef07dad9029b
  6. 1mo ago Changed · +2 lines · +229 tokens per session 60ddee4d21bc
  7. 1mo ago First seen · 60 lines · 1,583 tokens per session scan D 9b3e0bb10f84

Subscribe to this mod's changes

shapa-llm AGENTS.md is an instructions file published in the GitHub repository Roukh/shapa-llm (2 stars, last pushed 8d ago), licensed MIT. It adds 11,337 tokens to every session, about $0.0453 per session on Opus 5.5. A static security scan graded it D with 3 findings (downloads and executes remote code, reads agent configuration directories, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-03.

Related

shapa-llm AGENTS.md compared with instructions from other repositories

shapa-llm AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
shapa-llm AGENTS.mdRoukh/shapa-llmInstructions file28d agoMITD11,337Claude Code, Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA9,887GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file144ktodayMITA7,230Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file150kyesterdayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA3,303GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file289k2d agoMITA4,393Codex, OpenCode