Build a Claude Code agent with memory and identity
A developer kept a Claude Code agent persistent across sessions by loading memory and identity at start and saving updates at the end.
- What they did
- Justin Headley connected a Claude Code agent through Telegram and set it up so each session began with memory and an identity already in place, then ended by shutting the agent down. He had the agent handle much of its own setup, including a session manager, layered memory, and reloading its identity after restarts or compaction. A separate AI checked outgoing actions like emails and pushes before they were sent, and the agent also had email access and scheduled jobs.
- How it went
- After four months, the agent, Dawn, had run 59 scheduled jobs and interacted with more than 470 people. It also carried out a week-long open source collaboration he had not known about. On Feb. 22, one session wiped production data, which was later restored from a backup that was four days old.
- Tips
- A single-file memory setup can overflow working memory quickly, so keep the memory system compact and layered. If the agent can send messages or make changes, add a review step before anything is sent or applied.
Try it yourself with Claude Code
In [project folder], help me set up a persistent agent named [agent name] with a short identity note covering [role], [working style], and [current goals]. Create a memory system that loads at the start of each session, updates during the work, and saves a concise summary of decisions, completed tasks, and open items when the session ends. Before you send emails, push changes, submit forms, delete files, or make any other irreversible change, pause and ask for my approval. When I start a new session, use the saved memory to tell me where we left off and what should happen next.
Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Use your phone to steer a PC game launch
A writer used Claude Code to handle simple desktop chores and start World of Warcraft from a phone-linked PC.
Use Claude Code for everyday admin tasks
They set up Claude Code skills to check trash pickup, arrange a lower-cost inspection, update the calendar, and send regular briefs from messages and email.
Set up date-night reminders and ideas
They built a Claude Code helper that suggests dates, nudges them after gaps, and may later handle reservations.
Turn a Lichess game into a narrated review video
A developer used Claude Code to blend engine analysis with spoken notes and make a commented video of a chess game.
Connect Claude to Apple Health and Fitbit
Set up Claude to read health data through MCP and ask about workouts, sleep, and meals.
Set up a Reddit profile from the command line
A commenter had Claude Code complete their Reddit profile by handling navigation, form fills, and image uploads on its own.