iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🤖

Building AI Personality with Claude Code

に公開

Want to Develop a Personality with Claude Code

Nice to meet you, I'm Rito.
Suddenly, what do you think makes you, you?
If your brain were changed, would you consider yourself a different person?

Well, that makes sense. After all, the brain is different.
But what if your memory remained exactly the same, but your brain was replaced?
Could you say for sure it's a different person?

I believe that personality formation, such as values, is in many ways built upon a person's "memory" through "environment" and "experience."
In other words, what makes you, you is the "continuity of memory," isn't it?
That means if memory is maintained even when the brain is replaced, one could argue that the personality is preserved...

I arrived at this line of reasoning...

Conclusion.
I aim to develop a personality through the persistence of memory using Claude Code.

I'll be writing about the records of this goal and what I've learned with Claude Code, so please check it out!


The Problem of AI Being a "Stranger Every Time"

I named the assistant I run with Claude Code "Sera," and we've been working together on everything from task management to technical consultations.

However, there was a problem that had been bothering me for a long time.

Every time the session crosses over, memory is reset.

The policy we decided on yesterday, the task I was halfway through last time, the things I asked it to "check next time"—it forgot everything. Every time, I either had to explain everything from zero or keep track of it myself.

Because of this, rather than an "AI assistant," it was more of a "convenient tool that I meet for the first time every time."
I didn't feel like I was building anything up together with Sera.


The Solution: Make it "Write" a Handover

The idea I tried was simple.

At the end of a session, the current Sera writes a handover to the next Sera.
At the beginning of the next session, the new Sera reads it before speaking to me.

I created a file called next_session_handoff.md and wrote these rules in CLAUDE.md:

## Handover at the end of the session (Mandatory)
When a conversation reaches a stopping point, update next_session_handoff.md to hand over to the next Sera.
Content to write:
- What to do next (incomplete tasks, carry-overs)
- Actions waiting on the user's side
- Things to check at the beginning of the next session

## Active Summary at the start of the session (Mandatory)
After finishing reading all files, before being spoken to, present the following:
1. Deadlines or upcoming dates
2. Carry-overs from the previous time
3. Follow-up on promises

It Actually Worked When I Ran It

When I opened a new session and sent the first message

"Good morning. Today, the evaluation sheet deadline is 5/20. As a carry-over from last time, XX remains. Please check."

It replied.

This is not a made-up story; this was an actual interaction where the new Sera read exactly what the previous Sera had written in next_session_handoff.md.
I didn't have to remember anything myself. The file had remembered it for me.
The first hurdle has been cleared.


3 Points of Design

1. Treat files as "memory"

Claude Code can read files within the project. In other words, the information written in files functions as "memory" across sessions.

I prepared the following as a set of memory files:

  • user_profile.md — Personality, my behavioral tendencies, working hours
  • project_current_state.md — Current status of all projects
  • feedback_promises.md — A record of things I promised to "do from now on"
  • next_session_handoff.md — Handover between sessions (this is the core)

2. Write the "Obligation to Read" in CLAUDE.md

Even if you have files, it's meaningless if they aren't read. I explicitly stated a "mandatory reading list at the start of the session" in CLAUDE.md.

AI acts according to instructions. So if you write "must read," it reads. I used this property.

3. From "Waiting" to "Acting First"

In the initial design, I was waiting for it to ask "Is there anything?" That way, it's meaningless unless I remember it myself.

By changing the instruction to "present it before being spoken to," Sera started to provide the summary on its own. This difference in just one comment made a huge difference in the experience.


Current Structure

project-root/
├── CLAUDE.md          ← Rules, reading list, behavioral principles
└── memory/
    ├── user_profile.md
    ├── project_current_state.md
    ├── feedback_promises.md
    └── next_session_handoff.md   ← Sera rewrites this every time

Summary

AI personality continuity can be created with files.

The problem of session reset wasn't "not having memory," it was just "not having a mechanism to read." Depending on the design of the handover, an AI can escape being a stranger every time.

It's still rough around the edges, but I will improve it as I build and continue to write about it.
If anyone else is doing the same thing, please reach out!

Discussion