[Feature Request] API endpoint for Claude.ai user preferences — enabling Claude Code hooks and agents to update persistent context
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Claude Code has powerful automation capabilities — hooks (PostSessionEnd), Dispatch, Managed Agents, and subagents. But none of them can write back to the one persistent context mechanism that spans all Claude.ai conversations: the user preferences field (Settings → Profile → Personal Preferences).
This means there's no programmatic way to close the loop between a Claude Code session and a user's Claude.ai experience. Insights, patterns, and context extracted during coding sessions stay siloed in CLAUDE.md or local files — they never flow into the preferences that shape every Claude.ai conversation.
The infrastructure for automation exists on the Claude Code side. What's missing is the API surface on the Claude.ai side.
What's Broken Today
Claude Code can read and write its own context (CLAUDE.md, settings.json, subagents) — but it can't touch Claude.ai preferences at all.
| Capability | Claude Code | Claude.ai Preferences |
|-----------|------------|----------------------|
| Read | ✅ Full filesystem access | ❌ No API |
| Write | ✅ Full filesystem access | ❌ No API |
| Automate | ✅ Hooks, Dispatch, Managed Agents | ❌ Manual text editing only |
| Persist across sessions | ✅ CLAUDE.md | ✅ Preferences field |
| Span all conversations | ❌ Project-scoped | ✅ Account-wide |
The preferences field is the only account-wide persistent context — but it's locked behind a manual UI with no programmatic access.
Proposed Solution
A REST API endpoint that allows authenticated read and write operations on the user preferences field:
GET /v1/user/preferences → Returns current preferences text
PUT /v1/user/preferences → Replaces preferences text
PATCH /v1/user/preferences → Appends to or patches preferences text
Authentication via the same OAuth flow Claude Code already uses, or API key scoped to account settings.
Why PATCH matters
The highest-value use case isn't replacing the whole document — it's appending session-derived context. A PATCH endpoint that supports append operations would enable:
PostSessionEndhooks that extract insights from a Claude Code session and push them to Claude.ai preferences automatically- Managed Agents that maintain a user's preference document as part of an automated workflow
- Cross-substrate pipelines where work in Claude Code informs the Claude.ai experience without manual copy-paste
- Subagents like a
@preferences-syncagent that reconciles CLAUDE.md with Claude.ai preferences
Use Cases
1. Claude Code hook → Claude.ai preferences pipeline
A PostSessionEnd hook runs after every Claude Code session. Today it can write to local files. With a preferences API, it could extract key decisions, patterns, or project context and push them to the user's Claude.ai preferences — so the next Claude.ai conversation already knows what was built.
2. CLAUDE.md ↔ Preferences sync
Users maintain rich CLAUDE.md files for their projects. Relevant cross-project context (coding style, architectural preferences, domain expertise) should be pushable to Claude.ai preferences so chat conversations benefit from coding context.
3. Onboarding and migration
New users could bootstrap their preferences from a template or migration tool rather than typing into a text field from scratch. The recently shipped ChatGPT/Gemini memory import tool demonstrates that Anthropic recognizes migration matters — extending that to preferences would complete the pattern.
4. Living document maintenance
Preferences that aren't maintained degrade over time. An API would enable tools (including Claude Code subagents) to help users keep their preferences current rather than letting them go stale after initial setup.
What This Unlocks for the Platform
The gap between "capture everything" (what memory does) and "tell the system what matters" (what curated preferences do) is the key unsolved problem in persistent context. Memory accumulates automatically. Preferences require deliberate curation. An API would let tools assist with that curation — converting the preferences field from a static config file into a living document that compounds in value over time.
Claude Code already has the automation layer (hooks, dispatch, agents). Claude.ai already has the persistence layer (preferences). Connecting them with an API closes the circuit.
How This Differs From Existing Issues
| Issue | Ask | How this differs |
|-------|-----|-----------------|
| #22648 | Sync Claude Code settings across devices | Settings sync (device → device). This is about Claude.ai preferences (product → product). |
| #15183 | Read GUI preferences from CLI | Read-only, closed as duplicate. This asks for read AND write. |
| #21264 | Sync skills between Claude.ai and Code | Skills sync. This is about the preferences text field. |
| #26176 | Conversation history sync | History sync. This is about the persistent context document. |
None of the existing issues ask for a write API for user preferences. That's the specific unlock.
Environment
- Claude Code: latest
- Claude.ai: web and mobile
- Claude Max subscription
- macOS
Additional Context
The OAuth token already has user:profile scope. The authenticated session infrastructure exists. This is an API surface addition, not a new auth flow.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗