Borrowing it
Nothing to install: this file belongs to luke-harriman/Codesys-MCP. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/luke-harriman/Codesys-MCP/main/CLAUDE.mdgit clone --depth 1 https://github.com/luke-harriman/Codesys-MCPWrote 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.
[](https://agentmods.dev/instructions/luke-harriman/codesys-mcp/claude-md)<a href="https://agentmods.dev/instructions/luke-harriman/codesys-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/luke-harriman/codesys-mcp/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.
<a href="https://agentmods.dev/instructions/luke-harriman/codesys-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/luke-harriman/codesys-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.05180 | $0.05180 |
| Opus 5 | $0.02590 | $0.02590 |
| Sonnet 5 | $0.01036 | $0.01036 |
| Haiku 4.5 | $0.00518 | $0.00518 |
Grade A, and why
Codesys-MCP CLAUDE.md 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 9d 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.
How it starts
The opening of the file, as written. The whole thing — 177 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md - codesys-mcp-persistent
Orientation for a future Claude / agent session working on this repo. Read first.
What this is
codesys-mcp-persistent is an MCP server that wraps the CODESYS V3.5 IDE scripting API (IronPython 2.7) as MCP tools. Owned/maintained by Luke Harriman (luke-harriman on GitHub). Drop-in superset of @codesys/mcp-toolkit.
- Target runtime: Windows + CODESYS V3.5 SP19 / SP20 + Node 18+. Not portable.
- SP21+ persistent mode is currently broken. The watcher's
se.system.execute_on_primary_thread()call no longer exists in SP21 P5 / SP22 P1 (and possibly earlier patches — SP21 P3 release noteCDS-94322 "Scripting: Context object for Python calls needed"is the closest paper trail but unconfirmed). Symptom: every persistent-mode tool call returnsMarshal error: The functionality 'system.execute_on_primary_thread(...)' is no longer supported. Headless mode (--noUIper command) is unaffected. The fix is well-understood (single-thread watcher +se.system.delay()between polls — see phobicdotno/Codesys-MCP-SP21-plus v0.4.2 for the reference implementation) but not yet adopted here. See known pitfall #12 and the deferred-work entry. - Wire format: stdio JSON-RPC (MCP) on the outside; file-based IPC on the inside.
- Two execution modes:
persistent(CODESYS UI stays open, watcher.py running, commands marshalled onto its primary thread) andheadless(--noUIspawn-per-command). Persistent is the point of the project; headless is the bootstrap + fallback (and the only SP21+-compatible mode until the watcher rewrite lands).
Read README.md for tool surface, ARCHITECTURE.md for IPC details, CHANGELOG.md for the per-version journey.
Hard architectural constraints (don't fight these)
- IronPython 2.7 inside CODESYS. Scripts run there, not in CPython. No
f""strings, noprint()parens, nononlocal,unicodeis a separate type fromstr, ints can belong,range()returns a list. The defaultjson.dumps(..., ensure_ascii=True)calls a defective decode path that crashes on cp1252 bytes - always useensure_ascii=Falseand emit utf-8 via_text_utils.emit_result(). - ASCII-only Python source (no
# -*- coding -*-header in current scripts). Em-dashes, smart quotes,§are forbidden in source. The static checkerdev/check-scripts.ps1enforces this; run it before every commit. - CODESYS scripting API is single-threaded. Current watcher marshals from a .NET background thread onto the IDE's primary UI thread via
se.system.execute_on_primary_thread()(src/scripts/watcher.py:230). A long-running script (regex DoS, big bulk read) freezes the IDE. This API was removed in SP21+ — see pitfall #12. The forward fix runs the watcher directly on the primary thread and yields viase.system.delay()between polls; the IDE stays interactive becausesystem.delay()services the message loop. Until that rewrite ships, SP21+ users must run with--mode headless. scriptengine.onlineops need an executor frame on real PLCs.create_online_application,oa.login,oa.start,oa.read_value,oa.set_prepared_value, etc. raiseInvalidOperationException: Stack empty.from a pure IPC-driven script — the IDE-internal_executionStackis only populated by the script executor'sExecutingevent, which the IPC bridge bypasses. Fixed in 0.6.3 byensure_online_connection.py: reflects intoscriptengine.online._executorand routes every online call through its publicExecuteSource(source)method (seewith_executor). When writing a new online tool, wrap eachonline_app.X(...)call inwith_executor(online_app.X, ...args)— without it the call hits Stack empty on real PLCs.set_pou_codeauto-saves to disk. UI Ctrl+Z does NOT recover prior content. Read before overwriting; treat the project file as the source of truth, not the IDE buffer.
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.
- 9d ago First seen · 177 lines · 5,180 tokens per session scan A d1dd456d39c5
Codesys-MCP CLAUDE.md is an instructions file published in the GitHub repository luke-harriman/Codesys-MCP (73 stars, last pushed 3mo ago), licensed MIT. It adds 5,180 tokens to every session, about $0.0259 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.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.