- Home
- Skills
- Agents & Orchestration
- state memory
Works with the AI Agents you already use
state memory
Persistent state management for agents using a structured Markdown file to track decisions, invariants, and progress.
Free
state memory
Example session with this skill installed
We need to migrate the auth logic from JWT to session cookies. I've already started. Save the current state and tell me where we are.
- Read your context and instructions
- Compiled the state memory
I have updated the STATE.md file to reflect our current progress on the auth migration. I have logged the transition to session cookies as the primary architectural decision and noted the invariant regarding secure-only flags.
STATE.md
| Category | Entry | Status/Details |
|---|---|---|
| Goal | Migrate auth logic from JWT to session-based cookies. | In Progress |
| Decision D1 | Use express-session with Redis store for persistence. | Active |
| Decision D2 | Set SameSite: 'Lax' to balance security and UX. | Active |
| Invariant I1 | All session cookies must have Secure and HttpOnly flags. | Mandatory |
| System Map | src/auth/service.ts [VERIFIED], src/middleware/auth.ts [UNVERIFIED] | Mapping |
| Discovery | The current User model lacks a last_login timestamp required for session invalidation. | New |
Done and Verified
- Identified all
localStorage.getItem('token')calls in frontend components. - Installed
express-sessionand@types/express-session.
In Progress
- Update
src/auth/service.tsto implement thecreateSessionmethod using the new store.
Next steps
- Modify the
Userschema to include thelast_loginfield discovered during exploration. - Refactor the login controller to set the cookie instead of returning a JSON payload.
- Update the auth middleware to validate the session ID against the Redis store.
Connects securely to your tools. The creator never sees your data.
About this skill
Context drift and memory loss are the primary causes of agent failure in long-running tasks. When an agent forgets a design decision from ten minutes ago or loses track of which files it has actually verified, it begins to hallucinate or break existing logic. This skill implements a disciplined state management protocol using a structured STATE.md file to act as the source of truth for your agent.
What it does
- Persistent State Tracking maintains a record of goals, progress, and pending tasks across multiple sessions.
- Decision Logging captures technical choices and their rationale to prevent circular debates or regressions.
- Invariant Enforcement documents non-negotiable rules that all subsequent code changes must respect.
- Context Verification tracks which files have been read and validated to prevent the agent from guessing file contents.
- Incremental Mapping builds a system map and interface list as the agent explores large codebases.
How it works
- Initialize by checking for an existing
STATE.mdat the root or creating one from the template with a clear success criterion. - Execute by reading the state before any other action to align with previous decisions and invariants.
- Log new decisions, discoveries, and verified interfaces in real-time as the work progresses.
- Finalize the session by moving completed items to the verified list and defining the exact starting point for the next session.
Frameworks & tools
This skill is platform-agnostic and works with any file-system-capable agent like Claude Code, Cursor, or Aider. It uses standard Markdown for the state file.
Why this beats prompting it yourself
Generic instructions to "remember what we did" fail as the context window fills up. This skill enforces a specific structural format that prioritizes invariants and decisions over chat history, ensuring the agent never loses the "why" behind the code even after a total session reset.
Use cases
- Multi-file Refactors where architectural decisions must remain consistent across dozens of files.
- System Audits that require tracking which modules have been cleared and which are still pending review.
- Long-running Builds where work is interrupted and resumed over several days or by different agents.
- Large Codebase Exploration where the agent needs to build a durable map of interfaces it has already discovered.
Known limitations
The state file requires manual updates at the end of every session to remain useful. Large state files exceeding 200 lines require manual compression of the done list to maintain performance.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.
Requires file system access to read/write STATE.md. Requires manual update at session end. Effectiveness drops if state exceeds 200 lines without compression.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
1 use
Times used to date
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 26 days ago
- Free with an Agensi account