claude-code - 💡(How to fix) Fix [Feature Request] API endpoint for Claude.ai user preferences — enabling Claude Code hooks and agents to update persistent context [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47115Fetched 2026-04-13 05:41:03
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
labeled ×2

Fix Action

Fix / Workaround

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).

CapabilityClaude CodeClaude.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
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

Code Example

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
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • 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.

CapabilityClaude CodeClaude.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:

  • PostSessionEnd hooks 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-sync agent 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

IssueAskHow this differs
#22648Sync Claude Code settings across devicesSettings sync (device → device). This is about Claude.ai preferences (product → product).
#15183Read GUI preferences from CLIRead-only, closed as duplicate. This asks for read AND write.
#21264Sync skills between Claude.ai and CodeSkills sync. This is about the preferences text field.
#26176Conversation history syncHistory 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.

extent analysis

TL;DR

Implementing a REST API endpoint for reading and writing user preferences in Claude.ai would allow for programmatic access and automation of preference updates.

Guidance

  • The proposed solution involves creating a REST API endpoint with GET, PUT, and PATCH methods to interact with the user preferences field.
  • Authentication can be handled using the existing OAuth flow with the user:profile scope.
  • The PATCH endpoint is crucial for appending session-derived context to the preferences field, enabling use cases like automated pipelines and cross-substrate workflows.
  • The API should be designed to handle append operations, allowing for seamless integration with Claude Code's automation capabilities.

Example

A potential API endpoint implementation could look like this:

GET /v1/user/preferences HTTP/1.1
Host: claude.ai
Authorization: Bearer <oauth_token>

HTTP/1.1 200 OK
Content-Type: text/plain
Preferences text...
PATCH /v1/user/preferences HTTP/1.1
Host: claude.ai
Authorization: Bearer <oauth_token>
Content-Type: application/json
{
  "append": "New preference text"
}

HTTP/1.1 200 OK

Notes

The implementation of the API endpoint should consider security and access control measures to ensure that only authorized users can modify their preferences.

Recommendation

Apply the proposed solution by implementing the REST API endpoint for user preferences, as it would unlock programmatic access and automation of preference updates, enhancing the overall user experience.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Feature Request] API endpoint for Claude.ai user preferences — enabling Claude Code hooks and agents to update persistent context [1 participants]