Inspiration

A USC student's week is spread across six tabs. Assignments live in Brightspace, questions in Piazza, jobs in Handshake, next term's classes in WebReg, campus events in EngageSC, and everything else in Google Calendar. Answering a simple question like "what's due this week, and when can I study for it?" means logging into each one, often with Duo every time, and stitching the answers together by hand.

We wanted one place to just ask. That became TrojanClaw: your USC semester, in one chat.

What it does

  • One sign-in. Continue with Google using your @usc.edu account, then log in to USC once (NetID + Duo). TrojanClaw connects Brightspace, Handshake and your WebReg course bin, and the login window closes by itself.
  • Chat that checks for you. Ask anything. The agent decides which sources to check and shows what it's doing as it works ("Checking Brightspace: upcoming due dates"). The reply streams in with its sources.
  • Answers as cards. Deadlines, jobs, events and posts come back as tidy cards with an Open button that goes to the real page. Every link comes from a tool result and is never made up.
  • Plan my week. TrojanClaw finds your free time in Google Calendar and drafts study blocks or event changes. Nothing is saved until you press Approve.
  • Safe by design. Every source is read-only. TrojanClaw never submits work, applies to jobs, or registers or drops classes.

How we built it

  • Frontend: React 19 + Vite + Tailwind in USC cardinal and gold, with light and dark themes, saved chats, file uploads and voice input.
  • Backend: FastAPI (Python 3.11). Chats, accounts and course data live in Supabase (Postgres + pgvector), and uploads go to private Supabase Storage.
  • Agent: Claude Sonnet 5.5 through the Anthropic tool runner, with our own MCP tools: deadlines, announcements, course search and campus info. Live connectors cover Brightspace, Handshake and Piazza, plus a Google Calendar gateway.
  • USC sign-in: USC has no public API for most of these systems. So the backend opens a small, real Chrome window with Playwright. The student logs in there with their own NetID and Duo. We then reuse that session to connect each source, and every account keeps its own separate sessions.
  • Cost control: We use prompt caching so earlier turns of a chat are re-read at the cache price. A cached token costs about a tenth of a fresh one. Without caching, turn $n$ costs roughly

$$ C_n \approx \sum_{k=1}^{n} t_k \cdot p $$

where $t_k$ is the number of tokens in turn $k$ and $p$ is the price per token. With caching, everything before turn $n$ is billed at the cache price:

$$ C_n \approx t_n \cdot p + 0.1 \cdot \sum_{k=1}^{n-1} t_k \cdot p $$

so long chats stay cheap.

  • Finding free time: Free slots are the day's window $W$ minus every busy event $B_i$ in your calendar:

$$ \text{Free} = W \setminus \bigcup_i B_i $$

TrojanClaw then fits study blocks into those gaps before asking you to approve them.

Challenges we ran into

  • The login window that never closed. After a refactor, the window stayed open even after a successful USC login. In Playwright's sync API, page.url only refreshes during browser calls, and we had switched to time.sleep. Using page.wait_for_timeout and re-reading cookies on every check fixed it. We added a regression test for it.
  • Google sign-in inside the automated window stalled on "Please wait. We're saving your session data." Google treats automated browsers with suspicion. We moved Google sign-in back to the student's own browser and kept only the USC login in the popup.
  • WebReg sits behind Cloudflare and sometimes asks for the login again. A required WebReg step would have left students stuck, so we made it silent and best-effort. It gets 30 seconds, never pops the window back up, and tries again on the next sign-in.
  • Trust. An assistant that invents a deadline or a link is worse than no assistant. We render links only from tool results, keep every source read-only, and require an explicit Approve before anything changes in your calendar.

What we learned

  • Most of the work is integration, not the model. Getting reliable, per-student sessions for systems with no API took far more effort than the agent itself.
  • Automate around authentication, not through it. Letting students log in themselves (NetID, Duo, Google) was both more robust and more trustworthy than scripting the login.
  • Small UX details build trust. A live status line ("Checking Brightspace…"), visible sources and an Approve button made students much more comfortable letting an AI touch their calendar.
  • Optional features should fail quietly. Making WebReg best-effort turned a sign-in blocker into a nice-to-have.

What's next for TrojanClaw

Proactive nudges, like "Assignment 3 is due tomorrow and you're free at 4," plus more campus sources and a mobile-first experience. Fight On! ✌️

Built With

Share this project:

Updates

Submission history