guide to agentprivacy
Browse collections
โœจVisualise
Connect with Star
Your VTA, your chosen perspective

The planned connection uses your VTA and the Trust Spanning Protocol to carry a scoped exchange for you or your agent. You choose what is presented; the receiving service checks the request before a view is shared.

This guide has no VTA connection adapter yet. Opening Star does not connect an identity or send a key.

Open Star โ†— ยท Inspect your City Key โ†—
guide / Skill / Wiki Claude Ghost

Wiki Claude Ghost

Category wikis ยท Version 5.5

A ghost page whose content is written live by Claude via the Anthropic API, inserted between a wiki form submission and the page-JSON response. Activates when building a Claude-authored ghost endpoint, a /claude-ghost FastAPI handler, or live LLM page generation in a fedwiki. Kept by the Librarian ๐Ÿ—ƒ๏ธ in the Tower's Wikis.

A Claude ghost page is a ghost page whose content is written by Claude in response to a user's query. A ghost page appears in the wiki lineup but is never stored on disk. This extends the pattern by inserting the Anthropic API call between the form submission and the page JSON response.

How It Works

  1. User types a topic in an html item form and submits
  2. The wiki POSTs {"query": "..."} to the FastAPI endpoint
  3. FastAPI calls claude-opus-4-8 with a system prompt instructing it to return page JSON
  4. Claude returns a complete wiki page as JSON (title + markdown story items)
  5. FastAPI parses and returns the JSON
  6. The wiki calls wiki.showResult() โ€” the Claude-authored page appears in the lineup

html Item Pattern

Add an html item pointing to the /claude-ghost endpoint:

{
  "type": "html",
  "id": "a1b2c3d4e5f60001",
  "text": "<form action=\"https://guide.agentprivacy.ai method=\"POST\">\n  <input name=\"query\" placeholder=\"ask Claude anythingโ€ฆ\">\n  <button type=\"submit\">Ask Claude</button>\n</form>"
}

FastAPI Endpoint

import anthropic, json, re

@app.post("/claude-ghost")
def claude_ghost(params: dict):
    query = params.get("query", "").strip() or "wiki"
    client = anthropic.Anthropic()
    message = client.messages.create(
        model="claude-opus-4-8",
        max_tokens=2048,
        thinking={"type": "adaptive"},
        system=(
            "You write federated wiki pages. "
            "Return ONLY valid JSON: "
            '{"title": "...", "story": [{"type": "markdown", "id": "16hexchars", "text": "..."}]}. '
            "Generate 4-6 story items. IDs must be random 16 hex chars. "
            "No prose outside the JSON. No markdown fences."
        ),
        messages=[{"role": "user", "content": f"Write a wiki page about: {query}"}]
    )
    text = next(
        (block.text for block in message.content if hasattr(block, "text")),
        "{}"
    )
    match = re.search(r'\{.*\}', text, re.DOTALL)
    return json.loads(match.group()) if match else {
        "title": f"Claude: {query}",
        "story": [{"type": "markdown", "id": make_id(), "text": f"*No response for: {query}*"}]
    }

Note: Thinking blocks in the response have no .text attribute โ€” the hasattr(block, "text") check skips them and extracts only the text content block.

Page JSON from Claude

Claude is instructed to return only raw JSON โ€” no markdown fences, no prose. The system prompt specifies:

  • title: a short descriptive title
  • story: array of markdown items with random 16-char hex ids
  • 4โ€“6 items covering the topic substantively

The endpoint uses regex to extract the JSON in case Claude wraps it in any extra whitespace.

Requirements

  • anthropic Python package installed (pip install anthropic)
  • ANTHROPIC_API_KEY set in the environment where FastAPI runs
  • Fast Caddy routing api โ†’ FastAPI :8000
  • CORS middleware on FastAPI (allow_origins=["*"])

Related Skills

  • agentprivacy-wiki-ghost-pages โ€” the base ghost page pattern (no Claude)
  • agentprivacy-wiki-page โ€” creating stored pages
  • agentprivacy-wiki-skill-vs-library โ€” when to make the page-structure a deterministic library

Verify: agentprivacy.ai ยท kept by the Librarian ๐Ÿ—ƒ๏ธ in the Tower's Wikis (the git-less onboarding layer) ยท model id current as of skill authoring; confirm the latest Claude model when deploying
Upstream: skill.fedwiki.club/claude-ghost-skill โ€” vendored + re-framed; not original agentprivacy authorship

Provenance

Forkable skill page migrated from the agentprivacy skills repo (persona/agentprivacy-wiki-claude-ghost, v5.5).
Source of truth: agentprivacy-skills-v5. Fork this page to materialize a local SKILL.md via fedwiki-to-skill.

origin: 0xagentprivacy ยท author: Mitchell Travers

Assets

๐Ÿ“Ž wiki-claude-ghostSKILL.md

Navigation

โ† Welcome Visitors ยท The Wikis