Credential Setup Guide
Complete guide to configuring GitHub authentication for the invoking-github skill.
Overview
This skill requires a GitHub Personal Access Token (PAT). Two configuration methods are supported:
- Project Knowledge (Primary) - Recommended for claude.ai chat users
- API Credentials Skill (Fallback) - For power users or local environments
Method 1: Project Knowledge (Recommended)
Best for Claude.ai chat (mobile/web/desktop).
Step 1: Create GitHub Personal Access Token
Option A: Fine-Grained Token (Recommended - More Secure)
- Go to https://github.com/settings/tokens?type=beta
- Click "Generate new token"
- Configure:
- Token name:
claude-ai-chat(or your preference) - Expiration: 90 days (or your preference)
- Repository access: Select specific repositories you want Claude to access
- Permissions:
- Repository permissions → Contents: Read and write
- Repository permissions → Pull requests: Read and write
- Token name:
- Click "Generate token"
- Copy the token immediately (you won't see it again!)
Option B: Classic Token (Easier - Less Secure)
- Go to https://github.com/settings/tokens
- Click "Generate new token (classic)"
- Configure:
- Note:
claude-ai-chat - Expiration: 90 days
- Scopes:
- ✓
repo(Full control of private repositories) - Or just
public_repoif you only need public repo access
- ✓
- Note:
- Click "Generate token"
- Copy the token immediately
Step 2: Add Token to Project Knowledge
In Claude.ai Web:
- Open your project in Claude.ai
- Click the project name/settings
- Click "Add to Project Knowledge"
- Create a new document:
- Title:
GITHUB_API_KEY(exactly this, all caps) - Content: Paste your token (e.g.,
ghp_1234567890abcdefgh...)
- Title:
- Click "Add" or "Save"
In Claude.ai Mobile (iOS/Android):
- Open your project
- Tap the menu icon
- Select "Project Knowledge"
- Tap "Add document"
- Title:
GITHUB_API_KEY - Content: Paste your token
- Save
Step 3: Verify Configuration
Ask Claude to run this test:
import sys
sys.path.append('/home/user/claude-skills/invoking-github/scripts')
from github_client import get_github_token
try:
token = get_github_token()
masked = f"{token[:7]}...{token[-4:]}"
print(f"✓ Token found: {masked}")
print(f"✓ Token length: {len(token)} characters")
except ValueError as e:
print(f"✗ Token not found")
print(e)Expected output:
✓ Token found: ghp_123...xyz
✓ Token length: 40 charactersMethod 2: API Credentials Skill (Fallback)
For power users who prefer file-based configuration.
Step 1: Create Token
Follow the same token creation steps as Method 1.
Step 2: Add to api-credentials config.json
- Edit
/home/user/claude-skills/api-credentials/config.json - Add your token:
{ "anthropic_api_key": "sk-ant-...", "google_api_key": "AIza...", "github_api_key": "ghp_your_token_here" } - Save the file
Step 3: Verify Configuration
Same test as Method 1 above.
Security Best Practices
1. Use Fine-Grained Tokens
Fine-grained tokens are more secure because:
- Limited to specific repositories
- Specific permissions (not full repo access)
- Easier to audit
2. Set Expiration Dates
- Recommended: 90 days
- Maximum: 1 year (but not recommended)
- Never select "No expiration" for production use
3. Minimal Permissions
Only grant permissions you actually need:
| Operation | Required Permissions |
|---|---|
| Read files | Contents: Read |
| Commit files | Contents: Read and write |
| Create PRs | Contents: Read and write + Pull requests: Read and write |
4. Token Rotation
Rotate tokens regularly:
- Set calendar reminder before expiration
- Create new token
- Update Project Knowledge or config.json
- Revoke old token
5. Never Commit Tokens
- Never paste tokens in code that gets committed
- Never commit config.json with real tokens
- Use .gitignore (api-credentials/config.json is already gitignored)
6. Revoke Compromised Tokens
If a token is accidentally exposed:
- Go to https://github.com/settings/tokens
- Find the token
- Click "Delete" or "Revoke"
- Create a new token immediately
- Update configuration
Troubleshooting
"No GitHub API token found!"
Problem: Token not detected in either location.
Solutions:
- Check Project Knowledge document is titled exactly
GITHUB_API_KEY(all caps) - Verify token is the only content in the document (no extra text)
- Check for trailing whitespace
- Try Method 2 (api-credentials) as a test
"Authentication failed"
Problem: Token is invalid or expired.
Solutions:
- Verify token hasn't expired (check GitHub settings)
- Ensure no extra characters when copying token
- Generate a new token and update configuration
"Access denied"
Problem: Token lacks required permissions.
Solutions:
- For fine-grained tokens: Check repository access includes your target repo
- For fine-grained tokens: Verify Contents and Pull requests permissions
- For classic tokens: Ensure
reposcope is selected - Generate new token with correct permissions
Token works in web but not mobile
Problem: Project Knowledge might not sync properly.
Solutions:
- Wait a few minutes for sync
- Refresh the app
- Try deleting and re-adding the document
- Use api-credentials method as workaround (if app supports file access)
FAQ
Q: Can I use the GitHub OAuth connection in claude.ai UI?
A: No, the OAuth connection in the UI is not accessible to skills. You must create a Personal Access Token manually.
Q: How long do tokens last?
A: Based on your selection during creation. Recommended: 90 days with rotation.
Q: Can I use the same token across multiple Claude projects?
A: Yes, but for security, consider creating separate tokens per project with limited repo access.
Q: What happens when my token expires?
A: The skill will fail with authentication errors. Create a new token and update your configuration.
Q: Can I use a GitHub App token?
A: Not directly. This skill is designed for Personal Access Tokens. GitHub App tokens have different authentication flows.
Q: Is my token secure in Project Knowledge?
A: Project Knowledge is stored securely, but treat it like a password - use minimal permissions, set expiration, rotate regularly.
Next Steps
- SKILL.md - Core skill documentation
- iterating-integration.md - Auto-sync DEVLOG patterns
- troubleshooting.md - Common issues and solutions