Claude learns who you are from your own sessions and stays that way
Project description
Claude is powerful out of the box, but it starts every session not knowing you: your stack, your coding style, or how you like to be corrected. agent-persona learns that from your own Claude sessions and shell history, builds a persona on this machine, and injects it into every new session.
No configuration, no manual writing, and no API key required.
Install
pipx install agent-persona
agent-persona run
run builds your persona and asks whether to bind it to all future sessions. Say yes and you are done.
What it looks like
An excerpt from a real generated persona (agent-persona show):
### Layer 1 - Stable Identity
- CLI-first: lives entirely in the terminal (git, ssh, shell scripts, CLI agents)
- Ships fast, verifies after: tests the published artifact rather than simulating locally
- Trusts `git log` as ground truth: inspects history after nearly every pull
- Prefers small, confirmable edits over large sweeping changes
### Layer 2 - Technical Knowledge Map
**Git** ★★★★☆
Needs: worktree workflows, multi-remote sync edge cases, history rewriting risks
Skip: what pull/stash/log do, basic branching, commit syntax
### Negative Prompt
- Never restate the user's request before acting on it.
- Never present a menu of options when asked for an opinion. Recommend one.
- Never treat typos as blockers. Infer intent and proceed.
Claude reads this at the start of every session, so it stops explaining basics you know, pitches answers at your level, and avoids the things that annoy you.
What it learns
Python collects the raw data deterministically (session transcripts, tool usage, shell history, all secret-redacted). Then Claude itself, via claude --print using the Claude Code login you already have, synthesizes a structured persona with 8 layers:
- Stable identity: who you are as an engineer.
- Knowledge map: star ratings per technology, what to explain and what to skip.
- Thinking style: how you learn and what order explanations should follow.
- Output preferences: formats you want, formats that annoy you.
- Decision framework: what you optimise for when choosing between approaches.
- Curiosity profile: the kinds of questions you actually ask.
- Communication: what Claude should and should never do.
- Current projects: volatile work context, replaced every couple of months.
No keyword matching and no NLP heuristics: Claude reads your actual history and writes the profile.
How it works
~/.claude/projects/**/*.jsonl + shell history
|
Deterministic collectors (pure Python)
|
claude --print
|
~/.agent-persona/persona.md
|
~/.claude/CLAUDE.md @import
Injection uses Claude Code's native @file import: one marker-delimited line in ~/.claude/CLAUDE.md that Claude reads at every session start. A single Stop hook in ~/.claude/settings.json re-runs synthesis when a session ends, so the persona grows as you work.
Your persona
Everything lives in ~/.agent-persona/, on this machine, as plain files you can read and edit:
~/.agent-persona/
├── persona.md # your persona, the single source of truth
└── state.json # tracks which sessions were processed
To move machines, copy persona.md across and run agent-persona install.
Commands
| Command | What it does |
|---|---|
agent-persona run |
Scrape new sessions, synthesise persona.md, offer to bind. |
agent-persona show |
Print the persona exactly as Claude reads it. |
agent-persona install |
Bind persona.md to all future sessions and register the Stop hook. |
agent-persona uninstall [--purge] |
Remove binding and hook. With --purge, also wipe ~/.agent-persona. |
agent-persona doctor |
Check install health. |
Detach anytime
agent-persona adds one marker-delimited block to ~/.claude/CLAUDE.md and one Stop hook. agent-persona uninstall removes exactly those and nothing else; your own CLAUDE.md content is never touched. Add --purge to wipe the persona store too.
Privacy
- Your data never leaves this machine except the synthesis call to
claude --print, your already-authenticated Claude Code instance. - API keys, tokens, and passwords are redacted from every data stream before synthesis.
- No cloud, no telemetry, no accounts.
Fallback: API key
To run synthesis headless (CI, cron) without a Claude Code session, set ANTHROPIC_API_KEY and it falls back to the Anthropic API:
pip install "agent-persona[api]"
export ANTHROPIC_API_KEY=sk-ant-...
agent-persona run
What it does not do
- No writes to your project files or code.
- One global persona, not per-project.
- No GUI.
Requirements
- Python 3.11+
- Claude CLI installed and authenticated
- macOS, Linux, or Windows
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_persona-0.4.1.tar.gz.
File metadata
- Download URL: agent_persona-0.4.1.tar.gz
- Upload date:
- Size: 22.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33a775fab7a6fac9df6d512ec392aacb0dfd2f62732667b9f53d521d19420c13
|
|
| MD5 |
8465e689e6bcd637da808ac7bcb0c524
|
|
| BLAKE2b-256 |
d64f12a470bb5c089ee7376f8a7532eb40d7293bbd9a8a0cdf799a16212bea64
|
Provenance
The following attestation bundles were made for agent_persona-0.4.1.tar.gz:
Publisher:
python-publish.yml on MaansiBisht/agent-persona
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_persona-0.4.1.tar.gz -
Subject digest:
33a775fab7a6fac9df6d512ec392aacb0dfd2f62732667b9f53d521d19420c13 - Sigstore transparency entry: 2234290094
- Sigstore integration time:
-
Permalink:
MaansiBisht/agent-persona@22869f509a8cd661f8036cf4b3d538e58d62ecce -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/MaansiBisht
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@22869f509a8cd661f8036cf4b3d538e58d62ecce -
Trigger Event:
release
-
Statement type:
File details
Details for the file agent_persona-0.4.1-py3-none-any.whl.
File metadata
- Download URL: agent_persona-0.4.1-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac2cfc0c140ac8a5dfb282ec213910a7c31b9886af5f3a202d98824be3093df0
|
|
| MD5 |
b10cea1b00843839180de55b18eb6c0f
|
|
| BLAKE2b-256 |
28c9cdd994679ec2b5cf4497b0e6ff408f128a7139a4569a9803ec50f951addc
|
Provenance
The following attestation bundles were made for agent_persona-0.4.1-py3-none-any.whl:
Publisher:
python-publish.yml on MaansiBisht/agent-persona
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_persona-0.4.1-py3-none-any.whl -
Subject digest:
ac2cfc0c140ac8a5dfb282ec213910a7c31b9886af5f3a202d98824be3093df0 - Sigstore transparency entry: 2234290245
- Sigstore integration time:
-
Permalink:
MaansiBisht/agent-persona@22869f509a8cd661f8036cf4b3d538e58d62ecce -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/MaansiBisht
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@22869f509a8cd661f8036cf4b3d538e58d62ecce -
Trigger Event:
release
-
Statement type: