agentleFS
0xNyk0xNyk/xint/lib/CLAUDE.md

xint / lib

CLAUDE.md254 starsChanged 10 months agoMITView on GitHub

Edit lib/mcp.ts - add to TOOLS array and executeTool() method:

  • Reads credentials

The file

We split this CLAUDE.md into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All API functions throw on error

    line 47
  2. Very specific:

    Create lib/newcmd.ts with command logic

    line 52
  3. Distinctive:

    Add case to main switch statement

    line 54
  4. Distinctive:

    No unit tests in current codebase

    line 100
  5. Distinctive:

    Test API calls with real credentials

    line 101

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

xint TypeScript Codebase Guide

Project Overview

  • Lines: ~6,835 LOC across 18 modules
  • Runtime: Bun (TypeScript)
  • Entry: xint.ts (main CLI)

File Structure

lib/
├── api.ts          # X API wrapper (search, profile, thread, tweet)
├── article.ts      # Article fetching via xAI web_search
├── bookmarks.ts    # OAuth bookmark operations
├── cache.ts       # File-based cache (15min TTL)
├── costs.ts       # API cost tracking & budgets
├── engagement.ts  # Likes, following, bookmark writes
├── followers.ts   # Follower tracking with snapshots
├── format.ts      # Output formatters (Telegram, Markdown, CSV, JSONL)
├── grok.ts        # xAI Grok integration (chat, analyze, vision)
├── mcp.ts         # MCP server (STDIO + SSE modes)
├── oauth.ts       # OAuth 2.0 PKCE authentication
├── report.ts      # Intelligence report generation
├── sentiment.ts   # AI sentiment analysis
├── trends.ts      # Trending topics
├── watch.ts       # Real-time monitoring (polling)
└── x_search.ts    # xAI x-search (AI-powered search)

Key Patterns

Rate Limiting

  • 350ms delay between API requests
  • Respects x-rate-limit-reset headers

Caching

  • Default TTL: 15 minutes
  • Quick mode: 1 hour
  • Storage: data/cache/ (JSON files)

Token Storage

  • OAuth tokens: data/oauth-tokens.json
  • File permissions: chmod 600 (owner only)

Error Handling

  • All API functions throw on error
  • Common errors: 401 (auth), 429 (rate limit), 404 (not found)

Adding Commands

  1. Create lib/newcmd.ts with command logic
  2. Import in xint.ts
  3. Add case to main switch statement
import { cmdNewCmd } from "./lib/newcmd";

case "newcmd":
  await cmdNewCmd(args.slice(1));
  break;

Adding MCP Tools

Edit lib/mcp.ts - add to TOOLS array and executeTool() method:

{
  name: "xint_newtool",
  description: "Description",
  inputSchema: {
    type: "object",
    properties: { param: { type: "string" } },
    required: ["param"]
  }
}

Common Tasks

TaskLocation
Add new commandlib/newcmd.ts
Add MCP toollib/mcp.ts
Modify searchlib/api.ts
Add Grok featurelib/grok.ts
Change output formatlib/format.ts

Environment Variables

VariableRequiredPurpose
X_BEARER_TOKENYesX API v2
XAI_API_KEYNoGrok features
X_CLIENT_IDNoOAuth

Testing Notes

  • No unit tests in current codebase
  • Test API calls with real credentials
  • Cache operations use temp directories

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.