Documentation
Everything you need to set up and use Askance with your coding agents.
Quick Start
Get Askance running in under 60 seconds.
1. Install the CLI
npm install --save-dev @askance/cli2. Initialize your project
npx askance initThis creates .askance/config.json (settings), configures .claude/settings.json (hooks + MCP server), and adds Askance instructions to CLAUDE.md.
3. Log in
npx askance loginOpens your browser for OAuth sign-in (GitHub, Google, or Microsoft). Your credentials are saved locally to .askance/credentials.
4. Restart your Claude session
Hooks and MCP tools are loaded at session start. Restart Claude Code or Claude Desktop to pick up the new configuration.
That's it! Open https://app.askance.app to see your dashboard. Any tool calls your agent makes will now show up for approval.
VS Code + Claude Code Setup
Step-by-step guide for using Askance with the Claude Code extension in VS Code.
Prerequisites
- VS Code with the Claude Code extension installed
- Node.js 18+ and npm
- A project directory where Claude Code is active
Step 1: Install @askance/cli
npm install --save-dev @askance/cliInstalls the Askance CLI as a development dependency. This includes the hook handler, MCP server, and CLI tools.
Step 2: Initialize configuration
npx askance initThis creates a config file and configures hooks in your Claude settings:
{
"apiUrl": "https://api.askance.app",
"projectId": "",
"keepAlive": {
"enabled": true,
"duration": 3600,
"pollInterval": 30
}
}Policy rules are managed via the dashboard, not locally. The hooks config:
{
"hooks": {
"PreToolUse": [
{
"matcher": "^(?!mcp__askance__).*",
"hooks": [
{
"type": "command",
"command": "node \"node_modules/@askance/cli/dist/hook-handler/index.js\"",
"timeout": 120
}
]
}
],
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "node \"node_modules/@askance/cli/dist/hook-handler/stop-hook.js\"",
"timeout": 10
}
]
}
]
},
"mcpServers": {
"askance": {
"command": "node",
"args": ["node_modules/@askance/cli/dist/mcp-server/index.js"]
}
}
}Step 3: Log in
npx askance loginOpens your browser for OAuth sign-in. Your credentials are saved to .askance/credentials and your project is linked automatically.
Step 4: Restart Claude Code session
Claude Code loads hooks and MCP servers at session start. After configuring Askance, restart your Claude Code session so it picks up the new hooks.
Important: Hooks and MCP servers load at session start. If you don't restart, Claude Code won't use the Askance hooks. You can restart by closing and reopening the Claude Code panel in VS Code.
How it works
When Claude Code tries to use a tool (like running a Bash command or editing a file):
- The PreToolUse hook intercepts the tool call and sends it to the Askance cloud API
- The API evaluates it against your policy rules configured in the dashboard
- If the rule says
allow, it proceeds immediately - If the rule says
gate, it appears in your dashboard for approval - If the rule says
deny, it's blocked automatically - You approve or deny from any device — the agent continues based on your decision
Claude Desktop (Claude for Work)
Askance works with Claude Desktop's local tool execution, including Claude for Work deployments.
How it works with Claude Desktop
Claude Desktop can execute local tools on your machine. When configured with Askance, the same hook system intercepts these tool calls before execution.
- •The hook handler intercepts tool calls and routes them to the daemon
- •The MCP server provides tools for the agent:
wait,pending,status,check_instructions - •Keep-alive polling prevents timeouts during long sessions
Configuration
The same .claude/settings.json configuration applies. Run npx askance init in your project directory and Claude Desktop will pick up the hooks when executing local tools.
MCP Tools Available to Claude
When the MCP server is configured, Claude gets these additional tools:
| Tool | Description |
|---|---|
askance_wait | Blocks until a pending approval is decided |
askance_pending | Lists all pending approvals |
askance_status | Returns daemon health and connection status |
askance_check_instructions | Checks for new instructions from the dashboard |
Claude for Work
If your organization uses Claude for Work, the same setup applies. Askance works with any Claude client that supports hooks and MCP servers for local tool execution. Speak with your IT admin about configuring .claude/settings.json in your approved project templates.
Cursor IDE Setup
Askance integrates with Cursor IDE using the same PreToolUse hook mechanism available in Claude Code.
Prerequisites
- Cursor IDE installed
- Node.js 18+ and npm
- A project directory where Cursor's AI agent is active
Step 1: Install @askance/cli
npm install --save-dev @askance/cliStep 2: Initialize with Cursor configuration
npx askance init --cursorThis creates .cursor/settings.json with hook and MCP server configuration:
{
"cursor.hooks": {
"preToolUse": {
"command": "node",
"args": ["node_modules/@askance/cli/dist/hook-handler/index.js"],
"matchTools": [".*"],
"excludeTools": ["mcp__askance__.*"]
}
},
"cursor.mcp": {
"servers": {
"askance": {
"command": "node",
"args": ["node_modules/@askance/cli/dist/mcp-server/index.js"]
}
}
}
}Step 3: Log in
npx askance loginAuthenticates with Askance and links your project.
Step 4: Restart Cursor
Restart Cursor to load the hooks and MCP server. After restarting, Cursor's AI agent will route all tool calls through Askance for policy evaluation.
Important: Hooks and MCP servers load at startup. Make sure to restart Cursor after running npx askance init.
How it works
Askance hooks into Cursor's tool execution pipeline using the same PreToolUse hook mechanism used for Claude Code:
- The hook handler intercepts the tool call and sends it to the Askance cloud API
- The policy engine evaluates your project's rules
- If gated, the approval appears in your Askance dashboard
- You approve or deny from any device — web, desktop, or mobile
GitHub Copilot Setup
Askance can integrate with GitHub Copilot's coding agent to provide approval workflows for tool calls made during Copilot agent sessions.
Step 1: Install @askance/cli
npm install --save-dev @askance/cliStep 2: Initialize with Copilot configuration
npx askance init --copilotThis creates .github/copilot-config.json with hook configuration:
{
"copilot.agent": {
"hooks": {
"preToolUse": {
"command": "node",
"args": ["node_modules/@askance/cli/dist/hook-handler/index.js"],
"matchTools": [".*"]
}
}
}
}Step 3: Log in
npx askance loginAuthenticates with Askance and links your project.
How it works
When GitHub Copilot's agent attempts to execute tools (file edits, terminal commands, etc.), Askance intercepts the call and routes it through the Askance cloud API for evaluation against your policy rules.
Limitations
- •GitHub Copilot agent workflow support is evolving; check GitHub's documentation for the latest hook API
- •Some Copilot operations may bypass local hooks when running in GitHub's cloud environment
Multi-Agent Setup
Need to configure Askance for multiple agents at once? Use npx askance init --all to set up Claude Code, Cursor, and GitHub Copilot configurations in a single command.
Policy Configuration
Control how Askance handles each tool call using policy rules managed via the dashboard or CLI templates.
Rule Structure
Each rule has a name, regex patterns for tool and command matching, an action, and a risk level. Rules are evaluated top-to-bottom; the first match wins.
{
"Name": "Human-readable rule name",
"ToolPattern": "^Bashquot;, // Regex matching tool name
"CommandPattern": "npm (test|run)", // Regex matching command/input (optional)
"Action": "Allow", // Allow | Gate | Deny
"Risk": "Low" // Low | Medium | High
}Rules are managed via the dashboard or by applying a template: npx askance template moderate
Actions
Risk Levels
Risk levels are informational — they help you understand the danger level at a glance in the dashboard.
Policy Templates
Apply a pre-built set of rules with a single command:
npx askance template moderateAvailable templates:
conservativeGate all writes and bash, deny destructive commandsmoderateAllow safe reads and test/build, gate the rest (recommended)permissiveAllow everything, deny only destructive commandsci-safeMinimal permissions for CI/CD environmentsYou can also create and edit individual rules in the dashboard.
Keep-Alive Configuration
The keep_alive section controls how the MCP server maintains the connection. poll_interval sets how often it pings the API (default: 30 seconds), and duration sets the total keep-alive time (default: 3600 seconds / 1 hour).
Dashboard Guide
The web dashboard is your control center for managing agent approvals and instructions.
Approval Cards
Each pending tool call appears as an approval card showing:
- Tool name and risk level (color-coded badge)
- Tool input (command, file path, or content preview)
- Context summary from the agent's recent work
- Timestamp and time elapsed
You can:
- Approve — let the tool call proceed
- Deny — block the tool call
- Other — provide a custom response or instruction
- Approve Always — approve and create an auto-approval rule
Sending Instructions
Each project panel has an instruction input field. Type a message and send it — the agent will pick it up via the MCP server's check_instructions tool. Use this to redirect the agent, provide clarification, or adjust priorities without waiting for a tool call.
Multi-Project View
The dashboard supports monitoring up to 4 projects simultaneously in a grid layout. Select projects from the dropdown in each panel. Real-time updates sync across all panels via SignalR.
Audit Log
The audit log shows a complete history of every tool call, including the decision made, which policy rule matched, timestamps, and risk levels. Filter by project and paginate through history.
API Reference
The Askance cloud API is hosted at api.askance.app. All endpoints require authentication via JWT bearer token.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/intercept | Submit a tool call for policy evaluation |
| GET | /api/approvals | List pending approvals |
| POST | /api/approvals/:id/decide | Approve or deny a tool call |
| GET | /api/approvals/:id/wait | Long-poll for approval decision |
| GET | /api/queue | Get current approval queue |
| GET | /api/projects | List projects |
| POST | /api/projects | Create a project |
| GET | /api/rules/:projectId | Get project rules |
| PUT | /api/rules/:projectId | Update project rules |
| GET | /api/rules/global | Get global rules |
| PUT | /api/rules/global | Update global rules |
| GET | /api/audit/:projectId | Get audit log entries |
| POST | /api/instructions/:projectId | Send instruction to agent |
| GET | /api/instructions/:projectId/wait | Long-poll for new instructions |
| GET | /api/settings | Get user settings |
| PUT | /api/settings | Update user settings |
| GET | /api/health | Health check |
CLI Commands
npx askance init
Initializes Askance in the current project. Creates .askance/config.json (settings), configures agent hooks and MCP server, and adds Askance instructions to CLAUDE.md.
Options: --cursor (Cursor IDE), --copilot (GitHub Copilot), --all (all agents).
npx askance login
Authenticates with the Askance cloud service. Opens your browser for OAuth sign-in (GitHub, Google, or Microsoft). Saves credentials to .askance/credentials and links your project automatically.
npx askance template <name>
Applies a pre-built policy template to your project. Available templates: conservative, moderate, permissive, ci-safe.
npx askance help
Shows CLI usage information and available commands.