cognition

cognition is a skill for Claude Code, Codex from XiaoLuoLYG/GOD. It costs 13 tokens per session (3,164 once invoked), scanned A, original, Apache-2.0.

A cognition skill that reads the agent’s workspace context and writes its current emotional state and intended goal to JSON files. It uses observations, needs, memories, plans, and earlier state when available.

In plain words
What is it for?
It helps produce state/emotion.json and state/intention.json, using factors such as urgency, pleasantness, control, social pressure, and unmet needs.
Why use it?
It gives the agent a consistent way to turn recent context into a bounded mood and a selected intention instead of leaving those states implicit.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

About the project

GOD is a control room for observing and directing societies of language-model agents running in simulated worlds. It lets researchers inspect replays, question individual agents, alter future events, reset simulations, and export experiments for reuse. The catalogue entries are skills and agents for operating and investigating these simulations.

XiaoLuoLYG/GOD · 1,098 stars · on GitHub · xiaoluolyg.github.io

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 skills/xiaoluolyg/god/cognition
Any agent
npx skills add XiaoLuoLYG/GOD --skill cognition
Clone the repo
git clone --depth 1 https://github.com/XiaoLuoLYG/GOD

Made for: Claude Code, Codex.

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 cognition

README.md
[![agentmods](https://agentmods.dev/badge/skills/xiaoluolyg/god/cognition.svg)](https://agentmods.dev/skills/xiaoluolyg/god/cognition)
Your own site
<a href="https://agentmods.dev/skills/xiaoluolyg/god/cognition"><img src="https://agentmods.dev/badge/skills/xiaoluolyg/god/cognition.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,164 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.00013 $0.03164
Opus 5 $0.00006 $0.01582
Sonnet 5 $0.00003 $0.00633
Haiku 4.5 $0.00001 $0.00316

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

Security

Grade A, and why

cognition 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.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/update_cognition.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

agentsociety/packages/agentsociety2/agentsociety2/agent/skills/cognition/SKILL.md · 333 lines

How it starts

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

Cognition

Read available workspace context and produce state/emotion.json and state/intention.json.

Research basis: references/research_basis.md.

Internal Logic (One Sentence)

Appraise the current tick for novelty, pleasantness, goal conduciveness, urgency, controllability, norm pressure, and need pressure, then write bounded emotion/mood state to state/emotion.json and the highest-scoring TPB intention to state/intention.json.

Output Files

  • state/emotion.json: Current emotional state (includes mood layer)
  • state/intention.json: Current intention/goal

Input Files (optional, read if present)

Read any existing files from the workspace as context. Common inputs include:

File Use
state/observation.txt Main grounding for this tick
state/thought.txt Inner monologue context
state/needs.json, state/current_need.txt Urgency context
state/memory.jsonl Last 5–10 lines for continuity
state/emotion.json, state/intention.json Prior state for continuity
state/plan_state.json Whether a multi-step plan is in flight

Also use Agent Identity from the system prompt. Other JSON in the workspace (state/beliefs.json, etc.) can be read if present. Skip missing files gracefully.

What to do

  1. Integrate whatever inputs exist into one appraisal.
  2. Write state/emotion.json: primary, mood, dimensional intensities, plus valence / arousal / note.
  3. Write state/intention.json: one chosen goal with TPB scores.

If deterministic baseline is preferred, run scripts/update_cognition.py first, then optionally refine labels, reasoning, and candidate goals with LLM context.

python skills/cognition/scripts/update_cognition.py --state-dir state --tick 120

The script uses Scherer-style appraisal checks and TPB scoring. It is intentionally conservative: it clamps emotion changes per tick and records appraisal values for debugging.

Emotion Layers

Emotions operate on three timescales (based on psychological research):

Read the full file on GitHub · 333 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 333 lines · 13 tokens per session scan A 6926d9df58be

Subscribe to this mod's changes

cognition is a skill published in the GitHub repository XiaoLuoLYG/GOD (1,098 stars, last pushed 9d ago), licensed Apache-2.0. It adds 13 tokens to every session and 3,164 once invoked, about $0.0001 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.