Local-first personalization layer for Claude CLI — learns how you work and injects that context into every session
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, the files you edit, and your shell history, builds a persona on this machine, and injects it into every new session.
No configuration and no manual writing required. To set something explicitly, run agent-persona customize.
Install
pipx install agent-persona
agent-persona install
From the next session on, it builds your persona.
What it learns
Everything below is free and automatic (no LLM, no cost), read from your session logs, edited files, and shell history:
- Stack: the languages, frameworks, and tools you actually use, frequency-weighted, with tech you stop using fading over time.
- Coding style: indent and test frequency, sampled from files you edit.
- Request patterns: recurring follow-up habits (for example, after a bug fix you usually ask why it happened).
- Corrections: when you redirect Claude ("revert that", "too complex", "don't add that yet"), recurring redirects become guidance such as "prefer the simplest solution" or "do only what's asked".
You can also set preferences yourself with agent-persona customize. Manual preferences carry full confidence and are always injected first.
How it works
A rule engine decays stale signals, drops low-confidence ones, then ranks and caps what gets injected, so Claude receives the right context rather than a dump.
Three hooks wire into ~/.claude/settings.json:
- SessionStart: compiles your persona live from
profile.jsonand injects it before you type. - Stop: runs the analysis pipeline and updates
profile.jsonwhen a session ends. - PostToolUse: logs each file edit in the background. Never blocks your session.
agent-persona injects only through the SessionStart hook. It never writes to your ~/.claude/CLAUDE.md.
Your profile
Everything lives in ~/.agent-persona/, on this machine, as plain JSON you can read and edit:
~/.agent-persona/
├── profile.json # your persona, the single source of truth
├── state.json # tracks which sessions were processed
└── history/
└── files_edited.jsonl # rolling 90-day log of edited files
The persona is compiled live from profile.json at session start, so there is no generated file to keep in sync.
Commands
| Command | What it does |
|---|---|
agent-persona install |
Register hooks and create ~/.agent-persona/. |
agent-persona uninstall [--purge] |
Remove hooks. With --purge, also wipe the profile store. |
agent-persona customize |
Set what Claude should know, how it should respond, and mute learned signals. |
agent-persona status |
Show your current persona: stack, preferences, sessions processed. |
agent-persona show |
Print the persona exactly as it is injected at session start. |
agent-persona analyze |
Re-run analysis on demand. |
agent-persona export [path] |
Export your profile to move to another machine. |
agent-persona import [path] |
Merge an exported profile into this machine. |
agent-persona reset --confirm |
Wipe the profile and start fresh. |
agent-persona doctor |
Check install health. |
Detach anytime
agent-persona is a layer, not a file edit, so backing out is clean:
- Mute a single learned signal with
agent-persona customize, then "Mute / unmute learned signals". - Remove everything with
agent-persona uninstall --purge.
Because it never touches your own files, nothing is left behind.
Move your persona to a new machine
# old machine
agent-persona export ~/persona.json
# new machine
agent-persona install
agent-persona import ~/persona.json
Profiles merge, so nothing is lost from either machine.
What it does not do (v1)
- No cloud. Your persona never leaves this machine unless you export it.
- No writes to your
CLAUDE.md, or to anything outside~/.agent-persona/. - One global persona, not per-project.
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.3.2.tar.gz.
File metadata
- Download URL: agent_persona-0.3.2.tar.gz
- Upload date:
- Size: 40.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26110cc06171ded23627e2b4b8f2d84586180bafb776a4239041df4e7fa637f0
|
|
| MD5 |
4bd89efd2e3bd80e1269208d345add27
|
|
| BLAKE2b-256 |
92a48d6871d76aa5a728c4ab9c1a71ea314b9434ffdd9b42db1801c519a330f1
|
Provenance
The following attestation bundles were made for agent_persona-0.3.2.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.3.2.tar.gz -
Subject digest:
26110cc06171ded23627e2b4b8f2d84586180bafb776a4239041df4e7fa637f0 - Sigstore transparency entry: 2124845044
- Sigstore integration time:
-
Permalink:
MaansiBisht/agent-persona@3c5813aa1ff6ef6bc6f13d61f5c4ee4d0993360c -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/MaansiBisht
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3c5813aa1ff6ef6bc6f13d61f5c4ee4d0993360c -
Trigger Event:
release
-
Statement type:
File details
Details for the file agent_persona-0.3.2-py3-none-any.whl.
File metadata
- Download URL: agent_persona-0.3.2-py3-none-any.whl
- Upload date:
- Size: 33.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfc83d63348250da2273f7dce396ed6ed15862a00c135e9c61401bbe30605c55
|
|
| MD5 |
59da70f1d189c911177c8938eeaa9392
|
|
| BLAKE2b-256 |
fff1f10b7447d34d1c498cf3ae2f98441bd87eae22046460596e9336b39ce954
|
Provenance
The following attestation bundles were made for agent_persona-0.3.2-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.3.2-py3-none-any.whl -
Subject digest:
bfc83d63348250da2273f7dce396ed6ed15862a00c135e9c61401bbe30605c55 - Sigstore transparency entry: 2124845100
- Sigstore integration time:
-
Permalink:
MaansiBisht/agent-persona@3c5813aa1ff6ef6bc6f13d61f5c4ee4d0993360c -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/MaansiBisht
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3c5813aa1ff6ef6bc6f13d61f5c4ee4d0993360c -
Trigger Event:
release
-
Statement type: