<!-- LLM_VERSION_INFO
FORMAT: text/markdown
CONTENT_TYPE: article
ORIGINAL_URL: https://graphite.com/features/agents
ALTERNATE_VERSION: features/agents/index.html (text/html)
EXTRACTION_DATE: 2026-04-18T23:48:10.979Z

This is the markdown version with text-only content (images converted to alt-text).
For rich formatting with images, request the HTML version at: features/agents/index.html
-->

# Agents - Create, review, and iterate. All in one place.

Start building with Cursor Cloud Agents, now in Graphite.

## Agent capabilities demo

### New useLocalStorage Hook (src/hooks/use-local-storage.ts)
- Full TypeScript generics support
- SSR-compatible with hydration state tracking
- Cross-tab and cross-component synchronization
- Custom serializer/deserializer support
- Comprehensive test suite (20 test cases)

### New debounce and throttle Utilities (src/lib/utils/debounce.ts)
- Leading/trailing edge configuration
- maxWait option for guaranteed execution
- cancel(), flush(), and pending() methods
- Full TypeScript type definitions
- Comprehensive test suite (31 test cases)

### Enhanced useToggleState Hook
- Added UseToggleStateOptions interface
- Optional onOn, onOff, onChange callbacks
- Added isOff convenience property
- Maintained backward compatibility

#### Agent Capabilities Demonstrated
- Codebase navigation and pattern understanding
- Creating new TypeScript files following existing conventions
- Writing comprehensive unit tests with Jest
- Multi-file refactoring with backward compatibility
- Git operations (commits, branch management, push via API)
- CI verification

---

### Summary

Introduce new `useLocalStorage` hook, debounce and throttle utilities, and enhance `useToggleState` to serve as a comprehensive demo of Agent capabilities.

#### Code Example: useLocalStorage Hook
```typescript
import { useState, useCallback } from "react";

type Serializer<T> = {
    serialize: (value: T) => string;
    deserialize: (raw: string) => T;
};

interface Options<T> {
    key: string;
    initialValue: T;
    serializer?: Serializer<T>;
}

export function useLocalStorage<T>(options: Options<T>): [T, (value: T) => void] {
    const { key, initialValue, serializer } = options;
    const ser = serializer ?? JSON;

const [stored, setStored] = useState<T>(
        () => {
            const item = localStorage.getItem(key);
            return item ? ser.deserialize(item) : initialValue;
        }
    );

const setValue = useCallback(
        (next: T) => {
            localStorage.setItem(key, ser.serialize(next));
            setStored(next);
        },
        [key, ser]
    );

return [stored, setValue] as const;
}
```

---

### Discussion
- Review latest version 
- This PR was sent to merge by Cameron Collis.

### Label: Agent capabilities demo
