core-modules

A guide to the project's main internal software packages, including sessions, configuration, tools, background commands, and connections to external tool servers.

In plain words
What is it for?
It is for finding the code responsible for agent turns, editor sessions, YAML settings, shell tasks, background jobs, filesystem tools, and MCP server connections.
Why use it?
It gives developers a map of where core parts live and explains the approval gate that protects project-local external-server settings.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/coddy-project/coddy-agent/core-modules
Clone the repo
git clone --depth 1 https://github.com/coddy-project/coddy-agent

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 878 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 $0.00000 $0.00878
Opus 5 $0.00000 $0.00439
Sonnet 5 $0.00000 $0.00176
Haiku 4.5 $0.00000 $0.00088

Measured yesterday against content hash 00779e5d3e47, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

core-modules 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 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.

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.

.cursor/rules/core-modules.mdc · 23 lines

How it starts

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

Core modules (sketch)

  • internal/acp - ACP RPC server, session lifecycle from editors.
  • internal/agent - tool loop and LLM turns.
  • internal/session - session manager and mode (agent / plan).
  • internal/config - YAML and flags.
  • internal/tools - filesystem, shell, todo, MCP merge, etc. Shell also owns the background task family (run_command background: true plus background_list / background_output / background_wait / background_stop), backed by internal/bgtask. See docs/background-tasks.md.
  • internal/mcp - MCP transports (client.go, remote.go, connect.go), the merged server list with scope/origin labels (manage.go), and the workspace trust gate for project-local .coddy/mcp.json (trust.go, gate.go). That file arrives with the checkout, so its declarations are not started or contacted until the operator approves that exact declaration for that workspace: policy mcp.project_trust (ask default / allow / deny), approvals in <home>/mcp-trust.json keyed by canonical workspace + declaration digest. Every connect or probe of a configured server must go through TrustGate.Connect / TrustGate.Probe (they re-check immediately before the spawn); mcp.Connect directly is only for ACP client-supplied servers. Approval surfaces: coddy mcp list|trust|untrust, POST /coddy/mcp/{name}/trust|untrust, Settings → MCP servers. See docs/mcp-integration.md.
  • internal/bgtask - process-wide, session-scoped pool for work that outlives a tool call. A task is whatever a Runner starts; CommandRunner is the only implementation today and KindAgent is reserved for a future nested-agent runner, so that lands as a second Runner rather than a second scheduling mechanism.
  • internal/skills - skill loading, enable/disable (loader.go, disabled.go), and remote install from repos / agents-standard marketplaces (remote.go, manifest.go, plugin.go: Sync/SyncSource (all or one source), AddSource, RemoveRemote/DeleteSkill (delete any on-disk skill; bundled = read-only via SkillReadonly), ListSources, RemoveSource, CheckUpdates, UpdateSkill; git clone via internal/gitws.Clone/Pull, materialized into ${CODDY_HOME}/skills with a .remote.json lockfile that records each skill's installed version). Marketplace plugin version (and SKILL.md frontmatter version) are surfaced by InstalledVersion and drive update detection (compareVersions). Default dirs: ~/.agents/skills (global, shared with npx skills/npx skillsbd), ~/.coddy/skills (coddy-specific), ${CWD}/.coddy/skills (project-local). Remote sources are listed in skills.sources and fetched only on demand. Management parity across the CLI (coddy skills add|sync|remove, coddy plugin marketplace list|add|remove|sync, coddy plugin install|remove|enable|disable), the built-in /plugin chat command (internal/agent/plugin_command.go, deterministic like /compact; shared dispatcher skills.RunPluginCommand / MarketplaceStatus in plugin.go), HTTP (/coddy/skills/*), and the Settings → Skills UI. See docs/skills.md.

Prefer extending these over growing cmd/ or duplicating logic in external/.

Read the full file on GitHub · 23 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 First seen · 23 lines · 0 tokens per session scan A 00779e5d3e47

Subscribe to this mod's changes

core-modules is a cursor rule published in the GitHub repository coddy-project/coddy-agent (127 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 878 tokens. 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.