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.
git clone --depth 1 https://github.com/crypticsaiyan/githubwrappedWrote 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/rules/crypticsaiyan/githubwrapped/state-management)<a href="https://agentmods.dev/rules/crypticsaiyan/githubwrapped/state-management"><img src="https://agentmods.dev/badge/rules/crypticsaiyan/githubwrapped/state-management/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/rules/crypticsaiyan/githubwrapped/state-management"><img src="https://agentmods.dev/badge/rules/crypticsaiyan/githubwrapped/state-management.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.00000 | $0.01067 |
| Opus 5.5 | $0.00000 | $0.00427 |
| Sonnet 5.5 | $0.00000 | $0.00213 |
| Haiku 4.5 | $0.00000 | $0.00107 |
Grade A, and why
state-management 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 3mo 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 — 137 lines — stays where its author put it; the contents beside it link to each section on GitHub.
State Management
State Management is a core concept in Motia. It's used to store data across Steps. They can be stored across different workflows.
If we want to trigger Event Steps, we can add data to the emit call, which can be used later in the Event Step execution. But this is limited and can't store too much data, that's why we need to use the State Management to store data across Steps.
Use-cases
When State Management is recommended:
- Pulling data from an external source, like an API, and storing it in the state, then triggering an Event Step to process the data.
- Storing data that needs to be used later in the workflow.
- Can be used for caching layer, like caching the result of an API call that usually can take a few seconds to complete and doesn't change very often.
When another solution can be better suited:
- Storing persistent user data: it's preferred to use a database like Postgres or MongoDB to store user data.
- Storing file data like Base64 encoded images, PDFs, etc: it's preferred to use a storage solution like S3, etc.
StateManager Interface
The StateManager interface is available in the context of all step handlers. The methods work identically across TypeScript/JavaScript and Python.
type InternalStateManager = {
/**
* Retrieves a single item from the state
*
* @param groupId - The group id of the state
* @param key - The key of the item to get
* @returns The item or null if it doesn't exist
*/
get<T>(groupId: string, key: string): Promise<T | null>
/**
* Sets a single item in the state
*
* @param groupId - The group id of the state
* @param key - The key of the item to set
* @param value - The value of the item to set
* @returns The item
*/
set<T>(groupId: string, key: string, value: T): Promise<T>
/**
* Deletes a single item from the state
*
* @param groupId - The group id of the state
* @param key - The key of the item to delete
* @returns The item or null if it doesn't exist
*/
delete<T>(groupId: string, key: string): Promise<T | null>
/**
* Retrieves a group of items from the state
*
* @param groupId - The group id of the state
* @returns A list with all the items in the group
*/
getGroup<T>(groupId: string): Promise<T[]>
/**
* Clears a group of items from the state
*
* @param groupId - The group id of the state
*/
clear(groupId: string): Promise<void>
}
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.
- 3mo ago First seen · 137 lines · 0 tokens per session scan A 01768b3336c6
state-management is a cursor rule published in the GitHub repository crypticsaiyan/githubwrapped (5 stars, last pushed 11mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,067 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-31.
state-management compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| state-managementcrypticsaiyan/githubwrapped | Cursor rule | 5 | 11mo ago | MIT | A | 0 | Cursor |
| mempalace-recall-alwaysMemPalace/mempalace | Cursor rule | 61k | today | MIT | A | 260 | Cursor |
| dreamd-recallbotzrDev/dreamd | Cursor rule | 9 | today | Apache-2.0 | A | 135 | Cursor |
| common_memory_bankshalomeir/common-memory-bank | Cursor rule | 30 | 7mo ago | Unlicense | A | 1,801 | Cursor |
| self-improving-obsidian-llm-wikiBahgs/Self-Improving-Obsidian-LLM-Wiki | Cursor rule | 32 | 6mo ago | MIT | A | 146 | Cursor |
| memsproutmemsprout/agents | Cursor rule | 0 | 4mo ago | MIT | A | 519 | Cursor |
| business-memory-bankleshchenko1979/business-memory-rules | Cursor rule | 3 | 1y ago | none | A | 2,401 | Cursor |